Skip to content

Commit

Permalink
Try to handle case of corrupted/mismatched rust-src a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
pacak committed Dec 20, 2024
1 parent eebfe9f commit 21c9fc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ fn dump_range(
match files.get(&loc.file) {
Some((fname, Some((source, file)))) => {
if source.show_for(fmt.sources_from) {
let rust_line = &file[loc.line as usize - 1];
let rust_line = &file.get(loc.line as usize - 1).expect(
"Corrupted rust-src installation? Try re-adding rust-src component.",
);
let pos = format!("\t\t// {} : {}", fname.display(), loc.line);
safeprintln!("{}", color!(pos, OwoColorize::cyan));
safeprintln!(
Expand Down

0 comments on commit 21c9fc2

Please sign in to comment.