File tree 3 files changed +9
-11
lines changed
src/test/ui/rfc1598-generic-associated-types
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ trait Collection<T> {
22
22
type Iter < ' iter > : Iterator < Item =& ' iter T > ;
23
23
type Family : CollectionFamily ;
24
24
// 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 > ;
27
27
//~^ ERROR type parameters are not allowed on this type [E0109]
28
28
29
29
fn empty ( ) -> Self ;
@@ -63,7 +63,7 @@ impl<T> Collection<T> for Vec<T> {
63
63
}
64
64
65
65
fn 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]
67
67
where
68
68
C : Collection < i32 > ,
69
69
{
75
75
}
76
76
77
77
fn 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]
79
79
where
80
80
C : Collection < i32 > ,
81
81
{
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>
11
11
| ^^^ type parameter not allowed
12
12
13
13
error[E0109]: type parameters are not allowed on this type
14
- --> $DIR/collections.rs:26:16
14
+ --> $DIR/collections.rs:26:71
15
15
|
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
18
18
19
19
error[E0110]: lifetime parameters are not allowed on this type
20
20
--> $DIR/collections.rs:33:50
Original file line number Diff line number Diff line change @@ -23,8 +23,7 @@ trait NoShadow<'a> {
23
23
type Bar < ' b > ; // OK
24
24
}
25
25
26
- impl < ' a > NoShadow < ' a > for & ' a u32
27
- {
26
+ impl < ' a > NoShadow < ' a > for & ' a u32 {
28
27
type Bar < ' a > = i32 ; // Error: shadowed lifetime
29
28
}
30
29
@@ -36,8 +35,7 @@ trait NoShadowT<T> {
36
35
type Bar < U > ; // OK
37
36
}
38
37
39
- impl < T > NoShadowT < T > for Option < T >
40
- {
38
+ impl < T > NoShadowT < T > for Option < T > {
41
39
type Bar < T > = i32 ; // Error: shadowed type parameter
42
40
}
43
41
You can’t perform that action at this time.
0 commit comments