commit
c018a972ae
3 changed files with 40 additions and 1 deletions
|
@ -53,7 +53,7 @@ pub fn rewrite_path(context: &RewriteContext,
|
|||
// 3 = ">::".len()
|
||||
let budget = try_opt!(width.checked_sub(extra_offset + 3));
|
||||
|
||||
result = try_opt!(rewrite_path_segments(expr_context,
|
||||
result = try_opt!(rewrite_path_segments(false,
|
||||
result,
|
||||
path.segments.iter().take(skip_count),
|
||||
span_lo,
|
||||
|
|
19
tests/source/issue-811.rs
Normal file
19
tests/source/issue-811.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
trait FooTrait<T>: Sized {
|
||||
type Bar: BarTrait<T>;
|
||||
}
|
||||
|
||||
trait BarTrait<T>: Sized {
|
||||
type Baz;
|
||||
fn foo();
|
||||
}
|
||||
|
||||
type Foo<T: FooTrait> = <<T as FooTrait<U>>::Bar as BarTrait<U>>::Baz;
|
||||
type Bar<T: BarTrait> = <T as BarTrait<U>>::Baz;
|
||||
|
||||
fn some_func<T: FooTrait<U>, U>() {
|
||||
<<T as FooTrait<U>>::Bar as BarTrait<U>>::foo();
|
||||
}
|
||||
|
||||
fn some_func<T: BarTrait<U>>() {
|
||||
<T as BarTrait<U>>::foo();
|
||||
}
|
20
tests/target/issue-811.rs
Normal file
20
tests/target/issue-811.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
trait FooTrait<T>: Sized {
|
||||
type Bar: BarTrait<T>;
|
||||
}
|
||||
|
||||
trait BarTrait<T>: Sized {
|
||||
type Baz;
|
||||
fn foo();
|
||||
}
|
||||
|
||||
type Foo<T: FooTrait> =
|
||||
<<T as FooTrait<U>>::Bar as BarTrait<U>>::Baz;
|
||||
type Bar<T: BarTrait> = <T as BarTrait<U>>::Baz;
|
||||
|
||||
fn some_func<T: FooTrait<U>, U>() {
|
||||
<<T as FooTrait<U>>::Bar as BarTrait<U>>::foo();
|
||||
}
|
||||
|
||||
fn some_func<T: BarTrait<U>>() {
|
||||
<T as BarTrait<U>>::foo();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue