Skip to content

Commit 614cd8d

Browse files
authored
Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakis
Remove the `no_debug` feature Context: #29721 (comment) r? @nikomatsakis
2 parents a039217 + 18080e6 commit 614cd8d

File tree

14 files changed

+14
-125
lines changed

14 files changed

+14
-125
lines changed

src/librustc/middle/codegen_fn_attrs.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ bitflags! {
5858
/// "weird symbol" for the standard library in that it has slightly
5959
/// different linkage, visibility, and reachability rules.
6060
const RUSTC_STD_INTERNAL_SYMBOL = 1 << 6;
61-
/// `#[no_debug]`: an indicator that no debugging information should be
62-
/// generated for this function by LLVM.
63-
const NO_DEBUG = 1 << 7;
6461
/// `#[thread_local]`: indicates a static is actually a thread local
6562
/// piece of memory
6663
const THREAD_LOCAL = 1 << 8;

src/librustc_codegen_llvm/debuginfo/metadata.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,10 +2269,6 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global
22692269
let tcx = cx.tcx;
22702270
let attrs = tcx.codegen_fn_attrs(def_id);
22712271

2272-
if attrs.flags.contains(CodegenFnAttrFlags::NO_DEBUG) {
2273-
return;
2274-
}
2275-
22762272
let no_mangle = attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE);
22772273
// We may want to remove the namespace scope if we're in an extern block (see
22782274
// https://github.com/rust-lang/rust/pull/46457#issuecomment-351750952).

src/librustc_codegen_llvm/debuginfo/mod.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::llvm;
1212
use crate::llvm::debuginfo::{
1313
DIArray, DIBuilder, DIFile, DIFlags, DILexicalBlock, DISPFlags, DIScope, DIType, DIVariable,
1414
};
15-
use rustc::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1615
use rustc::ty::subst::{GenericArgKind, SubstsRef};
1716
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE};
1817

@@ -22,7 +21,7 @@ use crate::common::CodegenCx;
2221
use crate::value::Value;
2322
use rustc::mir;
2423
use rustc::session::config::{self, DebugInfo};
25-
use rustc::ty::{self, Instance, InstanceDef, ParamEnv, Ty};
24+
use rustc::ty::{self, Instance, ParamEnv, Ty};
2625
use rustc_codegen_ssa::debuginfo::type_names;
2726
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
2827
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -241,12 +240,6 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
241240
return None;
242241
}
243242

244-
if let InstanceDef::Item(def_id) = instance.def {
245-
if self.tcx().codegen_fn_attrs(def_id).flags.contains(CodegenFnAttrFlags::NO_DEBUG) {
246-
return None;
247-
}
248-
}
249-
250243
let span = mir.span;
251244

252245
// This can be the case for functions inlined from another crate

src/librustc_feature/active.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ declare_features! (
289289
/// Permits specifying whether a function should permit unwinding or abort on unwind.
290290
(active, unwind_attributes, "1.4.0", Some(58760), None),
291291

292-
/// Allows `#[no_debug]`.
293-
(active, no_debug, "1.5.0", Some(29721), None),
294-
295292
/// Allows attributes on expressions and non-item statements.
296293
(active, stmt_expr_attributes, "1.6.0", Some(15701), None),
297294

src/librustc_feature/builtin_attrs.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,16 +507,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
507507
cfg_fn!(rustc_attrs),
508508
),
509509
),
510-
(
511-
sym::no_debug, Whitelisted, template!(Word),
512-
Gated(
513-
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721", None),
514-
sym::no_debug,
515-
"the `#[no_debug]` attribute was an experimental feature that has been \
516-
deprecated due to lack of demand",
517-
cfg_fn!(no_debug)
518-
)
519-
),
520510
gated!(
521511
// Used in resolve:
522512
prelude_import, Whitelisted, template!(Word),

src/librustc_feature/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ declare_features! (
111111
/// Allows overlapping impls of marker traits.
112112
(removed, overlapping_marker_traits, "1.42.0", Some(29864), None,
113113
Some("removed in favor of `#![feature(marker_trait_attr)]`")),
114+
/// Allows `#[no_debug]`.
115+
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
114116
// -------------------------------------------------------------------------
115117
// feature-group-end: removed features
116118
// -------------------------------------------------------------------------

src/librustc_typeck/collect.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,8 +2341,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
23412341
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE;
23422342
} else if attr.check_name(sym::rustc_std_internal_symbol) {
23432343
codegen_fn_attrs.flags |= CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL;
2344-
} else if attr.check_name(sym::no_debug) {
2345-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_DEBUG;
23462344
} else if attr.check_name(sym::used) {
23472345
codegen_fn_attrs.flags |= CodegenFnAttrFlags::USED;
23482346
} else if attr.check_name(sym::thread_local) {

src/test/debuginfo/no-debug-attribute.rs

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-no-debug-2.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/test/ui/feature-gates/feature-gate-no-debug-2.stderr

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)