Skip to content

Commit 1b0e158

Browse files
committed
Auto merge of rust-lang#17943 - Veykril:diags, r=Veykril
fix: Improve proc-macro panic message and workspace loading failure diagnostic
2 parents 81a9956 + 0a27711 commit 1b0e158

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/tools/rust-analyzer/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ rowan.opt-level = 3
1919
rustc-hash.opt-level = 3
2020
smol_str.opt-level = 3
2121
text-size.opt-level = 3
22+
serde.opt-level = 3
23+
salsa.opt-level = 3
2224
# This speeds up `cargo xtask dist`.
2325
miniz_oxide.opt-level = 3
24-
salsa.opt-level = 3
2526

2627
[profile.release]
2728
incremental = true

src/tools/rust-analyzer/crates/hir-expand/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl ExpandErrorKind {
192192
("overflow expanding the original macro".to_owned(), true)
193193
}
194194
ExpandErrorKind::Other(e) => ((**e).to_owned(), true),
195-
ExpandErrorKind::ProcMacroPanic(e) => ((**e).to_owned(), true),
195+
ExpandErrorKind::ProcMacroPanic(e) => (format!("proc-macro panicked: {e}"), true),
196196
}
197197
}
198198
}

src/tools/rust-analyzer/crates/rust-analyzer/src/reload.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl GlobalState {
188188
status.health |= lsp_ext::Health::Warning;
189189
format_to!(
190190
message,
191-
"Workspace `{}` has been queried without dependencies, connecting to crates.io might have failed.\n\n",
191+
"Failed to read Cargo metadata for `{}`, the `Cargo.toml` might be invalid or you have no internet connection.\n\n",
192192
ws.manifest_or_root()
193193
);
194194
}

0 commit comments

Comments
 (0)