mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
Update new tests
This commit is contained in:
parent
2b151fd5c8
commit
084c0f36ef
@ -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())
|
||||
|
@ -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`.
|
||||
|
@ -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>) {}
|
||||
|
@ -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`.
|
||||
|
Loading…
Reference in New Issue
Block a user