Skip to content

Commit b1e5472

Browse files
authored
Rollup merge of rust-lang#98115 - jhpratt:remove-rustc_deprecated, r=compiler-errors
Remove `rustc_deprecated` diagnostics Follow-up on rust-lang#95960. The diagnostics will remain until the next bootstrap, at which point people will have had six weeks to adjust. ``@rustbot`` label +A-diagnostics r? ``@compiler-errors``
2 parents 87e373e + fb05b53 commit b1e5472

File tree

9 files changed

+166
-237
lines changed

9 files changed

+166
-237
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
406406

407407
// Emit errors for non-staged-api crates.
408408
if !self.features.staged_api {
409-
if attr.has_name(sym::rustc_deprecated)
410-
|| attr.has_name(sym::unstable)
409+
if attr.has_name(sym::unstable)
411410
|| attr.has_name(sym::stable)
412411
|| attr.has_name(sym::rustc_const_unstable)
413412
|| attr.has_name(sym::rustc_const_stable)

compiler/rustc_attr/src/builtin.rs

+1-28
Original file line numberDiff line numberDiff line change
@@ -720,18 +720,10 @@ where
720720
let is_rustc = sess.features_untracked().staged_api;
721721

722722
'outer: for attr in attrs_iter {
723-
if !(attr.has_name(sym::deprecated) || attr.has_name(sym::rustc_deprecated)) {
723+
if !attr.has_name(sym::deprecated) {
724724
continue;
725725
}
726726

727-
// FIXME(jhpratt) remove this eventually
728-
if attr.has_name(sym::rustc_deprecated) {
729-
diagnostic
730-
.struct_span_err(attr.span, "`#[rustc_deprecated]` has been removed")
731-
.help("use `#[deprecated]` instead")
732-
.emit();
733-
}
734-
735727
let Some(meta) = attr.meta() else {
736728
continue;
737729
};
@@ -787,25 +779,6 @@ where
787779
continue 'outer;
788780
}
789781
}
790-
// FIXME(jhpratt) remove this eventually
791-
sym::reason if attr.has_name(sym::rustc_deprecated) => {
792-
if !get(mi, &mut note) {
793-
continue 'outer;
794-
}
795-
796-
let mut diag = diagnostic
797-
.struct_span_err(mi.span, "`reason` has been renamed");
798-
match note {
799-
Some(note) => diag.span_suggestion(
800-
mi.span,
801-
"use `note` instead",
802-
format!("note = \"{note}\""),
803-
Applicability::MachineApplicable,
804-
),
805-
None => diag.span_help(mi.span, "use `note` instead"),
806-
};
807-
diag.emit();
808-
}
809782
sym::suggestion => {
810783
if !sess.features_untracked().deprecated_suggestion {
811784
let mut diag = sess.struct_span_err(

compiler/rustc_feature/src/builtin_attrs.rs

-5
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
489489
// ==========================================================================
490490

491491
ungated!(feature, CrateLevel, template!(List: "name1, name2, ..."), DuplicatesOk),
492-
// FIXME(jhpratt) remove this eventually
493-
ungated!(
494-
rustc_deprecated, Normal,
495-
template!(List: r#"since = "version", note = "...""#), ErrorFollowing
496-
),
497492
// DuplicatesOk since it has its own validation
498493
ungated!(
499494
stable, Normal, template!(List: r#"feature = "name", since = "version""#), DuplicatesOk,

compiler/rustc_passes/src/check_attr.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ impl CheckAttrVisitor<'_> {
152152
sym::link_name => self.check_link_name(hir_id, attr, span, target),
153153
sym::link_section => self.check_link_section(hir_id, attr, span, target),
154154
sym::no_mangle => self.check_no_mangle(hir_id, attr, span, target),
155-
sym::deprecated | sym::rustc_deprecated => {
156-
self.check_deprecated(hir_id, attr, span, target)
157-
}
155+
sym::deprecated => self.check_deprecated(hir_id, attr, span, target),
158156
sym::macro_use | sym::macro_escape => self.check_macro_use(hir_id, attr, target),
159157
sym::path => self.check_generic_attr(hir_id, attr, target, &[Target::Mod]),
160158
sym::plugin_registrar => self.check_plugin_registrar(hir_id, attr, target),

compiler/rustc_span/src/symbol.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,6 @@ symbols! {
11881188
rustc_const_unstable,
11891189
rustc_conversion_suggestion,
11901190
rustc_def_path,
1191-
rustc_deprecated,
11921191
rustc_diagnostic_item,
11931192
rustc_diagnostic_macros,
11941193
rustc_dirty,

src/test/ui/deprecation/rustc_deprecated.rs

-13
This file was deleted.

src/test/ui/deprecation/rustc_deprecated.stderr

-21
This file was deleted.

src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
#![link_section = "1800"]
7070
//~^ WARN attribute should be applied to a function or static
7171
//~^^ WARN this was previously accepted by the compiler
72-
// see issue-43106-gating-of-rustc_deprecated.rs
7372
#![must_use]
7473
//~^ WARN `#[must_use]` has no effect
7574
// see issue-43106-gating-of-stable.rs

0 commit comments

Comments
 (0)