Update new tests

This commit is contained in:
Jack Huey 2022-02-14 14:10:01 -05:00
parent 2b151fd5c8
commit 084c0f36ef
4 changed files with 5 additions and 27 deletions

View File

@ -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[..]
@ -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())

View File

@ -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`.

View File

@ -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>) {}

View File

@ -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
|
@ -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`.