File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
ide_diagnostics/src/handlers Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,12 @@ impl<'a> DeclValidator<'a> {
181
181
AttrDefId :: ExternBlockId ( id) => Some ( id. lookup ( self . db . upcast ( ) ) . container . into ( ) ) ,
182
182
// These warnings should not explore macro definitions at all
183
183
AttrDefId :: MacroDefId ( _) => None ,
184
- // Will never occur under an enum/struct/union/type alias
185
- AttrDefId :: AdtId ( _) => None ,
184
+ AttrDefId :: AdtId ( aid) => match aid {
185
+ AdtId :: StructId ( sid) => Some ( sid. lookup ( self . db . upcast ( ) ) . container . into ( ) ) ,
186
+ AdtId :: EnumId ( eid) => Some ( eid. lookup ( self . db . upcast ( ) ) . container . into ( ) ) ,
187
+ // Unions aren't yet supported
188
+ AdtId :: UnionId ( _) => None ,
189
+ } ,
186
190
AttrDefId :: FieldId ( _) => None ,
187
191
AttrDefId :: EnumVariantId ( _) => None ,
188
192
AttrDefId :: TypeAliasId ( _) => None ,
Original file line number Diff line number Diff line change @@ -332,6 +332,15 @@ fn main() {
332
332
check_diagnostics (
333
333
r#"
334
334
#![allow(non_snake_case)]
335
+ #![allow(non_camel_case_types)]
336
+
337
+ struct S {
338
+ fooBar: bool,
339
+ }
340
+
341
+ enum E {
342
+ fooBar,
343
+ }
335
344
336
345
mod F {
337
346
fn CheckItWorksWithCrateAttr(BAD_NAME_HI: u8) {}
You can’t perform that action at this time.
0 commit comments