diff options
| author | Aleksei Trifonov <avrong@avrong.me> | 2024-08-26 03:06:49 +0300 |
|---|---|---|
| committer | Aleksei Trifonov <avrong@avrong.me> | 2024-08-26 12:19:50 +0300 |
| commit | 9d4fdc015767d2d14760e5ade31376362c586358 (patch) | |
| tree | 71c7778b1fb766931aca89146e80c3428f4e0ade /src | |
| parent | 9dad25a7cb6a3f439317f2e34297f8ddf70d4fb2 (diff) | |
| download | rust-9d4fdc015767d2d14760e5ade31376362c586358.tar.gz rust-9d4fdc015767d2d14760e5ade31376362c586358.zip | |
Show lifetime args if there are only error ones
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-ty/src/display.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs index 151cc3dc491..4a5eaaa72ae 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/display.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/display.rs @@ -1438,17 +1438,7 @@ fn hir_fmt_generics( let parameters_to_write = generic_args_sans_defaults(f, generic_def, parameters); - // FIXME: Remote this - // 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 { + if !parameters_to_write.is_empty() { write!(f, "<")?; hir_fmt_generic_arguments(f, parameters_to_write, self_)?; write!(f, ">")?; @@ -1881,7 +1871,7 @@ impl HirDisplay for DomainGoal { wc.hir_fmt(f)?; write!(f, ")")?; } - _ => write!(f, "?")?, + _ => write!(f, "_")?, } Ok(()) } |
