Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::ffi::{OsStr, OsString};
use std::fs::{self, File};
use std::fs::File;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::{env, iter, mem, str};
Expand Down Expand Up @@ -1098,26 +1098,6 @@ impl<'a> Linker for MsvcLinker<'a> {
// `-Clink-arg=/PDBALTPATH:...` to rustc.
self.link_arg("/PDBALTPATH:%_PDB%");

// This will cause the Microsoft linker to embed .natvis info into the PDB file
let natvis_dir_path = self.sess.opts.sysroot.path().join("lib\\rustlib\\etc");
if let Ok(natvis_dir) = fs::read_dir(&natvis_dir_path) {
for entry in natvis_dir {
match entry {
Ok(entry) => {
let path = entry.path();
if path.extension() == Some("natvis".as_ref()) {
let mut arg = OsString::from("/NATVIS:");
arg.push(path);
self.link_arg(arg);
}
}
Err(error) => {
self.sess.dcx().emit_warn(errors::NoNatvisDirectory { error });
}
}
}
}

// This will cause the Microsoft linker to embed .natvis info for all crates into the PDB file
for path in natvis_debugger_visualizers {
let mut arg = OsString::from("/NATVIS:");
Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ pub(crate) struct LinkerUnsupportedModifier;
#[diag("exporting symbols not implemented yet for L4Bender")]
pub(crate) struct L4BenderExportingSymbolsUnimplemented;

#[derive(Diagnostic)]
#[diag("error enumerating natvis directory: {$error}")]
pub(crate) struct NoNatvisDirectory {
pub error: Error,
}

#[derive(Diagnostic)]
#[diag("cached cgu {$cgu_name} should have an object file, but doesn't")]
pub(crate) struct NoSavedObjectFile<'a> {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#![allow(incomplete_features)]
#![allow(unused_attributes)]
#![stable(feature = "alloc", since = "1.36.0")]
#![debugger_visualizer(natvis_file = "../alloc.natvis")]
#![doc(
html_playground_url = "https://play.rust-lang.org/",
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
//! called. The `lang` attribute is called `eh_personality`.

#![stable(feature = "core", since = "1.6.0")]
#![debugger_visualizer(natvis_file = "../core.natvis")]
#![debugger_visualizer(natvis_file = "../intrinsic.natvis")]
#![doc(
html_playground_url = "https://play.rust-lang.org/",
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
Expand Down
1 change: 1 addition & 0 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
//! [slice]: prim@slice

#![cfg_attr(not(restricted_std), stable(feature = "rust1", since = "1.0.0"))]
#![debugger_visualizer(natvis_file = "../std.natvis")]
#![cfg_attr(
restricted_std,
unstable(
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,6 @@ impl Step for DebuggerScripts {
&sysroot.join("bin"),
FileType::Script,
);

cp_debugger_script("natvis/intrinsic.natvis");
cp_debugger_script("natvis/liballoc.natvis");
cp_debugger_script("natvis/libcore.natvis");
cp_debugger_script("natvis/libstd.natvis");
}

cp_debugger_script("rust_types.py");
Expand Down
2 changes: 0 additions & 2 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ fn common_inputs_stamp(config: &Config) -> Stamp {
stamp.add_path(&path);
}

stamp.add_dir(&src_root.join("src/etc/natvis"));

stamp.add_dir(&config.target_run_lib_path);

if let Some(ref rustdoc_path) = config.rustdoc_path {
Expand Down
Loading