Skip to content

Commit b14e911

Browse files
committed
Move natvis files from src/etc/natvis to debugger_visualizer attributes
1 parent 14196db commit b14e911

10 files changed

Lines changed: 4 additions & 27 deletions

File tree

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,26 +1098,6 @@ impl<'a> Linker for MsvcLinker<'a> {
10981098
// `-Clink-arg=/PDBALTPATH:...` to rustc.
10991099
self.link_arg("/PDBALTPATH:%_PDB%");
11001100

1101-
// This will cause the Microsoft linker to embed .natvis info into the PDB file
1102-
let natvis_dir_path = self.sess.opts.sysroot.path().join("lib\\rustlib\\etc");
1103-
if let Ok(natvis_dir) = fs::read_dir(&natvis_dir_path) {
1104-
for entry in natvis_dir {
1105-
match entry {
1106-
Ok(entry) => {
1107-
let path = entry.path();
1108-
if path.extension() == Some("natvis".as_ref()) {
1109-
let mut arg = OsString::from("/NATVIS:");
1110-
arg.push(path);
1111-
self.link_arg(arg);
1112-
}
1113-
}
1114-
Err(error) => {
1115-
self.sess.dcx().emit_warn(errors::NoNatvisDirectory { error });
1116-
}
1117-
}
1118-
}
1119-
}
1120-
11211101
// This will cause the Microsoft linker to embed .natvis info for all crates into the PDB file
11221102
for path in natvis_debugger_visualizers {
11231103
let mut arg = OsString::from("/NATVIS:");

library/alloc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#![allow(incomplete_features)]
6161
#![allow(unused_attributes)]
6262
#![stable(feature = "alloc", since = "1.36.0")]
63+
#![debugger_visualizer(natvis_file = "../alloc.natvis")]
6364
#![doc(
6465
html_playground_url = "https://play.rust-lang.org/",
6566
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",

library/core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
//! called. The `lang` attribute is called `eh_personality`.
4545
4646
#![stable(feature = "core", since = "1.6.0")]
47+
#![debugger_visualizer(natvis_file = "../core.natvis")]
48+
#![debugger_visualizer(natvis_file = "../intrinsic.natvis")]
4749
#![doc(
4850
html_playground_url = "https://play.rust-lang.org/",
4951
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",

library/std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
//! [slice]: prim@slice
215215
216216
#![cfg_attr(not(restricted_std), stable(feature = "rust1", since = "1.0.0"))]
217+
#![debugger_visualizer(natvis_file = "../std.natvis")]
217218
#![cfg_attr(
218219
restricted_std,
219220
unstable(

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,6 @@ impl Step for DebuggerScripts {
726726
&sysroot.join("bin"),
727727
FileType::Script,
728728
);
729-
730-
cp_debugger_script("natvis/intrinsic.natvis");
731-
cp_debugger_script("natvis/liballoc.natvis");
732-
cp_debugger_script("natvis/libcore.natvis");
733-
cp_debugger_script("natvis/libstd.natvis");
734729
}
735730

736731
cp_debugger_script("rust_types.py");

src/tools/compiletest/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,6 @@ fn common_inputs_stamp(config: &Config) -> Stamp {
707707
stamp.add_path(&path);
708708
}
709709

710-
stamp.add_dir(&src_root.join("src/etc/natvis"));
711-
712710
stamp.add_dir(&config.target_run_lib_path);
713711

714712
if let Some(ref rustdoc_path) = config.rustdoc_path {

0 commit comments

Comments
 (0)