File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -3729,6 +3729,8 @@ impl<'hir> Node<'hir> {
37293729 Node :: Lifetime ( lt) => Some ( lt. ident ) ,
37303730 Node :: GenericParam ( p) => Some ( p. name . ident ( ) ) ,
37313731 Node :: TypeBinding ( b) => Some ( b. ident ) ,
3732+ Node :: PatField ( f) => Some ( f. ident ) ,
3733+ Node :: ExprField ( f) => Some ( f. ident ) ,
37323734 Node :: Param ( ..)
37333735 | Node :: AnonConst ( ..)
37343736 | Node :: ConstBlock ( ..)
@@ -3737,8 +3739,6 @@ impl<'hir> Node<'hir> {
37373739 | Node :: Block ( ..)
37383740 | Node :: Ctor ( ..)
37393741 | Node :: Pat ( ..)
3740- | Node :: PatField ( ..)
3741- | Node :: ExprField ( ..)
37423742 | Node :: Arm ( ..)
37433743 | Node :: Local ( ..)
37443744 | Node :: Crate ( ..)
Original file line number Diff line number Diff line change 1+ // Regression test for issue 115264
2+ // Tests that retrieving the ident of the X::foo field
3+ // in main() does not cause an ICE
4+
5+ // check-pass
6+
7+ #[ allow( dead_code) ]
8+ struct X {
9+ foo : i32 ,
10+ }
11+
12+ fn main ( ) {
13+ let _ = X {
14+ #[ doc( alias = "StructItem" ) ]
15+ foo : 123 ,
16+ } ;
17+ }
Original file line number Diff line number Diff line change 1+ // Regression test for issue 115264
2+ // Tests that retrieving the ident of 'foo' variable in
3+ // the pattern inside main() does not cause an ICE
4+
5+ // check-pass
6+
7+ struct X {
8+ foo : i32 ,
9+ }
10+
11+ #[ allow( unused_variables) ]
12+ fn main ( ) {
13+ let X {
14+ #[ doc( alias = "StructItem" ) ]
15+ foo
16+ } = X {
17+ foo : 123
18+ } ;
19+ }
You can’t perform that action at this time.
0 commit comments