diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-08-24 14:42:44 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-09-10 11:45:24 -0700 |
| commit | dbd3ef1332574ef074c147f3b9e3e74dd29cd7b5 (patch) | |
| tree | bbcab483593c2b93d200715ca3b58663af3c39ff /compiler | |
| parent | 0db2eb7734633fe55dacbb05dbc677a079301cab (diff) | |
| download | rust-dbd3ef1332574ef074c147f3b9e3e74dd29cd7b5.tar.gz rust-dbd3ef1332574ef074c147f3b9e3e74dd29cd7b5.zip | |
fixup no_{core,std} handling code
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/crate_level.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/crate_level.rs b/compiler/rustc_attr_parsing/src/attributes/crate_level.rs index 3ec847bcaae..0b2c05482bf 100644 --- a/compiler/rustc_attr_parsing/src/attributes/crate_level.rs +++ b/compiler/rustc_attr_parsing/src/attributes/crate_level.rs @@ -182,19 +182,20 @@ pub(crate) struct NoCoreParser; 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, - // even though it should only be valid on crates of course + // because it's a crate-level attribute, we already warn about it. + // Putting target limitations here would give duplicate warnings const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoCore; const TYPE: AttributeType = AttributeType::CrateLevel; } pub(crate) struct NoStdParser; + impl<S: Stage> NoArgsAttributeParser<S> for NoStdParser { const PATH: &[Symbol] = &[sym::no_std]; const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn; - // FIXME: recursion limit is allowed on all targets and ignored, - // even though it should only be valid on crates of course + // because it's a crate-level attribute, we already warn about it. + // Putting target limitations here would give duplicate warnings const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoStd; const TYPE: AttributeType = AttributeType::CrateLevel; |
