Skip to content

Commit 457d86d

Browse files
committed
Auto merge of #147793 - cjgillot:no-null-op, r=scottmcm,oli-obk
Replace NullOp::SizeOf and NullOp::AlignOf by lang items. Part of rust-lang/rust#146411 Fixes rust-lang/rust#119729 Keeps rust-lang/rust#136175 as it involves `offset_of!` which this PR does not touch. r? `@ghost`
2 parents 2b788f9 + 9f39a14 commit 457d86d

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

tests/fail/layout_cycle.stderr

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,20 @@ error[E0391]: cycle detected when computing layout of `S<S<()>>`
22
|
33
= note: ...which requires computing layout of `<S<()> as Tr>::I`...
44
= note: ...which again requires computing layout of `S<S<()>>`, completing the cycle
5+
note: cycle used when const-evaluating + checking `core::mem::SizedTypeProperties::SIZE`
6+
--> RUSTLIB/core/src/mem/mod.rs:LL:CC
7+
|
8+
LL | const SIZE: usize = intrinsics::size_of::<Self>();
9+
| ^^^^^^^^^^^^^^^^^
510
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
611

7-
error: post-monomorphization error: a cycle occurred during layout computation
12+
error[E0080]: a cycle occurred during layout computation
813
--> RUSTLIB/core/src/mem/mod.rs:LL:CC
914
|
10-
LL | intrinsics::size_of::<T>()
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ post-monomorphization error occurred here
12-
|
13-
= note: BACKTRACE:
14-
= note: inside `std::mem::size_of::<S<S<()>>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
15-
note: inside `foo::<S<()>>`
16-
--> tests/fail/layout_cycle.rs:LL:CC
17-
|
18-
LL | mem::size_of::<S<T>>()
19-
| ^^^^^^^^^^^^^^^^^^^^^^
20-
note: inside `main`
21-
--> tests/fail/layout_cycle.rs:LL:CC
22-
|
23-
LL | println!("{}", foo::<S<()>>());
24-
| ^^^^^^^^^^^^^^
25-
26-
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
15+
LL | const SIZE: usize = intrinsics::size_of::<Self>();
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `<S<S<()>> as std::mem::SizedTypeProperties>::SIZE` failed here
2717

2818
error: aborting due to 2 previous errors
2919

30-
For more information about this error, try `rustc --explain E0391`.
20+
Some errors have detailed explanations: E0080, E0391.
21+
For more information about an error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)