Skip to content

Commit

Permalink
Auto merge of #17943 - Veykril:diags, r=Veykril
Browse files Browse the repository at this point in the history
fix: Improve proc-macro panic message and workspace loading failure diagnostic
  • Loading branch information
bors committed Aug 22, 2024
2 parents a84c3d4 + ada65fe commit 9b72445
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ rowan.opt-level = 3
rustc-hash.opt-level = 3
smol_str.opt-level = 3
text-size.opt-level = 3
serde.opt-level = 3
salsa.opt-level = 3
# This speeds up `cargo xtask dist`.
miniz_oxide.opt-level = 3
salsa.opt-level = 3

[profile.release]
incremental = true
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-expand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl ExpandErrorKind {
("overflow expanding the original macro".to_owned(), true)
}
ExpandErrorKind::Other(e) => ((**e).to_owned(), true),
ExpandErrorKind::ProcMacroPanic(e) => ((**e).to_owned(), true),
ExpandErrorKind::ProcMacroPanic(e) => (format!("proc-macro panicked: {e}"), true),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl GlobalState {
status.health |= lsp_ext::Health::Warning;
format_to!(
message,
"Workspace `{}` has been queried without dependencies, connecting to crates.io might have failed.\n\n",
"Failed to read Cargo metadata for `{}`, the `Cargo.toml` might be invalid or you have no internet connection.\n\n",
ws.manifest_or_root()
);
}
Expand Down

0 comments on commit 9b72445

Please sign in to comment.