Skip to content

Commit 084c0f3

Browse files
committed
Update new tests
1 parent 2b151fd commit 084c0f3

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

src/test/ui/generic-associated-types/bugs/issue-87735.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub trait AsRef2 {
1212
}
1313

1414
impl<T> AsRef2 for Vec<T> {
15-
type Output<'a> where Self: 'a = &'a [T];
15+
type Output<'a> = &'a [T] where Self: 'a;
1616

1717
fn as_ref2<'a>(&'a self) -> Self::Output<'a> {
1818
&self[..]
@@ -33,7 +33,7 @@ where
3333
T: AsRef2<Output<'b> = &'b [U]>,
3434
U: 'b
3535
{
36-
type Output<'a> where Self: 'a = FooRef<'a, U>;
36+
type Output<'a> = FooRef<'a, U> where Self: 'a;
3737

3838
fn as_ref2<'a>(&'a self) -> Self::Output<'a> {
3939
FooRef(self.0.as_ref2())
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
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-
151
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
162
--> $DIR/issue-87735.rs:27:13
173
|
184
LL | impl<'b, T, U> AsRef2 for Foo<T>
195
| ^ unconstrained type parameter
206

21-
error: aborting due to previous error; 2 warnings emitted
7+
error: aborting due to previous error
228

239
For more information about this error, try `rustc --explain E0207`.

src/test/ui/generic-associated-types/bugs/issue-87748.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait MyTrait {
1313
struct Foo;
1414

1515
impl MyTrait for Foo {
16-
type Assoc<'a, 'b> where 'b: 'a = u32;
16+
type Assoc<'a, 'b> = u32 where 'b: 'a;
1717

1818
fn do_sth(_: u32) {}
1919
// fn do_sth(_: Self::Assoc<'static, 'static>) {}

src/test/ui/generic-associated-types/bugs/issue-87748.stderr

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
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-
91
error[E0478]: lifetime bound not satisfied
102
--> $DIR/issue-87748.rs:18:5
113
|
@@ -23,6 +15,6 @@ note: but lifetime parameter must outlive the anonymous lifetime #1 defined here
2315
LL | fn do_sth(_: u32) {}
2416
| ^^^^^^^^^^^^^^^^^
2517

26-
error: aborting due to previous error; 1 warning emitted
18+
error: aborting due to previous error
2719

2820
For more information about this error, try `rustc --explain E0478`.

0 commit comments

Comments
 (0)