Skip to content

Commit b7da5a7

Browse files
committed
Auto merge of #154727 - JonathanBrouwer:rollup-I3Rg5V6, r=JonathanBrouwer
Rollup of 20 pull requests Successful merges: - rust-lang/rust#153105 (Compute the result of a projection type with region errors) - rust-lang/rust#153532 (Attributes containing rustc) - rust-lang/rust#153960 (Make `layout_of` cycles fatal errors) - rust-lang/rust#154527 (Emit pre-expansion feature gate warnings for negative impls and specialization) - rust-lang/rust#154666 (Remove `StableHashContext` impls) - rust-lang/rust#154669 (Introduce #[diagnostic::on_move] on `Arc`) - rust-lang/rust#154710 (opaque_generic_const_args -> generic_const_args) - rust-lang/rust#154712 (Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph") - rust-lang/rust#153614 (`FindParamInClause` handle edge-cases) - rust-lang/rust#154213 (tidy-alphabetical: fix line number in error message) - rust-lang/rust#154425 (Migrate transmute tests) - rust-lang/rust#154442 (Export `derive` at the crate root: `core::derive` and `std::derive`) - rust-lang/rust#154469 (mGCA: Lower spans for literal const args) - rust-lang/rust#154578 (Rename `probe_ty_var` to `try_resolve_ty_var`) - rust-lang/rust#154615 (Moving issues) - rust-lang/rust#154644 (rustdoc: seperate methods and associated functions in sidebar) - rust-lang/rust#154660 (Avoid creating async return opaques for foreign async fns) - rust-lang/rust#154671 (Add a test for a past ICE when calling a const fn of an unresolved type with the wrong number of args) - rust-lang/rust#154680 ([rustdoc] Replace `DocContext` with `TyCtxt` wherever possible) - rust-lang/rust#154709 (Revert `Ty` type alias in `rustc_type_ir`)
2 parents 4293796 + 3c0c125 commit b7da5a7

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

src/eval.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::{iter, thread};
1010

1111
use rustc_abi::ExternAbi;
1212
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
13+
use rustc_errors::FatalErrorMarker;
1314
use rustc_hir::def::Namespace;
1415
use rustc_hir::def_id::DefId;
1516
use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutCx};
@@ -477,7 +478,11 @@ pub fn eval_entry<'tcx>(
477478
let res: thread::Result<InterpResult<'_, !>> =
478479
panic::catch_unwind(AssertUnwindSafe(|| ecx.run_threads()));
479480
let res = res.unwrap_or_else(|panic_payload| {
480-
ecx.handle_ice();
481+
// rustc "handles" some errors by unwinding with FatalErrorMarker
482+
// (after emitting suitable diagnostics), so do not treat those as ICEs.
483+
if !panic_payload.is::<FatalErrorMarker>() {
484+
ecx.handle_ice();
485+
}
481486
panic::resume_unwind(panic_payload)
482487
});
483488
// Obtain the result of the execution. This is always an `Err`, but that doesn't necessarily

tests/fail/layout_cycle.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@error-in-other-file: a cycle occurred during layout computation
2-
//~^ ERROR: cycle detected when computing layout of
1+
//~ ERROR: cycle detected when computing layout of
32

43
use std::mem;
54

tests/fail/layout_cycle.stderr

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ LL | const SIZE: usize = intrinsics::size_of::<Self>();
99
| ^^^^^^^^^^^^^^^^^
1010
= 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
1111

12-
error[E0080]: a cycle occurred during layout computation
13-
--> RUSTLIB/core/src/mem/mod.rs:LL:CC
14-
|
15-
LL | const SIZE: usize = intrinsics::size_of::<Self>();
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `<S<S<()>> as std::mem::SizedTypeProperties>::SIZE` failed here
17-
18-
error: aborting due to 2 previous errors
12+
error: aborting due to 1 previous error
1913

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

0 commit comments

Comments
 (0)