Skip to content

Commit 614cd8d

Browse files
authored
Rollup merge of rust-lang#69667 - JohnTitor:no-debug, r=nikomatsakis
Remove the `no_debug` feature Context: rust-lang#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

-3
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

-4
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

+1-8
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

-3
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

-10
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

+2
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

-2
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

-37
This file was deleted.

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

-5
This file was deleted.

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

-14
This file was deleted.

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

-4
This file was deleted.

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

-12
This file was deleted.

src/test/ui/lint/suggestions.rs

-4
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

src/test/ui/lint/suggestions.stderr

+11-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
warning: denote infinite loops with `loop { ... }`
2-
--> $DIR/suggestions.rs:46:5
2+
--> $DIR/suggestions.rs:42:5
33
|
44
LL | while true {
55
| ^^^^^^^^^^ help: use `loop`
66
|
77
= note: `#[warn(while_true)]` on by default
88

99
warning: unnecessary parentheses around assigned value
10-
--> $DIR/suggestions.rs:49:31
10+
--> $DIR/suggestions.rs:45:31
1111
|
1212
LL | let mut registry_no = (format!("NX-{}", 74205));
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
@@ -18,16 +18,8 @@ note: the lint level is defined here
1818
LL | #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issue #43896
1919
| ^^^^^^^^^^^^^
2020

21-
warning: use of deprecated attribute `no_debug`: the `#[no_debug]` attribute was an experimental feature that has been deprecated due to lack of demand. See https://github.com/rust-lang/rust/issues/29721
22-
--> $DIR/suggestions.rs:42:1
23-
|
24-
LL | #[no_debug] // should suggest removal of deprecated attribute
25-
| ^^^^^^^^^^^ help: remove this attribute
26-
|
27-
= note: `#[warn(deprecated)]` on by default
28-
2921
warning: variable does not need to be mutable
30-
--> $DIR/suggestions.rs:49:13
22+
--> $DIR/suggestions.rs:45:13
3123
|
3224
LL | let mut registry_no = (format!("NX-{}", 74205));
3325
| ----^^^^^^^^^^^
@@ -41,7 +33,7 @@ LL | #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issu
4133
| ^^^^^^^^^^
4234

4335
warning: variable does not need to be mutable
44-
--> $DIR/suggestions.rs:55:13
36+
--> $DIR/suggestions.rs:51:13
4537
|
4638
LL | let mut
4739
| _____________^
@@ -53,7 +45,7 @@ LL | || b = 1;
5345
| help: remove this `mut`
5446

5547
error: const items should never be `#[no_mangle]`
56-
--> $DIR/suggestions.rs:6:14
48+
--> $DIR/suggestions.rs:5:14
5749
|
5850
LL | #[no_mangle] const DISCOVERY: usize = 1;
5951
| -----^^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +55,7 @@ LL | #[no_mangle] const DISCOVERY: usize = 1;
6355
= note: `#[deny(no_mangle_const_items)]` on by default
6456

6557
warning: functions generic over types or consts must be mangled
66-
--> $DIR/suggestions.rs:12:1
58+
--> $DIR/suggestions.rs:11:1
6759
|
6860
LL | #[no_mangle]
6961
| ------------ help: remove this attribute
@@ -74,39 +66,39 @@ LL | pub fn defiant<T>(_t: T) {}
7466
= note: `#[warn(no_mangle_generic_items)]` on by default
7567

7668
warning: the `warp_factor:` in this pattern is redundant
77-
--> $DIR/suggestions.rs:61:23
69+
--> $DIR/suggestions.rs:57:23
7870
|
7971
LL | Equinox { warp_factor: warp_factor } => {}
8072
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use shorthand field pattern: `warp_factor`
8173
|
8274
= note: `#[warn(non_shorthand_field_patterns)]` on by default
8375

8476
error: const items should never be `#[no_mangle]`
85-
--> $DIR/suggestions.rs:22:18
77+
--> $DIR/suggestions.rs:21:18
8678
|
8779
LL | #[no_mangle] pub const DAUNTLESS: bool = true;
8880
| ---------^^^^^^^^^^^^^^^^^^^^^^^^
8981
| |
9082
| help: try a static value: `pub static`
9183

9284
warning: functions generic over types or consts must be mangled
93-
--> $DIR/suggestions.rs:25:18
85+
--> $DIR/suggestions.rs:24:18
9486
|
9587
LL | #[no_mangle] pub fn val_jean<T>() {}
9688
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^
9789
| |
9890
| help: remove this attribute
9991

10092
error: const items should never be `#[no_mangle]`
101-
--> $DIR/suggestions.rs:30:18
93+
--> $DIR/suggestions.rs:29:18
10294
|
10395
LL | #[no_mangle] pub(crate) const VETAR: bool = true;
10496
| ----------------^^^^^^^^^^^^^^^^^^^^
10597
| |
10698
| help: try a static value: `pub static`
10799

108100
warning: functions generic over types or consts must be mangled
109-
--> $DIR/suggestions.rs:33:18
101+
--> $DIR/suggestions.rs:32:18
110102
|
111103
LL | #[no_mangle] pub(crate) fn crossfield<T>() {}
112104
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)