mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
ast_lowering: Fix regression in use ::{} imports.
This commit is contained in:
@@ -569,7 +569,12 @@ fn lower_use_tree(
|
||||
});
|
||||
}
|
||||
|
||||
let path = if trees.is_empty() && !prefix.segments.is_empty() {
|
||||
// Condition should match `build_reduced_graph_for_use_tree`.
|
||||
let path = if trees.is_empty()
|
||||
&& !(prefix.segments.is_empty()
|
||||
|| prefix.segments.len() == 1
|
||||
&& prefix.segments[0].ident.name == kw::PathRoot)
|
||||
{
|
||||
// For empty lists we need to lower the prefix so it is checked for things
|
||||
// like stability later.
|
||||
let res = self.lower_import_res(id, span);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// check-pass
|
||||
// edition:2015
|
||||
|
||||
use {};
|
||||
use {{}};
|
||||
|
||||
use ::{};
|
||||
use {::{}};
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// check-pass
|
||||
// edition:2018
|
||||
|
||||
use {};
|
||||
use {{}};
|
||||
|
||||
use ::{};
|
||||
use {::{}};
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user