File tree Expand file tree Collapse file tree 3 files changed +4
-24
lines changed
compiler/rustc_expand/src Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -1274,10 +1274,9 @@ impl InvocationCollectorNode for P<ast::Item> {
12741274 res
12751275 }
12761276 fn declared_names ( & self ) -> Vec < Ident > {
1277- struct ItemNameVisitor ( Vec < Ident > , u8 ) ;
1277+ struct ItemNameVisitor ( Vec < Ident > ) ;
12781278 impl Visitor < ' _ > for ItemNameVisitor {
12791279 fn visit_item ( & mut self , i : & ast:: Item ) {
1280- self . 1 += 1 ;
12811280 if let ItemKind :: Use ( ut) = & i. kind {
12821281 fn collect_use_tree_leaves ( ut : & ast:: UseTree , idents : & mut Vec < Ident > ) {
12831282 match & ut. kind {
@@ -1295,19 +1294,10 @@ impl InvocationCollectorNode for P<ast::Item> {
12951294 } else {
12961295 self . 0 . push ( i. ident ) ;
12971296 }
1298- if self . 1 < 4 {
1299- // We only visit up to 3 levels of nesting from this item, like if we were
1300- // looking at `mod a`, we'd find item `a::b::c`. We have this limit to guard
1301- // against deeply nested modules behind `cfg` flags, where we could spend
1302- // significant time collecting this information purely for a potential
1303- // diagnostic improvement.
1304- visit:: walk_item ( self , i) ;
1305- }
1306- self . 1 -= 1 ;
13071297 }
13081298 }
13091299
1310- let mut v = ItemNameVisitor ( vec ! [ ] , 0 ) ;
1300+ let mut v = ItemNameVisitor ( vec ! [ ] ) ;
13111301 v. visit_item ( self ) ;
13121302 v. 0
13131303 }
Original file line number Diff line number Diff line change 11pub mod inner {
2- #[ cfg( FALSE ) ] //~ NOTE the item is gated here
2+ #[ cfg( FALSE ) ]
33 mod gone {
4- pub fn uwu ( ) { } //~ NOTE found an item that was configured out
4+ pub fn uwu ( ) { }
55 }
66
77 #[ cfg( FALSE ) ] //~ NOTE the item is gated here
Original file line number Diff line number Diff line change @@ -50,16 +50,6 @@ error[E0425]: cannot find function `uwu` in module `inner`
5050LL | inner::uwu();
5151 | ^^^ not found in `inner`
5252 |
53- note: found an item that was configured out
54- --> $DIR/diagnostics-reexport.rs:4:16
55- |
56- LL | pub fn uwu() {}
57- | ^^^
58- note: the item is gated here
59- --> $DIR/diagnostics-reexport.rs:2:5
60- |
61- LL | #[cfg(FALSE)]
62- | ^^^^^^^^^^^^^
6353note: found an item that was configured out
6454 --> $DIR/diagnostics-reexport.rs:8:20
6555 |
You can’t perform that action at this time.
0 commit comments