Skip to content

Rollup of 9 pull requests #142020

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 26 commits into from
Closed
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
ee1c2d5
Remove `MetaItemListParser::all_{word,path}_list`, which are unused.
nnethercote May 20, 2025
a822e55
Remove an unnecessary lifetime.
nnethercote May 20, 2025
ea3b3fd
Remove `MetaItemParser::{word,word_without_args,path_is}`.
nnethercote May 20, 2025
2cd2d24
Remove `MetaItemParser::{path,deconstruct}`.
nnethercote May 20, 2025
e5c78de
Rename `MetaItemParser::path_without_args` as `MetaItemParser::path`.
nnethercote May 20, 2025
6b5b97a
Fix incorrect eq_unspanned in TokenStream
chenyukang May 26, 2025
d3347bb
remove eq_unspanned from TokenStream
chenyukang May 26, 2025
80e44de
remove f16: From<u16>
usamoi Jun 2, 2025
a20cf47
Lightly tweak docs for BTree{Map,Set}::extract_if
rs-sac Jun 2, 2025
e87f138
add tests
Qelxiros Jun 3, 2025
4996946
Add missing 2015 edition directives
Veykril Jun 3, 2025
21a739f
add tests for negative numbers
Qelxiros Jun 4, 2025
bded701
run `check::Std` as the final step
onur-ozkan Jun 4, 2025
e66948c
make it possible to request stage 0 std with `Builder::ensure`
onur-ozkan Jun 4, 2025
7af12a1
remove outdated RUSTC_SYSROOT handling for ci-rustc
onur-ozkan Jun 4, 2025
ed300d8
Improve some `Visitor` comments.
nnethercote Jun 4, 2025
ccf9a89
coretests: move float tests from num to floats module and use a more …
RalfJung Jun 1, 2025
294b944
Rollup merge of #141271 - nnethercote:attr-streamline, r=jdonszelmann
matthiaskrgr Jun 4, 2025
6141078
Rollup merge of #141570 - chenyukang:yukang-fix-eq_unspanned, r=worki…
matthiaskrgr Jun 4, 2025
37f0b5f
Rollup merge of #141857 - RalfJung:coretests-floats, r=tgross35
matthiaskrgr Jun 4, 2025
c53b07e
Rollup merge of #141893 - usamoi:lossless, r=tgross35
matthiaskrgr Jun 4, 2025
45fca57
Rollup merge of #141924 - rs-sac:extr-doc, r=jhpratt
matthiaskrgr Jun 4, 2025
e03863c
Rollup merge of #141939 - Qelxiros:139911-exact-div-tests, r=workingj…
matthiaskrgr Jun 4, 2025
95ef40e
Rollup merge of #141959 - ferrocene:lw/2015-edition-directives2, r=co…
matthiaskrgr Jun 4, 2025
dce8dd4
Rollup merge of #142002 - onur-ozkan:follow-ups2, r=jieyouxu
matthiaskrgr Jun 4, 2025
182e9f6
Rollup merge of #142007 - nnethercote:visitor-comments, r=chenyukang
matthiaskrgr Jun 4, 2025
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 MetaItemParser::{path,deconstruct}.
They're equivalent, and `path` is unused, and `deconstruct` has only one
call site outside of `path`.
  • Loading branch information
nnethercote committed May 20, 2025
commit 2cd2d249673b316bb4a15c10c6a1113b2bee02db
3 changes: 2 additions & 1 deletion compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ impl<'sess> AttributeParser<'sess> {
// }
ast::AttrKind::Normal(n) => {
let parser = MetaItemParser::from_attr(n, self.dcx());
let (path, args) = parser.deconstruct();
let path = parser.path_without_args();
let args = parser.args();
let parts = path.segments().map(|i| i.name).collect::<Vec<_>>();

if let Some(accepts) = ATTRIBUTE_MAPPING.0.get(parts.as_slice()) {
Expand Down
19 changes: 5 additions & 14 deletions compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ impl<'a> MetaItemParser<'a> {
}
}

/// Gets just the path, without the args.
/// Gets just the path, without the args. Some examples:
///
/// - `#[rustfmt::skip]`: `rustfmt::skip` is a path
/// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path
/// - `#[inline]`: `inline` is a single segment path
pub fn path_without_args(&self) -> PathParser<'a> {
self.path.clone()
}
Expand All @@ -263,19 +267,6 @@ impl<'a> MetaItemParser<'a> {
&self.args
}

pub fn deconstruct(&self) -> (PathParser<'a>, &ArgParser<'a>) {
(self.path_without_args(), self.args())
}

/// Asserts that this MetaItem starts with a path. Some examples:
///
/// - `#[rustfmt::skip]`: `rustfmt::skip` is a path
/// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path
/// - `#[inline]`: `inline` is a single segment path
pub fn path(&self) -> (PathParser<'a>, &ArgParser<'a>) {
self.deconstruct()
}

/// Asserts that this MetaItem starts with a word, or single segment path.
///
/// Some examples:
Expand Down