File tree 4 files changed +29
-1
lines changed
test/ui/issues/issue-74236
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ pub trait PrettyPrinter<'tcx>:
393
393
. tcx ( )
394
394
. item_children ( visible_parent)
395
395
. iter ( )
396
- . find ( |child| child. res . def_id ( ) == def_id)
396
+ . find ( |child| child. res . opt_def_id ( ) == Some ( def_id) )
397
397
. map ( |child| child. ident . name ) ;
398
398
if let Some ( reexport) = reexport {
399
399
* name = reexport;
Original file line number Diff line number Diff line change
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 ;
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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`.
You can’t perform that action at this time.
0 commit comments