Skip to content

Commit

Permalink
Fix construction of UseGroup containing crate roots
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 27, 2024
1 parent 037861a commit 31e8632
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1411,14 +1411,16 @@ pub(crate) mod parsing {
&content,
allow_crate_root_in_path && !this_tree_starts_with_crate_root,
)? {
Some(tree) => items.push_value(tree),
None => has_any_crate_root_in_path = true,
Some(tree) if !has_any_crate_root_in_path => items.push_value(tree),
_ => has_any_crate_root_in_path = true,
}
if content.is_empty() {
break;
}
let comma: Token![,] = content.parse()?;
items.push_punct(comma);
if !has_any_crate_root_in_path {
items.push_punct(comma);
}
}
if has_any_crate_root_in_path {
Ok(None)
Expand Down

0 comments on commit 31e8632

Please sign in to comment.