From d4b44a092f1fd5267a02719667d8d5e22ba0d904 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 8 Jan 2019 14:39:55 +0100 Subject: Fix use tree desugaring --- crates/ra_hir/src/nameres/tests.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/ra_hir/src/nameres') diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 82222d1ad..4e3659ad0 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -78,6 +78,35 @@ fn item_map_smoke_test() { ); } +#[test] +fn use_trees() { + let (item_map, module_id) = item_map( + " + //- /lib.rs + mod foo; + + use crate::foo::bar::{Baz, Quux}; + <|> + + //- /foo/mod.rs + pub mod bar; + + //- /foo/bar.rs + pub struct Baz; + pub enum Quux {}; + ", + ); + check_module_item_map( + &item_map, + module_id, + " + Baz: t v + Quux: t + foo: t + ", + ); +} + #[test] fn re_exports() { let (item_map, module_id) = item_map( -- cgit v1.2.3