Skip to content

Commit 6fa0ff2

Browse files
committed
Feature-gate #[no_debug] and #[omit_gdb_pretty_printer_section]
Closes #28091.
1 parent 783c3fc commit 6fa0ff2

File tree

97 files changed

+135
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+135
-5
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status
197197

198198
// allow overloading augmented assignment operations like `a += b`
199199
("augmented_assignments", "1.5.0", None, Active),
200+
201+
// allow `#[no_debug]`
202+
("no_debug", "1.5.0", None, Active),
203+
204+
// allow `#[omit_gdb_pretty_printer_section]`
205+
("omit_gdb_pretty_printer_section", "1.5.0", None, Active),
200206
];
201207
// (changing above list without updating src/doc/reference.md makes @cmr sad)
202208

@@ -320,8 +326,13 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat
320326
("link_section", Whitelisted, Ungated),
321327
("no_builtins", Whitelisted, Ungated),
322328
("no_mangle", Whitelisted, Ungated),
323-
("no_debug", Whitelisted, Ungated),
324-
("omit_gdb_pretty_printer_section", Whitelisted, Ungated),
329+
("no_debug", Whitelisted, Gated("no_debug",
330+
"the `#[no_debug]` attribute \
331+
is an experimental feature")),
332+
("omit_gdb_pretty_printer_section", Whitelisted, Gated("omit_gdb_pretty_printer_section",
333+
"the `#[omit_gdb_pretty_printer_section]` \
334+
attribute is just used for the Rust test \
335+
suite")),
325336
("unsafe_no_drop_flag", Whitelisted, Gated("unsafe_no_drop_flag",
326337
"unsafe_no_drop_flag has unstable semantics \
327338
and may be removed in the future")),

src/test/auxiliary/cross_crate_spans.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![crate_type = "rlib"]
1212

1313
#![allow(unused_variables)]
14+
#![feature(omit_gdb_pretty_printer_section)]
1415
#![omit_gdb_pretty_printer_section]
1516

1617
// no-prefer-dynamic
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[no_debug] //~ ERROR the `#[no_debug]` attribute is
12+
fn main() {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[omit_gdb_pretty_printer_section] //~ ERROR the `#[omit_gdb_pretty_printer_section]` attribute is
12+
fn main() {}

src/test/debuginfo/associated-types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080

8181
#![allow(unused_variables)]
8282
#![allow(dead_code)]
83+
#![feature(omit_gdb_pretty_printer_section)]
8384
#![omit_gdb_pretty_printer_section]
8485

8586
trait TraitWithAssocType {

src/test/debuginfo/basic-types-globals-metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
#![allow(unused_variables)]
4646
#![allow(dead_code)]
47+
#![feature(omit_gdb_pretty_printer_section)]
4748
#![omit_gdb_pretty_printer_section]
4849

4950
// N.B. These are `mut` only so they don't constant fold away.

src/test/debuginfo/basic-types-globals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
// gdb-command:continue
5050

5151
#![allow(unused_variables)]
52+
#![feature(omit_gdb_pretty_printer_section)]
5253
#![omit_gdb_pretty_printer_section]
5354

5455
// N.B. These are `mut` only so they don't constant fold away.

src/test/debuginfo/basic-types-metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
// gdb-command:continue
6565

6666
#![allow(unused_variables)]
67+
#![feature(omit_gdb_pretty_printer_section)]
6768
#![omit_gdb_pretty_printer_section]
6869

6970
fn main() {

src/test/debuginfo/basic-types-mut-globals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
// gdb-check:$28 = 9.25
8383

8484
#![allow(unused_variables)]
85+
#![feature(omit_gdb_pretty_printer_section)]
8586
#![omit_gdb_pretty_printer_section]
8687

8788
static mut B: bool = false;

src/test/debuginfo/basic-types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
// lldb-check:[...]$12 = 3.5
8888

8989
#![allow(unused_variables)]
90+
#![feature(omit_gdb_pretty_printer_section)]
9091
#![omit_gdb_pretty_printer_section]
9192

9293
fn main() {

0 commit comments

Comments
 (0)