-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Convert no_std
and no_core
to the new attribute infrastructure
#146389
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
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
// 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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?
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, |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops yea
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 |
407f45c
to
e48203f
Compare
@rustbot review |
@bors r+ rollup |
This comment has been minimized.
This comment has been minimized.
e48203f
to
dbd3ef1
Compare
@bors r- |
@oli-obk CI never passed lol. I fixed some tests (only diag improvements) just now. Once it does I'll r=you |
@bors r=oli-obk |
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
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
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
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
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
…, r=scrabsha Crate level into allowed targets r? `@scrabsha` `@rustbot` blocked on #146389
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
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