Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 321d90e

Browse files
committed
Remove the no_debug feature
1 parent 9381e81 commit 321d90e

File tree

7 files changed

+3
-31
lines changed

7 files changed

+3
-31
lines changed

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
@@ -503,16 +503,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
503503
cfg_fn!(rustc_attrs),
504504
),
505505
),
506-
(
507-
sym::no_debug, Whitelisted, template!(Word),
508-
Gated(
509-
Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721", None),
510-
sym::no_debug,
511-
"the `#[no_debug]` attribute was an experimental feature that has been \
512-
deprecated due to lack of demand",
513-
cfg_fn!(no_debug)
514-
)
515-
),
516506
gated!(
517507
// Used in resolve:
518508
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/ui/lint/suggestions.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// ignore-tidy-tab
22

33
#![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896
4-
#![feature(no_debug)]
54

65
#[no_mangle] const DISCOVERY: usize = 1;
76
//~^ ERROR const items should never be `#[no_mangle]`
@@ -39,9 +38,6 @@ struct Equinox {
3938
warp_factor: f32,
4039
}
4140

42-
#[no_debug] // should suggest removal of deprecated attribute
43-
//~^ WARN deprecated
44-
//~| HELP remove this attribute
4541
fn main() {
4642
while true {
4743
//~^ WARN denote infinite loops

0 commit comments

Comments
 (0)