From 7b456552b8ea254b060a2182907d3db98494fcbb Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 2 Dec 2020 09:52:08 +0100 Subject: Don't discard PathKind::Abs information in lower_use::convert_path --- crates/hir_def/src/nameres/tests/mod_resolution.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crates/hir_def/src/nameres') diff --git a/crates/hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs index ba295fd9e..ef6f85e15 100644 --- a/crates/hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs @@ -798,3 +798,24 @@ mod foo; "#, ); } + +#[test] +fn abs_path_ignores_local() { + check( + r#" +//- /main.rs crate:main deps:core +pub use ::core::hash::Hash; +pub mod core {} + +//- /lib.rs crate:core +pub mod hash { pub trait Hash {} } +"#, + expect![[r#" + crate + Hash: t + core: t + + crate::core + "#]], + ); +} -- cgit v1.2.3