File tree 3 files changed +4
-24
lines changed
compiler/rustc_expand/src
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> {
1274
1274
res
1275
1275
}
1276
1276
fn declared_names ( & self ) -> Vec < Ident > {
1277
- struct ItemNameVisitor ( Vec < Ident > , u8 ) ;
1277
+ struct ItemNameVisitor ( Vec < Ident > ) ;
1278
1278
impl Visitor < ' _ > for ItemNameVisitor {
1279
1279
fn visit_item ( & mut self , i : & ast:: Item ) {
1280
- self . 1 += 1 ;
1281
1280
if let ItemKind :: Use ( ut) = & i. kind {
1282
1281
fn collect_use_tree_leaves ( ut : & ast:: UseTree , idents : & mut Vec < Ident > ) {
1283
1282
match & ut. kind {
@@ -1295,19 +1294,10 @@ impl InvocationCollectorNode for P<ast::Item> {
1295
1294
} else {
1296
1295
self . 0 . push ( i. ident ) ;
1297
1296
}
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 ;
1307
1297
}
1308
1298
}
1309
1299
1310
- let mut v = ItemNameVisitor ( vec ! [ ] , 0 ) ;
1300
+ let mut v = ItemNameVisitor ( vec ! [ ] ) ;
1311
1301
v. visit_item ( self ) ;
1312
1302
v. 0
1313
1303
}
Original file line number Diff line number Diff line change 1
1
pub mod inner {
2
- #[ cfg( FALSE ) ] //~ NOTE the item is gated here
2
+ #[ cfg( FALSE ) ]
3
3
mod gone {
4
- pub fn uwu ( ) { } //~ NOTE found an item that was configured out
4
+ pub fn uwu ( ) { }
5
5
}
6
6
7
7
#[ 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`
50
50
LL | inner::uwu();
51
51
| ^^^ not found in `inner`
52
52
|
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
- | ^^^^^^^^^^^^^
63
53
note: found an item that was configured out
64
54
--> $DIR/diagnostics-reexport.rs:8:20
65
55
|
You can’t perform that action at this time.
0 commit comments