diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-26 18:11:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-26 18:11:09 +0200 |
| commit | d09bb02eb50c5b7137eb9a14f546540fa24083cf (patch) | |
| tree | 1c034166d90e4d2a70709f4e0a0a543b721ae370 /compiler/rustc_hir/src | |
| parent | 024fbad4a076406e45e4db78c07ac39095ca6a67 (diff) | |
| parent | 9acc63a48c8206cfe2c2d272600d538983308657 (diff) | |
| download | rust-d09bb02eb50c5b7137eb9a14f546540fa24083cf.tar.gz rust-d09bb02eb50c5b7137eb9a14f546540fa24083cf.zip | |
Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkov
port `#[debugger_visualizer]` to the new attribute system
Diffstat (limited to 'compiler/rustc_hir/src')
| -rw-r--r-- | compiler/rustc_hir/src/attrs/data_structures.rs | 19 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/attrs/encode_cross_crate.rs | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index 5481c9debc1..ddcbaeaad88 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -363,6 +363,20 @@ pub struct LinkEntry { pub import_name_type: Option<(PeImportNameType, Span)>, } +#[derive(HashStable_Generic, PrintAttribute)] +#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash, Debug, Encodable, Decodable)] +pub enum DebuggerVisualizerType { + Natvis, + GdbPrettyPrinter, +} + +#[derive(Debug, Encodable, Decodable, Clone, HashStable_Generic, PrintAttribute)] +pub struct DebugVisualizer { + pub span: Span, + pub visualizer_type: DebuggerVisualizerType, + pub path: Symbol, +} + /// Represents parsed *built-in* inert attributes. /// /// ## Overview @@ -485,7 +499,10 @@ pub enum AttributeKind { /// Represents `#[custom_mir]`. CustomMir(Option<(MirDialect, Span)>, Option<(MirPhase, Span)>, Span), - ///Represents `#[rustc_deny_explicit_impl]`. + /// Represents `#[debugger_visualizer]`. + DebuggerVisualizer(ThinVec<DebugVisualizer>), + + /// Represents `#[rustc_deny_explicit_impl]`. DenyExplicitImpl(Span), /// Represents [`#[deprecated]`](https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#the-deprecated-attribute). diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index e0a37f50f45..1611b865c77 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -37,6 +37,7 @@ impl AttributeKind { Coverage(..) => No, CrateName { .. } => No, CustomMir(_, _, _) => Yes, + DebuggerVisualizer(..) => No, DenyExplicitImpl(..) => No, Deprecation { .. } => Yes, DoNotImplementViaObject(..) => No, |
