about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2022-06-14 19:11:24 -0400
committerJacob Pratt <jacob@jhpratt.dev>2022-06-14 19:46:13 -0400
commitfb05b53745824a2633f49a8eef6ea9739bbf1cc5 (patch)
tree9889214f1a4411e3ae09c056251efa1f5d8942d1 /compiler
parent1f34da9ec8a85b6f86c5fa1c121ab6f88f2f4966 (diff)
downloadrust-fb05b53745824a2633f49a8eef6ea9739bbf1cc5.tar.gz
rust-fb05b53745824a2633f49a8eef6ea9739bbf1cc5.zip
Remove `rustc_deprecated` diagnostics
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast_passes/src/feature_gate.rs3
-rw-r--r--compiler/rustc_attr/src/builtin.rs29
-rw-r--r--compiler/rustc_feature/src/builtin_attrs.rs5
-rw-r--r--compiler/rustc_passes/src/check_attr.rs4
-rw-r--r--compiler/rustc_span/src/symbol.rs1
5 files changed, 3 insertions, 39 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs
index 6db9c46dcef..4024f883f37 100644
--- a/compiler/rustc_ast_passes/src/feature_gate.rs
+++ b/compiler/rustc_ast_passes/src/feature_gate.rs
@@ -406,8 +406,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
 
         // Emit errors for non-staged-api crates.
         if !self.features.staged_api {
-            if attr.has_name(sym::rustc_deprecated)
-                || attr.has_name(sym::unstable)
+            if attr.has_name(sym::unstable)
                 || attr.has_name(sym::stable)
                 || attr.has_name(sym::rustc_const_unstable)
                 || attr.has_name(sym::rustc_const_stable)
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs
index bdf86825f0d..ce7c0eb72cd 100644
--- a/compiler/rustc_attr/src/builtin.rs
+++ b/compiler/rustc_attr/src/builtin.rs
@@ -720,18 +720,10 @@ where
     let is_rustc = sess.features_untracked().staged_api;
 
     'outer: for attr in attrs_iter {
-        if !(attr.has_name(sym::deprecated) || attr.has_name(sym::rustc_deprecated)) {
+        if !attr.has_name(sym::deprecated) {
             continue;
         }
 
-        // FIXME(jhpratt) remove this eventually
-        if attr.has_name(sym::rustc_deprecated) {
-            diagnostic
-                .struct_span_err(attr.span, "`#[rustc_deprecated]` has been removed")
-                .help("use `#[deprecated]` instead")
-                .emit();
-        }
-
         let Some(meta) = attr.meta() else {
             continue;
         };
@@ -787,25 +779,6 @@ where
                                     continue 'outer;
                                 }
                             }
-                            // FIXME(jhpratt) remove this eventually
-                            sym::reason if attr.has_name(sym::rustc_deprecated) => {
-                                if !get(mi, &mut note) {
-                                    continue 'outer;
-                                }
-
-                                let mut diag = diagnostic
-                                    .struct_span_err(mi.span, "`reason` has been renamed");
-                                match note {
-                                    Some(note) => diag.span_suggestion(
-                                        mi.span,
-                                        "use `note` instead",
-                                        format!("note = \"{note}\""),
-                                        Applicability::MachineApplicable,
-                                    ),
-                                    None => diag.span_help(mi.span, "use `note` instead"),
-                                };
-                                diag.emit();
-                            }
                             sym::suggestion => {
                                 if !sess.features_untracked().deprecated_suggestion {
                                     let mut diag = sess.struct_span_err(
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index 34c53597dde..d4452a79dfb 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -489,11 +489,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     // ==========================================================================
 
     ungated!(feature, CrateLevel, template!(List: "name1, name2, ..."), DuplicatesOk),
-    // FIXME(jhpratt) remove this eventually
-    ungated!(
-        rustc_deprecated, Normal,
-        template!(List: r#"since = "version", note = "...""#), ErrorFollowing
-    ),
     // DuplicatesOk since it has its own validation
     ungated!(
         stable, Normal, template!(List: r#"feature = "name", since = "version""#), DuplicatesOk,
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 5c3e7918aa3..4fe8b5a7347 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -152,9 +152,7 @@ impl CheckAttrVisitor<'_> {
                 sym::link_name => self.check_link_name(hir_id, attr, span, target),
                 sym::link_section => self.check_link_section(hir_id, attr, span, target),
                 sym::no_mangle => self.check_no_mangle(hir_id, attr, span, target),
-                sym::deprecated | sym::rustc_deprecated => {
-                    self.check_deprecated(hir_id, attr, span, target)
-                }
+                sym::deprecated => self.check_deprecated(hir_id, attr, span, target),
                 sym::macro_use | sym::macro_escape => self.check_macro_use(hir_id, attr, target),
                 sym::path => self.check_generic_attr(hir_id, attr, target, &[Target::Mod]),
                 sym::plugin_registrar => self.check_plugin_registrar(hir_id, attr, target),
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 6547ec493c8..ea51e3cfbc8 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1188,7 +1188,6 @@ symbols! {
         rustc_const_unstable,
         rustc_conversion_suggestion,
         rustc_def_path,
-        rustc_deprecated,
         rustc_diagnostic_item,
         rustc_diagnostic_macros,
         rustc_dirty,