diff options
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index f22faef2580..14668a3d411 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -71,6 +71,7 @@ use std::hash::Hash; use std::ops::{Add, Range, Sub}; use std::path::{Path, PathBuf}; use std::str::FromStr; +use std::sync::Arc; use md5::Digest; use md5::Md5; @@ -1200,6 +1201,28 @@ impl SourceFileHash { } } +#[derive(HashStable_Generic)] +#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash, Debug, Encodable, Decodable)] +pub enum DebuggerVisualizerType { + Natvis, +} + +/// A single debugger visualizer file. +#[derive(HashStable_Generic)] +#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable)] +pub struct DebuggerVisualizerFile { + /// The complete debugger visualizer source. + pub src: Arc<[u8]>, + /// Indicates which visualizer type this targets. + pub visualizer_type: DebuggerVisualizerType, +} + +impl DebuggerVisualizerFile { + pub fn new(src: Arc<[u8]>, visualizer_type: DebuggerVisualizerType) -> Self { + DebuggerVisualizerFile { src, visualizer_type } + } +} + /// A single source in the [`SourceMap`]. #[derive(Clone)] pub struct SourceFile { |
