Skip to content

Commit

Permalink
Disallow consecutive path separator in use paths
Browse files Browse the repository at this point in the history
For example: `use ::{::krate};`
  • Loading branch information
dtolnay committed Mar 22, 2023
1 parent 8ae37b7 commit e6b1bdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ pub(crate) mod parsing {
let vis: Visibility = input.parse()?;
let use_token: Token![use] = input.parse()?;
let leading_colon: Option<Token![::]> = input.parse()?;
let tree = parse_use_tree(input, allow_crate_root_in_path)?;
let tree = parse_use_tree(input, allow_crate_root_in_path && leading_colon.is_none())?;
let semi_token: Token![;] = input.parse()?;

let tree = match tree {
Expand Down

0 comments on commit e6b1bdf

Please sign in to comment.