Skip to content

Commit

Permalink
Rollup merge of rust-lang#108668 - gibbyfree:stabilizedebuggervisuali…
Browse files Browse the repository at this point in the history
…zer, r=wesleywiser

Stabilize debugger_visualizer

This stabilizes the `debugger_visualizer` attribute (rust-lang#95939).

* Marks the `debugger_visualizer` feature as `accepted`.
* Marks the `debugger_visualizer` attribute as `ungated`.
* Deletes feature gate test, removes feature gate from other tests.

Closes rust-lang#95939
  • Loading branch information
matthiaskrgr authored May 1, 2023
2 parents 1795530 + c9653a6 commit dcef3b7
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 58 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ declare_features! (
(accepted, copy_closures, "1.26.0", Some(44490), None),
/// Allows `crate` in paths.
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
/// Allows using `#[debugger_visualizer]` attribute.
(accepted, debugger_visualizer, "CURRENT_RUSTC_VERSION", Some(95939), None),
/// Allows rustc to inject a default alloc_error_handler
(accepted, default_alloc_error_handler, "1.68.0", Some(66741), None),
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ declare_features! (
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.
(active, custom_test_frameworks, "1.30.0", Some(50297), None),
/// Allows using `#[debugger_visualizer]`.
(active, debugger_visualizer, "1.62.0", Some(95939), None),
/// Allows declarative macros 2.0 (`macro`).
(active, decl_macro, "1.17.0", Some(39412), None),
/// Allows default type parameters to influence type inference.
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
),

// Debugging
ungated!(
debugger_visualizer, Normal,
template!(List: r#"natvis_file = "...", gdb_script_file = "...""#), DuplicatesOk
),

// ==========================================================================
// Unstable attributes:
// ==========================================================================

// RFC #3191: #[debugger_visualizer] support
gated!(
debugger_visualizer, Normal, template!(List: r#"natvis_file = "...", gdb_script_file = "...""#),
DuplicatesOk, experimental!(debugger_visualizer)
),

// Linking:
gated!(
naked, Normal, template!(Word), WarnFollowing, @only_local: true,
Expand Down
27 changes: 0 additions & 27 deletions src/doc/unstable-book/src/language-features/debugger-visualizer.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// ignore-lldb
// no-prefer-dynamic

#![feature(debugger_visualizer)]
#![debugger_visualizer(natvis_file = "dependency-with-embedded-visualizers.natvis")]
#![debugger_visualizer(gdb_script_file = "dependency-with-embedded-visualizers.py")]
#![crate_type = "rlib"]
Expand Down
1 change: 0 additions & 1 deletion tests/debuginfo/embedded-visualizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
// gdb-check:$4 = "Person A" is 10 years old.

#![allow(unused_variables)]
#![feature(debugger_visualizer)]
#![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")]
#![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")]

Expand Down
3 changes: 0 additions & 3 deletions tests/ui/feature-gates/feature-gate-debugger-visualizer.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/feature-gates/feature-gate-debugger-visualizer.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/invalid/invalid-debugger-visualizer-option.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// normalize-stderr-test: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
// normalize-stderr-test: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE"

#![feature(debugger_visualizer)]
#![debugger_visualizer(random_file = "../foo.random")] //~ ERROR invalid argument
#![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR
fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/invalid/invalid-debugger-visualizer-option.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: invalid argument
--> $DIR/invalid-debugger-visualizer-option.rs:5:24
--> $DIR/invalid-debugger-visualizer-option.rs:4:24
|
LL | #![debugger_visualizer(random_file = "../foo.random")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -9,7 +9,7 @@ LL | #![debugger_visualizer(random_file = "../foo.random")]
= note: expected: `gdb_script_file = "..."`

error: couldn't read $DIR/../foo.random: $FILE_NOT_FOUND_MSG (os error $FILE_NOT_FOUND_CODE)
--> $DIR/invalid-debugger-visualizer-option.rs:6:24
--> $DIR/invalid-debugger-visualizer-option.rs:5:24
|
LL | #![debugger_visualizer(natvis_file = "../foo.random")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/invalid/invalid-debugger-visualizer-target.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#![feature(debugger_visualizer)]

#[debugger_visualizer(natvis_file = "../foo.natvis")] //~ ERROR attribute should be applied to a module
fn main() {}
2 changes: 1 addition & 1 deletion tests/ui/invalid/invalid-debugger-visualizer-target.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: attribute should be applied to a module
--> $DIR/invalid-debugger-visualizer-target.rs:3:1
--> $DIR/invalid-debugger-visualizer-target.rs:1:1
|
LL | #[debugger_visualizer(natvis_file = "../foo.natvis")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit dcef3b7

Please sign in to comment.