Skip to content

Commit 1f96efc

Browse files
Mark all unstable attributes as OnDuplicate::Error
1 parent 27dbdb5 commit 1f96efc

14 files changed

Lines changed: 54 additions & 54 deletions

File tree

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) struct OptimizeParser;
1414

1515
impl<S: Stage> SingleAttributeParser<S> for OptimizeParser {
1616
const PATH: &[Symbol] = &[sym::optimize];
17-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
17+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
1818
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
1919
Allow(Target::Fn),
2020
Allow(Target::Closure),
@@ -695,7 +695,7 @@ pub(crate) struct ThreadLocalParser;
695695

696696
impl<S: Stage> NoArgsAttributeParser<S> for ThreadLocalParser {
697697
const PATH: &[Symbol] = &[sym::thread_local];
698-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
698+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
699699
const ALLOWED_TARGETS: AllowedTargets =
700700
AllowedTargets::AllowList(&[Allow(Target::Static), Allow(Target::ForeignStatic)]);
701701
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ThreadLocal;

compiler/rustc_attr_parsing/src/attributes/crate_level.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub(crate) struct NoCoreParser;
177177

178178
impl<S: Stage> NoArgsAttributeParser<S> for NoCoreParser {
179179
const PATH: &[Symbol] = &[sym::no_core];
180-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
180+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
181181
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
182182
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoCore;
183183
}
@@ -247,7 +247,7 @@ pub(crate) struct PanicRuntimeParser;
247247

248248
impl<S: Stage> NoArgsAttributeParser<S> for PanicRuntimeParser {
249249
const PATH: &[Symbol] = &[sym::panic_runtime];
250-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
250+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
251251
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
252252
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::PanicRuntime;
253253
}
@@ -256,7 +256,7 @@ pub(crate) struct NeedsPanicRuntimeParser;
256256

257257
impl<S: Stage> NoArgsAttributeParser<S> for NeedsPanicRuntimeParser {
258258
const PATH: &[Symbol] = &[sym::needs_panic_runtime];
259-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
259+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
260260
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
261261
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NeedsPanicRuntime;
262262
}
@@ -265,7 +265,7 @@ pub(crate) struct ProfilerRuntimeParser;
265265

266266
impl<S: Stage> NoArgsAttributeParser<S> for ProfilerRuntimeParser {
267267
const PATH: &[Symbol] = &[sym::profiler_runtime];
268-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
268+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
269269
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
270270
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ProfilerRuntime;
271271
}
@@ -292,7 +292,7 @@ pub(crate) struct RustcNoImplicitBoundsParser;
292292

293293
impl<S: Stage> NoArgsAttributeParser<S> for RustcNoImplicitBoundsParser {
294294
const PATH: &[Symbol] = &[sym::rustc_no_implicit_bounds];
295-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
295+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
296296
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
297297
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcNoImplicitBounds;
298298
}
@@ -301,7 +301,7 @@ pub(crate) struct DefaultLibAllocatorParser;
301301

302302
impl<S: Stage> NoArgsAttributeParser<S> for DefaultLibAllocatorParser {
303303
const PATH: &[Symbol] = &[sym::default_lib_allocator];
304-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
304+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
305305
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
306306
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::DefaultLibAllocator;
307307
}

compiler/rustc_attr_parsing/src/attributes/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub(crate) struct RustcForceInlineParser;
6767

6868
impl<S: Stage> SingleAttributeParser<S> for RustcForceInlineParser {
6969
const PATH: &[Symbol] = &[sym::rustc_force_inline];
70-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
70+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
7171
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
7272
Allow(Target::Fn),
7373
Allow(Target::Method(MethodKind::Inherent)),

compiler/rustc_attr_parsing/src/attributes/link_attrs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,15 +502,15 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
502502
pub(crate) struct ExportStableParser;
503503
impl<S: Stage> NoArgsAttributeParser<S> for ExportStableParser {
504504
const PATH: &[Symbol] = &[sym::export_stable];
505-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
505+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
506506
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
507507
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ExportStable;
508508
}
509509

510510
pub(crate) struct FfiConstParser;
511511
impl<S: Stage> NoArgsAttributeParser<S> for FfiConstParser {
512512
const PATH: &[Symbol] = &[sym::ffi_const];
513-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
513+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
514514
const SAFETY: AttributeSafety = AttributeSafety::Unsafe { unsafe_since: None };
515515
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]);
516516
const CREATE: fn(Span) -> AttributeKind = AttributeKind::FfiConst;
@@ -519,7 +519,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for FfiConstParser {
519519
pub(crate) struct FfiPureParser;
520520
impl<S: Stage> NoArgsAttributeParser<S> for FfiPureParser {
521521
const PATH: &[Symbol] = &[sym::ffi_pure];
522-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
522+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
523523
const SAFETY: AttributeSafety = AttributeSafety::Unsafe { unsafe_since: None };
524524
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]);
525525
const CREATE: fn(Span) -> AttributeKind = AttributeKind::FfiPure;
@@ -675,7 +675,7 @@ pub(crate) struct CompilerBuiltinsParser;
675675

676676
impl<S: Stage> NoArgsAttributeParser<S> for CompilerBuiltinsParser {
677677
const PATH: &[Symbol] = &[sym::compiler_builtins];
678-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
678+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
679679
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
680680
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::CompilerBuiltins;
681681
}

compiler/rustc_attr_parsing/src/attributes/loop_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use super::prelude::*;
33
pub(crate) struct LoopMatchParser;
44
impl<S: Stage> NoArgsAttributeParser<S> for LoopMatchParser {
55
const PATH: &[Symbol] = &[sym::loop_match];
6-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
6+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
77
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Expression)]);
88
const CREATE: fn(Span) -> AttributeKind = AttributeKind::LoopMatch;
99
}
1010

1111
pub(crate) struct ConstContinueParser;
1212
impl<S: Stage> NoArgsAttributeParser<S> for ConstContinueParser {
1313
const PATH: &[Symbol] = &[sym::const_continue];
14-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
14+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
1515
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Expression)]);
1616
const CREATE: fn(Span) -> AttributeKind = AttributeKind::ConstContinue;
1717
}

compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub(crate) struct RustcProcMacroDeclsParser;
203203

204204
impl<S: Stage> NoArgsAttributeParser<S> for RustcProcMacroDeclsParser {
205205
const PATH: &[Symbol] = &[sym::rustc_proc_macro_decls];
206-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
206+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
207207
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Static)]);
208208
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcProcMacroDecls;
209209
}

compiler/rustc_attr_parsing/src/attributes/pin_v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) struct PinV2Parser;
1111

1212
impl<S: Stage> NoArgsAttributeParser<S> for PinV2Parser {
1313
const PATH: &[Symbol] = &[sym::pin_v2];
14-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
14+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
1515
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
1616
Allow(Target::Enum),
1717
Allow(Target::Struct),

compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(crate) struct RustcDumpInferredOutlivesParser;
6161

6262
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpInferredOutlivesParser {
6363
const PATH: &[Symbol] = &[sym::rustc_dump_inferred_outlives];
64-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
64+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
6565
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
6666
Allow(Target::Struct),
6767
Allow(Target::Enum),
@@ -227,7 +227,7 @@ pub(crate) struct RustcDumpVariancesParser;
227227

228228
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVariancesParser {
229229
const PATH: &[Symbol] = &[sym::rustc_dump_variances];
230-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
230+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
231231
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
232232
Allow(Target::Enum),
233233
Allow(Target::Fn),
@@ -245,7 +245,7 @@ pub(crate) struct RustcDumpVariancesOfOpaquesParser;
245245

246246
impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVariancesOfOpaquesParser {
247247
const PATH: &[Symbol] = &[sym::rustc_dump_variances_of_opaques];
248-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
248+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
249249
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Crate)]);
250250
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpVariancesOfOpaques;
251251
}

compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ pub(crate) struct PreludeImportParser;
11861186

11871187
impl<S: Stage> NoArgsAttributeParser<S> for PreludeImportParser {
11881188
const PATH: &[Symbol] = &[sym::prelude_import];
1189-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
1189+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
11901190
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Use)]);
11911191
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::PreludeImport;
11921192
}

compiler/rustc_attr_parsing/src/attributes/semantics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::prelude::*;
33
pub(crate) struct MayDangleParser;
44
impl<S: Stage> NoArgsAttributeParser<S> for MayDangleParser {
55
const PATH: &[Symbol] = &[sym::may_dangle];
6-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
6+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
77
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
88
const CREATE: fn(span: Span) -> AttributeKind = AttributeKind::MayDangle;
99
}

0 commit comments

Comments
 (0)