Skip to content

Commit

Permalink
Merge pull request #1742 from dtolnay/usecrateroot
Browse files Browse the repository at this point in the history
Fix construction of UseGroup containing crate roots
  • Loading branch information
dtolnay authored Sep 27, 2024
2 parents 037861a + 31e8632 commit af63396
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 af63396

Please sign in to comment.