display correctly 'impl Trait<T> + Trait<T>' #4814
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
3d6fd620e8
commit
947a27b797
@ -511,6 +511,7 @@ fn write_bounds_like_dyn_trait(
|
||||
GenericPredicate::Implemented(trait_ref) => {
|
||||
if angle_open {
|
||||
write!(f, ">")?;
|
||||
angle_open = false;
|
||||
}
|
||||
if !first {
|
||||
write!(f, " + ")?;
|
||||
|
@ -766,6 +766,25 @@ fn hover_for_param_edge() {
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_for_param_with_multiple_traits() {
|
||||
check(
|
||||
r#"trait Deref {
|
||||
type Target: ?Sized;
|
||||
}
|
||||
trait DerefMut {
|
||||
type Target: ?Sized;
|
||||
}
|
||||
fn f(_x<|>: impl Deref<Target=u8> + DerefMut<Target=u8>) {}"#,
|
||||
expect![[r#"
|
||||
*_x*
|
||||
```rust
|
||||
impl Deref<Target = u8> + DerefMut<Target = u8>
|
||||
```
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_infer_associated_method_result() {
|
||||
check(
|
||||
|
Loading…
Reference in New Issue
Block a user