Auto merge of #16684 - Veykril:synthetic-fmt-args, r=Veykril

fix: Don't panic on synthetic syntax in inference diagnostics

Temporary fix for https://github.com/rust-lang/rust-analyzer/issues/16682

We ought to rethink how we attach diagnostics to things, as IDs don't work for `format_args` like that!
This commit is contained in:
bors 2024-02-26 16:47:57 +00:00
commit 1d3558bfe1
2 changed files with 33 additions and 17 deletions

View file

@ -20,6 +20,19 @@ pub(crate) fn unresolved_ident(
mod tests {
use crate::tests::check_diagnostics;
// FIXME: This should show a diagnostic
#[test]
fn feature() {
check_diagnostics(
r#"
//- minicore: fmt
fn main() {
format_args!("{unresolved}");
}
"#,
)
}
#[test]
fn missing() {
check_diagnostics(