Skip to content

Commit

Permalink
Auto merge of #3336 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
Rustup

Also add regression test for rust-lang/rust#121508.
  • Loading branch information
bors committed Feb 29, 2024
2 parents c772b23 + 27fdc8e commit f79ea81
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3d145ea1cae47ad392173f890577788117da3d9
1a1876c9790f168fb51afa335a7ba3e6fc267d75
2 changes: 1 addition & 1 deletion src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
queries: &'tcx rustc_interface::Queries<'tcx>,
) -> Compilation {
queries.global_ctxt().unwrap().enter(|tcx| {
if tcx.sess.dcx().has_errors().is_some() {
if tcx.sess.dcx().has_errors_or_delayed_bugs().is_some() {
tcx.dcx().fatal("miri cannot be run on programs that fail compilation");
}

Expand Down
16 changes: 16 additions & 0 deletions tests/fail/rustc-error2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Regression test for /~https://github.com/rust-lang/rust/issues/121508.
struct Struct<T>(T);

impl<T> std::ops::Deref for Struct<T> {
type Target = dyn Fn(T);
fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
//~^ERROR: undeclared crate or module
unimplemented!()
}
}

fn main() {
let f = Struct(Default::default());
f(0);
f(0);
}
9 changes: 9 additions & 0 deletions tests/fail/rustc-error2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid`
--> $DIR/rustc-error2.rs:LL:CC
|
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.

0 comments on commit f79ea81

Please sign in to comment.