Fix use tree desugaring
This commit is contained in:
parent
562b448f9e
commit
d4b44a092f
@ -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(
|
||||
|
@ -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()? {
|
||||
|
Loading…
x
Reference in New Issue
Block a user