mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Don't write trailing whitespace when formatting empty GenericPredicates
This commit is contained in:
parent
9e5192d917
commit
0799288f01
3 changed files with 24 additions and 14 deletions
|
@ -28,7 +28,7 @@ use hir_expand::{
|
|||
};
|
||||
use hir_ty::{
|
||||
autoderef,
|
||||
display::{write_bounds_like_dyn_trait, HirDisplayError, HirFormatter},
|
||||
display::{write_bounds_like_dyn_trait_with_prefix, HirDisplayError, HirFormatter},
|
||||
method_resolution,
|
||||
traits::{FnTrait, Solution, SolutionVariables},
|
||||
ApplicationTy, BoundVar, CallableDefId, Canonical, DebruijnIndex, FnSig, GenericPredicate,
|
||||
|
@ -1379,8 +1379,7 @@ impl HirDisplay for TypeParam {
|
|||
let substs = Substs::type_params(f.db, self.id.parent);
|
||||
let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::<Vec<_>>();
|
||||
if !(predicates.is_empty() || f.omit_verbose_types()) {
|
||||
write!(f, ": ")?;
|
||||
write_bounds_like_dyn_trait(&predicates, f)?;
|
||||
write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue