Skip to content

Conversation

jdonszelmann
Copy link
Contributor

r? @oli-obk

Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2025

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

Comment on lines 185 to 187
// FIXME: recursion limit is allowed on all targets and ignored,
// even though it should only be valid on crates of course
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Why aren't we turning this into a future incompat warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it already sort of is. I'm refactoring this as we speak

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the previous logic for doing sanity checks on these attrs?

Should we crater this in case there are some commonly used macros doing sth weird that gets silenced or sth?

View changes since this review

impl<S: Stage> NoArgsAttributeParser<S> for NoCoreParser {
const PATH: &[Symbol] = &[sym::no_core];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
// FIXME: recursion limit is allowed on all targets and ignored,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy pasta from #[recursion_limit]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops yea

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2025
@jdonszelmann
Copy link
Contributor Author

the previous logic is part of template checking. Since these were such simple attrs, there barely was any. In fact, in many places, to be backwards compatible we don't even use these parsers, we simply check for the attr name in the ast attrs. However, having a parser for them is still valuable since it gives us a new place to put the template (we want to move them all over some day) and it guarantees we don't miss parsing any of them. It also improves diagnostics. The old validation code is shared between all attributes and is still there until all attributes are converted. That codepath is not run anymore, validation now only happens here. Switching these codepaths is automatic when a new-style parser is added hence there's no specific code for that. This change also makes it so downstream we do get these attrs as parsed, hence the fact that clipyp does use it instead of matching on ast (symbol) attrs

@jdonszelmann
Copy link
Contributor Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 10, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Sep 10, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 10, 2025

📌 Commit e48203f has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2025
@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
Copy link
Contributor Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 10, 2025
@jdonszelmann
Copy link
Contributor Author

@oli-obk CI never passed lol. I fixed some tests (only diag improvements) just now. Once it does I'll r=you

@jdonszelmann
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Sep 10, 2025

📌 Commit dbd3ef1 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 10, 2025
bors added a commit that referenced this pull request Sep 12, 2025
Rollup of 16 pull requests

Successful merges:

 - #145660 (initial implementation of the darwin_objc unstable feature)
 - #145895 (thread parking: fix docs and examples)
 - #146308 (support integer literals in `${concat()}`)
 - #146323 (check before test for hardware capabilites in bits 32~63 of usize)
 - #146332 (tidy: make behavior of extra-checks more uniform)
 - #146338 (Extends AArch64 branch protection support to include GCS)
 - #146374 (Update `browser-ui-test` version to `0.22.2`)
 - #146413 (Improve suggestion in case a bare URL is surrounded by brackets)
 - #146426 (Bump miow to 0.60.1)
 - #146432 (Implement `Socket::take_error` for Hermit)
 - #146433 (rwlock tests: fix miri macos test regression)
 - #146435 (Change the default value of `gcc.download-ci-gcc` to `true`)
 - #146439 (fix cfg for poison test macro)
 - #146448 ([rustdoc] Correctly handle literal search on paths)
 - #146449 (Fix `libgccjit` symlink when we build GCC locally)
 - #146455 (test: remove an outdated normalization for rustc versions)

Failed merges:

 - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure)

r? `@ghost`
`@rustbot` modify labels: rollup
jdonszelmann added a commit to jdonszelmann/rust that referenced this pull request Sep 12, 2025
Convert `no_std` and `no_core` to the new attribute infrastructure

r? ``@oli-obk``

Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
bors added a commit that referenced this pull request Sep 12, 2025
Rollup of 4 pull requests

Successful merges:

 - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure)
 - #146452 (Improve `alloc::Layout` coverage)
 - #146473 (Revert "Constify SystemTime methods")
 - #146477 (Improve `core::char` coverage)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 13, 2025
Rollup of 5 pull requests

Successful merges:

 - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure)
 - #146403 (sort array trait implementation suggestions correctly)
 - #146452 (Improve `alloc::Layout` coverage)
 - #146477 (Improve `core::char` coverage)
 - #146481 (Improve `core::hash` coverage)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 147e97a into rust-lang:master Sep 13, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Sep 13, 2025
rust-timer added a commit that referenced this pull request Sep 13, 2025
Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obk

Convert `no_std` and `no_core` to the new attribute infrastructure

r? ```@oli-obk```

Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
bors added a commit that referenced this pull request Sep 14, 2025
…, r=scrabsha

Crate level into allowed targets

r? `@scrabsha`

`@rustbot` blocked on #146389
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 18, 2025
Convert `no_std` and `no_core` to the new attribute infrastructure

r? ```@oli-obk```

Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants