Skip to content
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

Rollup of 8 pull requests #127454

Merged
merged 26 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69446e3
Print `TypeId` as hex for debugging
tgross35 Jun 30, 2024
23e5468
LinkedList's Cursor: method to get a ref to the cursor's list
GrigorenkoPV Jun 30, 2024
ba1ebc2
doc: update config file path in platform-support/wasm32-wasip1-thread…
iawia002 Jul 2, 2024
a737237
Add test case demonstrating equality of paths "foo/bar" and "foobar"
zanieb Jul 3, 2024
dd509c7
Add more test cases for path comparisons
zanieb Jul 3, 2024
f216834
stir the hash state a little to avoid prefix collisions
the8472 Jul 3, 2024
dd790ab
Remove some unnecessary integer conversions.
nnethercote Jul 4, 2024
ccd8dcc
Describe Sized requirements for mem::offset_of
nicholasbishop Jul 5, 2024
14b859f
Rename `Attribute::tokens` (the inherent method).
nnethercote Jul 3, 2024
88373e9
Remove an unnecessary local variable.
nnethercote Jul 3, 2024
b261501
Remove `HasSpan` trait.
nnethercote Jul 4, 2024
9d33a8f
Simplify `ReplaceRange`.
nnethercote Jul 4, 2024
3a5c4b6
Rename some attribute types for consistency.
nnethercote Jul 7, 2024
022582c
Remove `Clone` derive from `LazyAttrTokenStreamImpl`.
nnethercote Jul 7, 2024
9f16f1f
Add an size assertion.
nnethercote Jul 7, 2024
9e0aab7
Use `filter_map` instead of `flat_map` in `configure_tokens`.
nnethercote Jul 7, 2024
bee9120
once_lock: make test not take as long in Miri
RalfJung Jul 7, 2024
9da3638
Move a span_bug under a condition that cx is tainted
gurry Jul 7, 2024
35a1ca0
Rollup merge of #127179 - tgross35:typeid-debug-hex, r=Nilstrieb
matthiaskrgr Jul 7, 2024
94d07be
Rollup merge of #127189 - GrigorenkoPV:linkedlist-cursor-list, r=Nils…
matthiaskrgr Jul 7, 2024
d84d221
Rollup merge of #127236 - iawia002:wasip1-threads-doc, r=Nilstrieb
matthiaskrgr Jul 7, 2024
56557c4
Rollup merge of #127297 - the8472:path-new-hash, r=Nilstrieb
matthiaskrgr Jul 7, 2024
510020a
Rollup merge of #127308 - nnethercote:Attribute-cleanups, r=petrochenkov
matthiaskrgr Jul 7, 2024
c40530d
Rollup merge of #127354 - nicholasbishop:bishop-sized-doc, r=Nilstrieb
matthiaskrgr Jul 7, 2024
1ee6345
Rollup merge of #127409 - gurry:127332-ice-with-expr-not-struct, r=ol…
matthiaskrgr Jul 7, 2024
b564c51
Rollup merge of #127447 - RalfJung:once_lock_miri, r=joboet
matthiaskrgr Jul 7, 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
Remove some unnecessary integer conversions.
These should have been removed in #127233 when the positions were
changed from `usize` to `u32`.
  • Loading branch information
nnethercote committed Jul 4, 2024
commit dd790ab8ef8cc2a89f04f2be73c86230595a48a3
4 changes: 2 additions & 2 deletions compiler/rustc_parse/src/parser/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl<'a> Parser<'a> {
pub fn parse_inner_attributes(&mut self) -> PResult<'a, ast::AttrVec> {
let mut attrs = ast::AttrVec::new();
loop {
let start_pos: u32 = self.num_bump_calls.try_into().unwrap();
let start_pos = self.num_bump_calls;
// Only try to parse if it is an inner attribute (has `!`).
let attr = if self.check(&token::Pound) && self.look_ahead(1, |t| t == &token::Not) {
Some(self.parse_attribute(InnerAttrPolicy::Permitted)?)
Expand All @@ -303,7 +303,7 @@ impl<'a> Parser<'a> {
None
};
if let Some(attr) = attr {
let end_pos: u32 = self.num_bump_calls.try_into().unwrap();
let end_pos = self.num_bump_calls;
// If we are currently capturing tokens, mark the location of this inner attribute.
// If capturing ends up creating a `LazyAttrTokenStream`, we will include
// this replace range with it, removing the inner attribute from the final
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_parse/src/parser/attr_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use rustc_errors::PResult;
use rustc_session::parse::ParseSess;
use rustc_span::{sym, Span, DUMMY_SP};

use std::ops::Range;
use std::{iter, mem};

/// A wrapper type to ensure that the parser handles outer attributes correctly.
Expand Down Expand Up @@ -356,8 +355,7 @@ impl<'a> Parser<'a> {
let new_tokens = vec![(FlatToken::AttrTarget(attr_data), Spacing::Alone)];

assert!(!self.break_last_token, "Should not have unglued last token with cfg attr");
let range: Range<u32> = (start_pos.try_into().unwrap())..(end_pos.try_into().unwrap());
self.capture_state.replace_ranges.push((range, new_tokens));
self.capture_state.replace_ranges.push((start_pos..end_pos, new_tokens));
self.capture_state.replace_ranges.extend(inner_attr_replace_ranges);
}

Expand Down