mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Show lifetime args if there are only error ones
This commit is contained in:
parent
7ea4241afa
commit
f1b4a9cfb0
1 changed files with 2 additions and 12 deletions
|
@ -1438,17 +1438,7 @@ fn hir_fmt_generics(
|
||||||
|
|
||||||
let parameters_to_write = generic_args_sans_defaults(f, generic_def, parameters);
|
let parameters_to_write = generic_args_sans_defaults(f, generic_def, parameters);
|
||||||
|
|
||||||
// FIXME: Remote this
|
if !parameters_to_write.is_empty() {
|
||||||
// most of our lifetimes will be errors as we lack elision and inference
|
|
||||||
// so don't render them for now
|
|
||||||
let only_err_lifetimes = !cfg!(test)
|
|
||||||
&& parameters_to_write.iter().all(|arg| {
|
|
||||||
matches!(
|
|
||||||
arg.data(Interner),
|
|
||||||
chalk_ir::GenericArgData::Lifetime(it) if *it.data(Interner) == LifetimeData::Error
|
|
||||||
)
|
|
||||||
});
|
|
||||||
if !parameters_to_write.is_empty() && !only_err_lifetimes {
|
|
||||||
write!(f, "<")?;
|
write!(f, "<")?;
|
||||||
hir_fmt_generic_arguments(f, parameters_to_write, self_)?;
|
hir_fmt_generic_arguments(f, parameters_to_write, self_)?;
|
||||||
write!(f, ">")?;
|
write!(f, ">")?;
|
||||||
|
@ -1881,7 +1871,7 @@ impl HirDisplay for DomainGoal {
|
||||||
wc.hir_fmt(f)?;
|
wc.hir_fmt(f)?;
|
||||||
write!(f, ")")?;
|
write!(f, ")")?;
|
||||||
}
|
}
|
||||||
_ => write!(f, "?")?,
|
_ => write!(f, "_")?,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue