Skip to content

Rollup of 9 pull requests #127249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 39 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c54a2a5
Make mtime of reproducible tarball dependent on git commit
Kobzol Jun 27, 2024
e1999f9
Add support for mtime override to `generate` and `combine` rust-insta…
Kobzol Jun 29, 2024
8127461
Move -Zprint-type-sizes and -Zprint-vtable-sizes into codegen_and_bui…
bjorn3 Jun 30, 2024
61963fa
Avoid an ICE reachable through const eval shenanigans
oli-obk Jul 1, 2024
9d5da39
Revert some ICE avoiding logic that is not necessary anymore
oli-obk Jul 1, 2024
a5d3723
Prefer item-local tainting checks over global error count checks
oli-obk Jul 1, 2024
814bfe9
This check should now be unreachable
oli-obk Jul 1, 2024
bd2ff51
Move codegen_and_build_linker from Queries to Linker
bjorn3 Jun 30, 2024
ec2d1b0
Minor change
bjorn3 Jun 30, 2024
f276459
Inline Query::default()
bjorn3 Jun 30, 2024
c260d3e
Always preserve user-written comments in assembly
tgross35 Jun 21, 2024
cd70362
Rename the `asm-comments` compiler flag to `verbose-asm`
tgross35 Jun 21, 2024
b079ac7
Add documentation for -Zverbose-asm
tgross35 Jun 21, 2024
1680b79
Simplify `CfgEval`.
nnethercote Jun 27, 2024
d6c0b81
Fix a typo in a comment.
nnethercote Jun 27, 2024
f852568
Change `AttrTokenStream::to_tokenstream` to `to_token_trees`.
nnethercote Jun 27, 2024
0cfd247
Rename `TokenStream::new` argument.
nnethercote Jun 27, 2024
7416c20
Just `push` in `AttrTokenStream::to_token_trees`.
nnethercote Jun 27, 2024
36c30a9
Fix comment.
nnethercote Jul 1, 2024
2342770
Flip an if/else in `AttrTokenStream::to_attr_token_stream`.
nnethercote Jul 1, 2024
8b5a7eb
Move things around in `collect_tokens_trailing_token`.
nnethercote Jul 1, 2024
f5b2896
Move more things around in `collect_tokens_trailing_token`.
nnethercote Jul 1, 2024
3d750e2
Shrink parser positions from `usize` to `u32`.
nnethercote Jul 2, 2024
6f60156
Rename `make_token_stream`.
nnethercote Jul 2, 2024
edeebe6
Import `std::{iter,mem}`.
nnethercote Jul 2, 2024
8c353cb
Disable rmake test inaccessible-temp-dir on riscv64
Hoverbear Jun 24, 2024
8ce8c62
add test
BoxyUwU Jul 2, 2024
a21ba34
add TyCtxt::as_lang_item, use in new solver
compiler-errors Jun 30, 2024
5a83751
Make fn traits into first-class TraitSolverLangItems to avoid needing…
compiler-errors Jun 30, 2024
ecdaff2
Actually report normalization-based type errors correctly for alias-r…
compiler-errors Jun 12, 2024
48c9046
Rollup merge of #126403 - compiler-errors:better-type-errors, r=lcnr
matthiaskrgr Jul 2, 2024
0799a2c
Rollup merge of #126803 - tgross35:verbose-asm, r=Amanieu
matthiaskrgr Jul 2, 2024
1aa14d0
Rollup merge of #126917 - ferrocene:hoverbear/riscv64-inaccessible-te…
matthiaskrgr Jul 2, 2024
22d4ce4
Rollup merge of #127050 - Kobzol:reproducibility-git, r=onur-ozkan
matthiaskrgr Jul 2, 2024
26a71b9
Rollup merge of #127145 - compiler-errors:as_lang_item, r=lcnr
matthiaskrgr Jul 2, 2024
b0d8e78
Rollup merge of #127184 - bjorn3:interface_refactor2, r=Nadrieril
matthiaskrgr Jul 2, 2024
9a4e4e0
Rollup merge of #127202 - oli-obk:do_not_count_errors, r=wesleywiser
matthiaskrgr Jul 2, 2024
0108a84
Rollup merge of #127233 - nnethercote:parser-cleanups, r=petrochenkov
matthiaskrgr Jul 2, 2024
7500abf
Rollup merge of #127245 - BoxyUwU:gce_hang_test, r=Nilstrieb
matthiaskrgr Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move more things around in collect_tokens_trailing_token.
To make things a little clearer, and to avoid some `mut` variables.
  • Loading branch information
nnethercote committed Jul 2, 2024
commit f5b28968db07c96d1e2fe239d380fe5a418e85c5
41 changes: 18 additions & 23 deletions compiler/rustc_parse/src/parser/attr_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,37 +276,32 @@ impl<'a> Parser<'a> {

let replace_ranges_end = self.capture_state.replace_ranges.len();

let mut end_pos = self.num_bump_calls;

let mut captured_trailing = false;

// Capture a trailing token if requested by the callback 'f'
match trailing {
TrailingToken::None => {}
let captured_trailing = match trailing {
TrailingToken::None => false,
TrailingToken::Gt => {
assert_eq!(self.token.kind, token::Gt);
false
}
TrailingToken::Semi => {
assert_eq!(self.token.kind, token::Semi);
end_pos += 1;
captured_trailing = true;
true
}
TrailingToken::MaybeComma => {
if self.token.kind == token::Comma {
end_pos += 1;
captured_trailing = true;
}
}
}
TrailingToken::MaybeComma => self.token.kind == token::Comma,
};

// If we 'broke' the last token (e.g. breaking a '>>' token to two '>' tokens),
// then extend the range of captured tokens to include it, since the parser
// was not actually bumped past it. When the `LazyAttrTokenStream` gets converted
// into an `AttrTokenStream`, we will create the proper token.
if self.break_last_token {
assert!(!captured_trailing, "Cannot set break_last_token and have trailing token");
end_pos += 1;
}
assert!(
!(self.break_last_token && captured_trailing),
"Cannot set break_last_token and have trailing token"
);

let end_pos = self.num_bump_calls
+ captured_trailing as usize
// If we 'broke' the last token (e.g. breaking a '>>' token to two '>' tokens), then
// extend the range of captured tokens to include it, since the parser was not actually
// bumped past it. When the `LazyAttrTokenStream` gets converted into an
// `AttrTokenStream`, we will create the proper token.
+ self.break_last_token as usize;

let num_calls = end_pos - start_pos;

Expand Down