From 175a4eab84379cebfc230ea357ae02dc9be39660 Mon Sep 17 00:00:00 2001 From: ridwanabdillahi <91507758+ridwanabdillahi@users.noreply.github.com> Date: Mon, 25 Apr 2022 18:02:43 -0700 Subject: Add support for a new attribute `#[debugger_visualizer]` to support embedding debugger visualizers into a generated PDB. Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries. Merge the queries for debugger visualizers into a single query. Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`. Respond to PR comments. Load visualizer files into opaque bytes `Vec`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate. Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature. Respond to PR comments and minor cleanups. --- compiler/rustc_feature/src/active.rs | 2 ++ compiler/rustc_feature/src/builtin_attrs.rs | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'compiler/rustc_feature/src') diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 9159d60463c..5c07d9121cc 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -358,6 +358,8 @@ 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 rustc to inject a default alloc_error_handler diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index e588385cfca..bdbda8bf20c 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -379,6 +379,12 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ // Unstable attributes: // ========================================================================== + // RFC #3191: #[debugger_visualizer] support + gated!( + debugger_visualizer, Normal, template!(List: r#"natvis_file = "...""#), + DuplicatesOk, experimental!(debugger_visualizer) + ), + // Linking: gated!(naked, Normal, template!(Word), WarnFollowing, naked_functions, experimental!(naked)), gated!( -- cgit 1.4.1-3-g733a5