Show lifetime args if there are only error ones
This commit is contained in:
parent
9dad25a7cb
commit
9d4fdc0157
@ -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 @@ fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError> {
|
|||||||
wc.hir_fmt(f)?;
|
wc.hir_fmt(f)?;
|
||||||
write!(f, ")")?;
|
write!(f, ")")?;
|
||||||
}
|
}
|
||||||
_ => write!(f, "?")?,
|
_ => write!(f, "_")?,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user