Skip to content

Commit

Permalink
Unrolled build for rust-lang#134041
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#134041 - clubby789:debugvis-sourcemap, r=jieyouxu

Use SourceMap to load debugger visualizer files
  • Loading branch information
rust-timer authored Dec 10, 2024
2 parents 4996052 + c199c49 commit a4abfe9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/rustc_passes/src/debugger_visualizer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Detecting usage of the `#[debugger_visualizer]` attribute.
use rustc_ast::Attribute;
use rustc_data_structures::sync::Lrc;
use rustc_expand::base::resolve_path;
use rustc_middle::middle::debugger_visualizer::{DebuggerVisualizerFile, DebuggerVisualizerType};
use rustc_middle::query::{LocalCrate, Providers};
Expand Down Expand Up @@ -49,10 +48,10 @@ impl DebuggerVisualizerCollector<'_> {
}
};

match std::fs::read(&file) {
Ok(contents) => {
match self.sess.source_map().load_binary_file(&file) {
Ok((source, _)) => {
self.visualizers.push(DebuggerVisualizerFile::new(
Lrc::from(contents),
source,
visualizer_type,
file,
));
Expand Down

0 comments on commit a4abfe9

Please sign in to comment.