Fix use tree desugaring

This commit is contained in:
Florian Diebold 2019-01-08 14:39:55 +01:00
parent 562b448f9e
commit d4b44a092f
2 changed files with 30 additions and 1 deletions

View File

@ -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(

View File

@ -150,7 +150,7 @@ fn convert_path(prefix: Option<Path>, path: &ast::Path) -> Option<Path> {
let prefix = if let Some(qual) = path.qualifier() {
Some(convert_path(prefix, qual)?)
} else {
None
prefix
};
let segment = path.segment()?;
let res = match segment.kind()? {