Skip to content

Commit

Permalink
Rename make_token_stream.
Browse files Browse the repository at this point in the history
And update the comment. Clearly the return type of this function was
changed at some point in the past, but its name and comment weren't
updated to match.
  • Loading branch information
nnethercote committed Jul 2, 2024
1 parent 3d750e2 commit 6f60156
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions compiler/rustc_parse/src/parser/attr_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
.take(self.num_calls as usize);

if self.replace_ranges.is_empty() {
make_token_stream(tokens, self.break_last_token)
make_attr_token_stream(tokens, self.break_last_token)
} else {
let mut tokens: Vec<_> = tokens.collect();
let mut replace_ranges = self.replace_ranges.to_vec();
Expand Down Expand Up @@ -166,7 +166,7 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
new_tokens.into_iter().chain(filler),
);
}
make_token_stream(tokens.into_iter(), self.break_last_token)
make_attr_token_stream(tokens.into_iter(), self.break_last_token)
}
}
}
Expand Down Expand Up @@ -374,10 +374,10 @@ impl<'a> Parser<'a> {
}
}

/// Converts a flattened iterator of tokens (including open and close delimiter tokens)
/// into a `TokenStream`, creating a `TokenTree::Delimited` for each matching pair
/// of open and close delims.
fn make_token_stream(
/// Converts a flattened iterator of tokens (including open and close delimiter tokens) into an
/// `AttrTokenStream`, creating an `AttrTokenTree::Delimited` for each matching pair of open and
/// close delims.
fn make_attr_token_stream(
mut iter: impl Iterator<Item = (FlatToken, Spacing)>,
break_last_token: bool,
) -> AttrTokenStream {
Expand Down

0 comments on commit 6f60156

Please sign in to comment.