File tree 4 files changed +5
-27
lines changed
src/test/ui/generic-associated-types/bugs
4 files changed +5
-27
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pub trait AsRef2 {
12
12
}
13
13
14
14
impl < T > AsRef2 for Vec < T > {
15
- type Output < ' a > where Self : ' a = & ' a [ T ] ;
15
+ type Output < ' a > = & ' a [ T ] where Self : ' a ;
16
16
17
17
fn as_ref2 < ' a > ( & ' a self ) -> Self :: Output < ' a > {
18
18
& self [ ..]
33
33
T : AsRef2 < Output < ' b > = & ' b [ U ] > ,
34
34
U : ' b
35
35
{
36
- type Output < ' a > where Self : ' a = FooRef < ' a , U > ;
36
+ type Output < ' a > = FooRef < ' a , U > where Self : ' a ;
37
37
38
38
fn as_ref2 < ' a > ( & ' a self ) -> Self :: Output < ' a > {
39
39
FooRef ( self . 0 . as_ref2 ( ) )
Original file line number Diff line number Diff line change 1
- warning: where clause not allowed here
2
- --> $DIR/issue-87735.rs:15:19
3
- |
4
- LL | type Output<'a> where Self: 'a = &'a [T];
5
- | ^^^^^^^^^^^^^^ - help: move it here: `where Self: 'a`
6
- |
7
- = note: `#[warn(deprecated_where_clause_location)]` on by default
8
-
9
- warning: where clause not allowed here
10
- --> $DIR/issue-87735.rs:36:19
11
- |
12
- LL | type Output<'a> where Self: 'a = FooRef<'a, U>;
13
- | ^^^^^^^^^^^^^^ - help: move it here: `where Self: 'a`
14
-
15
1
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
16
2
--> $DIR/issue-87735.rs:27:13
17
3
|
18
4
LL | impl<'b, T, U> AsRef2 for Foo<T>
19
5
| ^ unconstrained type parameter
20
6
21
- error: aborting due to previous error; 2 warnings emitted
7
+ error: aborting due to previous error
22
8
23
9
For more information about this error, try `rustc --explain E0207`.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ trait MyTrait {
13
13
struct Foo ;
14
14
15
15
impl MyTrait for Foo {
16
- type Assoc < ' a , ' b > where ' b : ' a = u32 ;
16
+ type Assoc < ' a , ' b > = u32 where ' b : ' a ;
17
17
18
18
fn do_sth ( _: u32 ) { }
19
19
// fn do_sth(_: Self::Assoc<'static, 'static>) {}
Original file line number Diff line number Diff line change 1
- warning: where clause not allowed here
2
- --> $DIR/issue-87748.rs:16:24
3
- |
4
- LL | type Assoc<'a, 'b> where 'b: 'a = u32;
5
- | ^^^^^^^^^^^^ - help: move it here: `where 'b: 'a`
6
- |
7
- = note: `#[warn(deprecated_where_clause_location)]` on by default
8
-
9
1
error[E0478]: lifetime bound not satisfied
10
2
--> $DIR/issue-87748.rs:18:5
11
3
|
@@ -23,6 +15,6 @@ note: but lifetime parameter must outlive the anonymous lifetime #1 defined here
23
15
LL | fn do_sth(_: u32) {}
24
16
| ^^^^^^^^^^^^^^^^^
25
17
26
- error: aborting due to previous error; 1 warning emitted
18
+ error: aborting due to previous error
27
19
28
20
For more information about this error, try `rustc --explain E0478`.
You can’t perform that action at this time.
0 commit comments