diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /src/tools/rust-analyzer/crates/ide/src/goto_definition.rs | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide/src/goto_definition.rs')
-rw-r--r-- | src/tools/rust-analyzer/crates/ide/src/goto_definition.rs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs index 93019527f..cf0819a25 100644 --- a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs +++ b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs @@ -766,6 +766,13 @@ trait Foo$0 { } check( r#" +trait Foo$0 = ; + //^^^ +"#, + ); + + check( + r#" mod bar$0 { } //^^^ "#, @@ -1066,6 +1073,23 @@ fn f() -> impl Sub<Item$0 = u8> {} } #[test] + fn goto_def_for_module_declaration_in_path_if_types_and_values_same_name() { + check( + r#" +mod bar { + pub struct Foo {} + //^^^ + pub fn Foo() {} +} + +fn baz() { + let _foo_enum: bar::Foo$0 = bar::Foo {}; +} + "#, + ) + } + + #[test] fn unknown_assoc_ty() { check_unresolved( r#" @@ -1406,7 +1430,6 @@ include!("included.rs$0"); ); } - #[cfg(test)] mod goto_impl_of_trait_fn { use super::check; #[test] |