File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -931,7 +931,8 @@ impl<'db> SemanticsImpl<'db> {
931
931
file. with_value ( derive. clone ( ) ) ,
932
932
) ?;
933
933
let attrs = adt_def. attrs ( self . db ) ;
934
- let mut derive_paths = attrs[ attr_id] . parse_path_comma_token_tree ( ) ?;
934
+ // FIXME: https://github.com/rust-analyzer/rust-analyzer/issues/11298
935
+ let mut derive_paths = attrs. get ( attr_id) ?. parse_path_comma_token_tree ( ) ?;
935
936
936
937
let derive_idx = tt
937
938
. syntax ( )
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ impl ops::Deref for RawAttrs {
72
72
}
73
73
}
74
74
}
75
+ impl Attrs {
76
+ pub fn get ( & self , AttrId { ast_index, .. } : AttrId ) -> Option < & Attr > {
77
+ ( * * self ) . get ( ast_index as usize )
78
+ }
79
+ }
75
80
76
81
impl ops:: Deref for Attrs {
77
82
type Target = [ Attr ] ;
You can’t perform that action at this time.
0 commit comments