Improve proc-macro panic message and workspace loading failure diagnostic

This commit is contained in:
Lukas Wirth 2024-08-22 18:46:23 +02:00
parent f854e19ef0
commit ada65feaa1
3 changed files with 4 additions and 3 deletions

View file

@ -19,9 +19,10 @@ rowan.opt-level = 3
rustc-hash.opt-level = 3 rustc-hash.opt-level = 3
smol_str.opt-level = 3 smol_str.opt-level = 3
text-size.opt-level = 3 text-size.opt-level = 3
serde.opt-level = 3
salsa.opt-level = 3
# This speeds up `cargo xtask dist`. # This speeds up `cargo xtask dist`.
miniz_oxide.opt-level = 3 miniz_oxide.opt-level = 3
salsa.opt-level = 3
[profile.release] [profile.release]
incremental = true incremental = true

View file

@ -192,7 +192,7 @@ impl ExpandErrorKind {
("overflow expanding the original macro".to_owned(), true) ("overflow expanding the original macro".to_owned(), true)
} }
ExpandErrorKind::Other(e) => ((**e).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),
} }
} }
} }

View file

@ -188,7 +188,7 @@ impl GlobalState {
status.health |= lsp_ext::Health::Warning; status.health |= lsp_ext::Health::Warning;
format_to!( format_to!(
message, 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() ws.manifest_or_root()
); );
} }