Skip to content

Commit

Permalink
Update new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Mar 5, 2022
1 parent 2b151fd commit 084c0f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/test/ui/generic-associated-types/bugs/issue-87735.rs
Expand Up @@ -12,7 +12,7 @@ pub trait AsRef2 {
}

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

fn as_ref2<'a>(&'a self) -> Self::Output<'a> {
&self[..]
Expand All @@ -33,7 +33,7 @@ where
T: AsRef2<Output<'b> = &'b [U]>,
U: 'b
{
type Output<'a> where Self: 'a = FooRef<'a, U>;
type Output<'a> = FooRef<'a, U> where Self: 'a;

fn as_ref2<'a>(&'a self) -> Self::Output<'a> {
FooRef(self.0.as_ref2())
Expand Down
16 changes: 1 addition & 15 deletions src/test/ui/generic-associated-types/bugs/issue-87735.stderr
@@ -1,23 +1,9 @@
warning: where clause not allowed here
--> $DIR/issue-87735.rs:15:19
|
LL | type Output<'a> where Self: 'a = &'a [T];
| ^^^^^^^^^^^^^^ - help: move it here: `where Self: 'a`
|
= note: `#[warn(deprecated_where_clause_location)]` on by default

warning: where clause not allowed here
--> $DIR/issue-87735.rs:36:19
|
LL | type Output<'a> where Self: 'a = FooRef<'a, U>;
| ^^^^^^^^^^^^^^ - help: move it here: `where Self: 'a`

error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-87735.rs:27:13
|
LL | impl<'b, T, U> AsRef2 for Foo<T>
| ^ unconstrained type parameter

error: aborting due to previous error; 2 warnings emitted
error: aborting due to previous error

For more information about this error, try `rustc --explain E0207`.
2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/bugs/issue-87748.rs
Expand Up @@ -13,7 +13,7 @@ trait MyTrait {
struct Foo;

impl MyTrait for Foo {
type Assoc<'a, 'b> where 'b: 'a = u32;
type Assoc<'a, 'b> = u32 where 'b: 'a;

fn do_sth(_: u32) {}
// fn do_sth(_: Self::Assoc<'static, 'static>) {}
Expand Down
10 changes: 1 addition & 9 deletions src/test/ui/generic-associated-types/bugs/issue-87748.stderr
@@ -1,11 +1,3 @@
warning: where clause not allowed here
--> $DIR/issue-87748.rs:16:24
|
LL | type Assoc<'a, 'b> where 'b: 'a = u32;
| ^^^^^^^^^^^^ - help: move it here: `where 'b: 'a`
|
= note: `#[warn(deprecated_where_clause_location)]` on by default

error[E0478]: lifetime bound not satisfied
--> $DIR/issue-87748.rs:18:5
|
Expand All @@ -23,6 +15,6 @@ note: but lifetime parameter must outlive the anonymous lifetime #1 defined here
LL | fn do_sth(_: u32) {}
| ^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted
error: aborting due to previous error

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

0 comments on commit 084c0f3

Please sign in to comment.