Skip to content

Rustup #3336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 29, 2024
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`.