Skip to content

Commit f270bc4

Browse files
Mark all unstable attributes as OnDuplicate::Error
1 parent 9620eae commit f270bc4

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
@@ -12,7 +12,7 @@ pub(crate) struct OptimizeParser;
1212

1313
impl<S: Stage> SingleAttributeParser<S> for OptimizeParser {
1414
const PATH: &[Symbol] = &[sym::optimize];
15-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
15+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
1616
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
1717
Allow(Target::Fn),
1818
Allow(Target::Closure),
@@ -689,7 +689,7 @@ pub(crate) struct ThreadLocalParser;
689689

690690
impl<S: Stage> NoArgsAttributeParser<S> for ThreadLocalParser {
691691
const PATH: &[Symbol] = &[sym::thread_local];
692-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
692+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
693693
const ALLOWED_TARGETS: AllowedTargets =
694694
AllowedTargets::AllowList(&[Allow(Target::Static), Allow(Target::ForeignStatic)]);
695695
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
@@ -499,23 +499,23 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
499499
pub(crate) struct ExportStableParser;
500500
impl<S: Stage> NoArgsAttributeParser<S> for ExportStableParser {
501501
const PATH: &[Symbol] = &[sym::export_stable];
502-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
502+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
503503
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
504504
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::ExportStable;
505505
}
506506

507507
pub(crate) struct FfiConstParser;
508508
impl<S: Stage> NoArgsAttributeParser<S> for FfiConstParser {
509509
const PATH: &[Symbol] = &[sym::ffi_const];
510-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
510+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
511511
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]);
512512
const CREATE: fn(Span) -> AttributeKind = AttributeKind::FfiConst;
513513
}
514514

515515
pub(crate) struct FfiPureParser;
516516
impl<S: Stage> NoArgsAttributeParser<S> for FfiPureParser {
517517
const PATH: &[Symbol] = &[sym::ffi_pure];
518-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
518+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
519519
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::ForeignFn)]);
520520
const CREATE: fn(Span) -> AttributeKind = AttributeKind::FfiPure;
521521
}
@@ -670,7 +670,7 @@ pub(crate) struct CompilerBuiltinsParser;
670670

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

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
@@ -1171,7 +1171,7 @@ pub(crate) struct PreludeImportParser;
11711171

11721172
impl<S: Stage> NoArgsAttributeParser<S> for PreludeImportParser {
11731173
const PATH: &[Symbol] = &[sym::prelude_import];
1174-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
1174+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
11751175
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Use)]);
11761176
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::PreludeImport;
11771177
}

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)