diff options
author | Aleksey Kladov <[email protected]> | 2021-06-14 19:23:59 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-14 20:37:06 +0100 |
commit | 58712088ac2114e41d754ec6bcb5cd6bc3625256 (patch) | |
tree | 396054e4e67546aa158ab2bca0ad2f0f0b9d8fff /crates/ide_diagnostics/src/handlers/missing_fields.rs | |
parent | 38ae18b7592f97a7058d97928307bccbd881a582 (diff) |
minor: make diagnostics more similar
Diffstat (limited to 'crates/ide_diagnostics/src/handlers/missing_fields.rs')
-rw-r--r-- | crates/ide_diagnostics/src/handlers/missing_fields.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide_diagnostics/src/handlers/missing_fields.rs b/crates/ide_diagnostics/src/handlers/missing_fields.rs index bc82c0e4a..0dd36fb23 100644 --- a/crates/ide_diagnostics/src/handlers/missing_fields.rs +++ b/crates/ide_diagnostics/src/handlers/missing_fields.rs | |||
@@ -323,4 +323,33 @@ fn f() { | |||
323 | "#, | 323 | "#, |
324 | ); | 324 | ); |
325 | } | 325 | } |
326 | |||
327 | #[test] | ||
328 | fn import_extern_crate_clash_with_inner_item() { | ||
329 | // This is more of a resolver test, but doesn't really work with the hir_def testsuite. | ||
330 | |||
331 | check_diagnostics( | ||
332 | r#" | ||
333 | //- /lib.rs crate:lib deps:jwt | ||
334 | mod permissions; | ||
335 | |||
336 | use permissions::jwt; | ||
337 | |||
338 | fn f() { | ||
339 | fn inner() {} | ||
340 | jwt::Claims {}; // should resolve to the local one with 0 fields, and not get a diagnostic | ||
341 | } | ||
342 | |||
343 | //- /permissions.rs | ||
344 | pub mod jwt { | ||
345 | pub struct Claims {} | ||
346 | } | ||
347 | |||
348 | //- /jwt/lib.rs crate:jwt | ||
349 | pub struct Claims { | ||
350 | field: u8, | ||
351 | } | ||
352 | "#, | ||
353 | ); | ||
354 | } | ||
326 | } | 355 | } |