Skip to content

Commit f5de23b

Browse files
committed
Add the test case mentioned in rust-lang#74236
1 parent b929f72 commit f5de23b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// edition:2018
2+
3+
mod private { pub struct Pub; }
4+
5+
// Reexport built-in attribute without a DefId (requires Rust 2018).
6+
pub use cfg_attr as attr;
7+
// This export needs to be after the built-in attribute to trigger the bug.
8+
pub use private::Pub as Renamed;
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// edition:2018
2+
// aux-build:dep.rs
3+
// compile-flags:--extern dep
4+
5+
fn main() {
6+
// Trigger an error that will print the path of dep::private::Pub (as "dep::Renamed").
7+
let () = dep::Renamed;
8+
//~^ ERROR mismatched types
9+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/main.rs:7:9
3+
|
4+
LL | let () = dep::Renamed;
5+
| ^^ ------------ this expression has type `dep::Renamed`
6+
| |
7+
| expected struct `dep::Renamed`, found `()`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)