File tree 3 files changed +38
-2
lines changed
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> {
3729
3729
Node :: Lifetime ( lt) => Some ( lt. ident ) ,
3730
3730
Node :: GenericParam ( p) => Some ( p. name . ident ( ) ) ,
3731
3731
Node :: TypeBinding ( b) => Some ( b. ident ) ,
3732
+ Node :: PatField ( f) => Some ( f. ident ) ,
3733
+ Node :: ExprField ( f) => Some ( f. ident ) ,
3732
3734
Node :: Param ( ..)
3733
3735
| Node :: AnonConst ( ..)
3734
3736
| Node :: ConstBlock ( ..)
@@ -3737,8 +3739,6 @@ impl<'hir> Node<'hir> {
3737
3739
| Node :: Block ( ..)
3738
3740
| Node :: Ctor ( ..)
3739
3741
| Node :: Pat ( ..)
3740
- | Node :: PatField ( ..)
3741
- | Node :: ExprField ( ..)
3742
3742
| Node :: Arm ( ..)
3743
3743
| Node :: Local ( ..)
3744
3744
| 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