File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
src/test/ui/rfc1598-generic-associated-types Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ trait Collection<T> {
2222 type Iter < ' iter > : Iterator < Item =& ' iter T > ;
2323 type Family : CollectionFamily ;
2424 // Test associated type defaults with parameters
25- type Sibling < U > : Collection < U > = << Self as Collection < T > > :: Family as CollectionFamily > ::
26- Member < U > ;
25+ type Sibling < U > : Collection < U > =
26+ << Self as Collection < T > > :: Family as CollectionFamily > :: Member < U > ;
2727 //~^ ERROR type parameters are not allowed on this type [E0109]
2828
2929 fn empty ( ) -> Self ;
@@ -63,7 +63,7 @@ impl<T> Collection<T> for Vec<T> {
6363}
6464
6565fn floatify < C > ( ints : & C ) -> <<C as Collection < i32 > >:: Family as CollectionFamily >:: Member < f32 >
66- //~^ ERROR type parameters are not allowed on this type [E0109]
66+ //~^ ERROR type parameters are not allowed on this type [E0109]
6767where
6868 C : Collection < i32 > ,
6969{
7575}
7676
7777fn floatify_sibling < C > ( ints : & C ) -> <C as Collection < i32 > >:: Sibling < f32 >
78- //~^ ERROR type parameters are not allowed on this type [E0109]
78+ //~^ ERROR type parameters are not allowed on this type [E0109]
7979where
8080 C : Collection < i32 > ,
8181{
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
1111 | ^^^ type parameter not allowed
1212
1313error[E0109]: type parameters are not allowed on this type
14- --> $DIR/collections.rs:26:16
14+ --> $DIR/collections.rs:26:71
1515 |
16- LL | Member<U>;
17- | ^ type parameter not allowed
16+ LL | <<Self as Collection<T>>::Family as CollectionFamily>:: Member<U>;
17+ | ^ type parameter not allowed
1818
1919error[E0110]: lifetime parameters are not allowed on this type
2020 --> $DIR/collections.rs:33:50
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ trait NoShadow<'a> {
2323 type Bar < ' b > ; // OK
2424}
2525
26- impl < ' a > NoShadow < ' a > for & ' a u32
27- {
26+ impl < ' a > NoShadow < ' a > for & ' a u32 {
2827 type Bar < ' a > = i32 ; // Error: shadowed lifetime
2928}
3029
@@ -36,8 +35,7 @@ trait NoShadowT<T> {
3635 type Bar < U > ; // OK
3736}
3837
39- impl < T > NoShadowT < T > for Option < T >
40- {
38+ impl < T > NoShadowT < T > for Option < T > {
4139 type Bar < T > = i32 ; // Error: shadowed type parameter
4240}
4341
You can’t perform that action at this time.
0 commit comments