Skip to content

Commit

Permalink
Merge pull request #351 from pacak/better-error
Browse files Browse the repository at this point in the history
Better error
  • Loading branch information
pacak authored Dec 20, 2024
2 parents 3c203ef + 979d122 commit 7a1e4de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ owo-colors = { version = "4", features = ["supports-colors"] }
regex = "1"
rustc-demangle = "0.1"
same-file = "1.0.6"
serde = "=1.0.195"
serde = "=1.0.216"
supports-color = "3.0"

[dev-dependencies]
Expand Down
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 7a1e4de

Please sign in to comment.