add regression test
This commit is contained in:
parent
70758a788b
commit
2a376ceb8d
2 changed files with 25 additions and 0 deletions
16
src/tools/miri/tests/fail/rustc-error2.rs
Normal file
16
src/tools/miri/tests/fail/rustc-error2.rs
Normal file
|
@ -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
src/tools/miri/tests/fail/rustc-error2.stderr
Normal file
9
src/tools/miri/tests/fail/rustc-error2.stderr
Normal file
|
@ -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`.
|
Loading…
Add table
Add a link
Reference in a new issue