about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-02-29 04:34:50 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-03-03 18:22:05 +0900
commit321d90e1d659c502ad633575866e6d972cf0cc5e (patch)
treea98e197d684ece19f9061983b353247bf228324d
parent9381e8178b49636d4604e4ec0f1263960691c958 (diff)
downloadrust-321d90e1d659c502ad633575866e6d972cf0cc5e.tar.gz
rust-321d90e1d659c502ad633575866e6d972cf0cc5e.zip
Remove the `no_debug` feature
-rw-r--r--src/librustc_codegen_llvm/debuginfo/metadata.rs4
-rw-r--r--src/librustc_codegen_llvm/debuginfo/mod.rs9
-rw-r--r--src/librustc_feature/active.rs3
-rw-r--r--src/librustc_feature/builtin_attrs.rs10
-rw-r--r--src/librustc_feature/removed.rs2
-rw-r--r--src/librustc_typeck/collect.rs2
-rw-r--r--src/test/ui/lint/suggestions.rs4
7 files changed, 3 insertions, 31 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs
index 3916653eb1d..b6c2b141bd9 100644
--- a/src/librustc_codegen_llvm/debuginfo/metadata.rs
+++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs
@@ -2269,10 +2269,6 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
     let tcx = cx.tcx;
     let attrs = tcx.codegen_fn_attrs(def_id);
 
-    if attrs.flags.contains(CodegenFnAttrFlags::NO_DEBUG) {
-        return;
-    }
-
     let no_mangle = attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE);
     // We may want to remove the namespace scope if we're in an extern block (see
     // https://github.com/rust-lang/rust/pull/46457#issuecomment-351750952).
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs
index 6515d5e3bec..a68441f14cb 100644
--- a/src/librustc_codegen_llvm/debuginfo/mod.rs
+++ b/src/librustc_codegen_llvm/debuginfo/mod.rs
@@ -12,7 +12,6 @@ use crate::llvm;
 use crate::llvm::debuginfo::{
     DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType, DIVariable,
 };
-use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
 use rustc::ty::subst::{GenericArgKind, SubstsRef};
 use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE};
 
@@ -22,7 +21,7 @@ use crate::common::CodegenCx;
 use crate::value::Value;
 use rustc::mir;
 use rustc::session::config::{self, DebugInfo};
-use rustc::ty::{self, Instance, InstanceDef, ParamEnv, Ty};
+use rustc::ty::{self, Instance, ParamEnv, Ty};
 use rustc_codegen_ssa::debuginfo::type_names;
 use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -241,12 +240,6 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
             return None;
         }
 
-        if let InstanceDef::Item(def_id) = instance.def {
-            if self.tcx().codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::NO_DEBUG) {
-                return None;
-            }
-        }
-
         let span = mir.span;
 
         // This can be the case for functions inlined from another crate
diff --git a/src/librustc_feature/active.rs b/src/librustc_feature/active.rs
index 0082f4f1a6e..c5bffd4a413 100644
--- a/src/librustc_feature/active.rs
+++ b/src/librustc_feature/active.rs
@@ -289,9 +289,6 @@ declare_features! (
     /// Permits specifying whether a function should permit unwinding or abort on unwind.
     (active, unwind_attributes, "1.4.0", Some(58760), None),
 
-    /// Allows `#[no_debug]`.
-    (active, no_debug, "1.5.0", Some(29721), None),
-
     /// Allows attributes on expressions and non-item statements.
     (active, stmt_expr_attributes, "1.6.0", Some(15701), None),
 
diff --git a/src/librustc_feature/builtin_attrs.rs b/src/librustc_feature/builtin_attrs.rs
index e2e061c185c..735cd226b06 100644
--- a/src/librustc_feature/builtin_attrs.rs
+++ b/src/librustc_feature/builtin_attrs.rs
@@ -503,16 +503,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
             cfg_fn!(rustc_attrs),
         ),
     ),
-    (
-        sym::no_debug, Whitelisted, template!(Word),
-        Gated(
-            Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721", None),
-            sym::no_debug,
-            "the `#[no_debug]` attribute was an experimental feature that has been \
-            deprecated due to lack of demand",
-            cfg_fn!(no_debug)
-        )
-    ),
     gated!(
         // Used in resolve:
         prelude_import, Whitelisted, template!(Word),
diff --git a/src/librustc_feature/removed.rs b/src/librustc_feature/removed.rs
index e6ea093fe89..4e348054fbd 100644
--- a/src/librustc_feature/removed.rs
+++ b/src/librustc_feature/removed.rs
@@ -111,6 +111,8 @@ declare_features! (
     /// Allows overlapping impls of marker traits.
     (removed, overlapping_marker_traits, "1.42.0", Some(29864), None,
      Some("removed in favor of `#![feature(marker_trait_attr)]`")),
+    /// Allows `#[no_debug]`.
+    (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
     // -------------------------------------------------------------------------
     // feature-group-end: removed features
     // -------------------------------------------------------------------------
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index 2dad3d1d6d7..87179e2b69d 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -2341,8 +2341,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE;
         } else if attr.check_name(sym::rustc_std_internal_symbol) {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL;
-        } else if attr.check_name(sym::no_debug) {
-            codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_DEBUG;
         } else if attr.check_name(sym::used) {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::USED;
         } else if attr.check_name(sym::thread_local) {
diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs
index 29297d08dca..518b5f211e5 100644
--- a/src/test/ui/lint/suggestions.rs
+++ b/src/test/ui/lint/suggestions.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-tab
 
 #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896
-#![feature(no_debug)]
 
 #[no_mangle] const DISCOVERY: usize = 1;
 //~^ ERROR const items should never be `#[no_mangle]`
@@ -39,9 +38,6 @@ struct Equinox {
     warp_factor: f32,
 }
 
-#[no_debug] // should suggest removal of deprecated attribute
-//~^ WARN deprecated
-//~| HELP remove this attribute
 fn main() {
     while true {
     //~^ WARN denote infinite loops