Skip to content

Commit 27fdc8e

Browse files
committed
add regression test
1 parent c20b2db commit 27fdc8e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/fail/rustc-error2.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/121508.
2+
struct Struct<T>(T);
3+
4+
impl<T> std::ops::Deref for Struct<T> {
5+
type Target = dyn Fn(T);
6+
fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
7+
//~^ERROR: undeclared crate or module
8+
unimplemented!()
9+
}
10+
}
11+
12+
fn main() {
13+
let f = Struct(Default::default());
14+
f(0);
15+
f(0);
16+
}

tests/fail/rustc-error2.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid`
2+
--> $DIR/rustc-error2.rs:LL:CC
3+
|
4+
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid`
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0433`.

0 commit comments

Comments
 (0)