mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
Rollup merge of #108668 - gibbyfree:stabilizedebuggervisualizer, r=wesleywiser
Stabilize debugger_visualizer This stabilizes the `debugger_visualizer` attribute (#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 #95939
This commit is contained in:
commit
f379a58bf2
@ -130,6 +130,8 @@ declare_features! (
|
|||||||
(accepted, copy_closures, "1.26.0", Some(44490), None),
|
(accepted, copy_closures, "1.26.0", Some(44490), None),
|
||||||
/// Allows `crate` in paths.
|
/// Allows `crate` in paths.
|
||||||
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
|
(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
|
/// Allows rustc to inject a default alloc_error_handler
|
||||||
(accepted, default_alloc_error_handler, "1.68.0", Some(66741), None),
|
(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.
|
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
|
||||||
|
@ -363,8 +363,6 @@ declare_features! (
|
|||||||
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
|
(active, custom_inner_attributes, "1.30.0", Some(54726), None),
|
||||||
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.
|
/// Allows custom test frameworks with `#![test_runner]` and `#[test_case]`.
|
||||||
(active, custom_test_frameworks, "1.30.0", Some(50297), None),
|
(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`).
|
/// Allows declarative macros 2.0 (`macro`).
|
||||||
(active, decl_macro, "1.17.0", Some(39412), None),
|
(active, decl_macro, "1.17.0", Some(39412), None),
|
||||||
/// Allows default type parameters to influence type inference.
|
/// Allows default type parameters to influence type inference.
|
||||||
|
@ -403,16 +403,16 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
|||||||
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
|
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:
|
// Unstable attributes:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// RFC #3191: #[debugger_visualizer] support
|
|
||||||
gated!(
|
|
||||||
debugger_visualizer, Normal, template!(List: r#"natvis_file = "...", gdb_script_file = "...""#),
|
|
||||||
DuplicatesOk, experimental!(debugger_visualizer)
|
|
||||||
),
|
|
||||||
|
|
||||||
// Linking:
|
// Linking:
|
||||||
gated!(
|
gated!(
|
||||||
naked, Normal, template!(Word), WarnFollowing, @only_local: true,
|
naked, Normal, template!(Word), WarnFollowing, @only_local: true,
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
# `debugger_visualizer`
|
|
||||||
|
|
||||||
The tracking issue for this feature is: [#95939]
|
|
||||||
|
|
||||||
[#95939]: https://github.com/rust-lang/rust/issues/95939
|
|
||||||
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
The `debugger_visualizer` attribute can be used to instruct the compiler
|
|
||||||
to embed a debugger visualizer file into the PDB/ELF generated by `rustc`.
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
``` rust,ignore (partial-example)
|
|
||||||
#![feature(debugger_visualizer)]
|
|
||||||
#![debugger_visualizer(natvis_file = "foo.natvis")]
|
|
||||||
#![debugger_visualizer(gdb_script_file = "foo.py")]
|
|
||||||
struct Foo {
|
|
||||||
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
Currently, this feature only supports embedding Natvis files on `-windows-msvc`
|
|
||||||
targets via the `natvis_file` meta item. `-windows-gnu` targets are not currently
|
|
||||||
supported.
|
|
@ -2,7 +2,6 @@
|
|||||||
// ignore-lldb
|
// ignore-lldb
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
#![feature(debugger_visualizer)]
|
|
||||||
#![debugger_visualizer(natvis_file = "dependency-with-embedded-visualizers.natvis")]
|
#![debugger_visualizer(natvis_file = "dependency-with-embedded-visualizers.natvis")]
|
||||||
#![debugger_visualizer(gdb_script_file = "dependency-with-embedded-visualizers.py")]
|
#![debugger_visualizer(gdb_script_file = "dependency-with-embedded-visualizers.py")]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
// gdb-check:$4 = "Person A" is 10 years old.
|
// gdb-check:$4 = "Person A" is 10 years old.
|
||||||
|
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
#![feature(debugger_visualizer)]
|
|
||||||
#![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")]
|
#![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")]
|
||||||
#![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")]
|
#![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")]
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#![debugger_visualizer(natvis_file = "auxiliary/debugger-visualizer.natvis")] //~ ERROR the `#[debugger_visualizer]` attribute is an experimental feature
|
|
||||||
|
|
||||||
fn main() {}
|
|
@ -1,12 +0,0 @@
|
|||||||
error[E0658]: the `#[debugger_visualizer]` attribute is an experimental feature
|
|
||||||
--> $DIR/feature-gate-debugger-visualizer.rs:1:1
|
|
||||||
|
|
|
||||||
LL | #![debugger_visualizer(natvis_file = "auxiliary/debugger-visualizer.natvis")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
|
||||||
= note: see issue #95939 <https://github.com/rust-lang/rust/issues/95939> for more information
|
|
||||||
= help: add `#![feature(debugger_visualizer)]` to the crate attributes to enable
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0658`.
|
|
@ -1,7 +1,6 @@
|
|||||||
// normalize-stderr-test: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
|
// normalize-stderr-test: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
|
||||||
// normalize-stderr-test: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE"
|
// 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(random_file = "../foo.random")] //~ ERROR invalid argument
|
||||||
#![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR
|
#![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: invalid argument
|
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")]
|
LL | #![debugger_visualizer(random_file = "../foo.random")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -9,7 +9,7 @@ LL | #![debugger_visualizer(random_file = "../foo.random")]
|
|||||||
= note: expected: `gdb_script_file = "..."`
|
= note: expected: `gdb_script_file = "..."`
|
||||||
|
|
||||||
error: couldn't read $DIR/../foo.random: $FILE_NOT_FOUND_MSG (os error $FILE_NOT_FOUND_CODE)
|
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")]
|
LL | #![debugger_visualizer(natvis_file = "../foo.random")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -1,4 +1,2 @@
|
|||||||
#![feature(debugger_visualizer)]
|
|
||||||
|
|
||||||
#[debugger_visualizer(natvis_file = "../foo.natvis")] //~ ERROR attribute should be applied to a module
|
#[debugger_visualizer(natvis_file = "../foo.natvis")] //~ ERROR attribute should be applied to a module
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: attribute should be applied to a module
|
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")]
|
LL | #[debugger_visualizer(natvis_file = "../foo.natvis")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Loading…
Reference in New Issue
Block a user