Make the test actually show the problematic case
This commit is contained in:
parent
90ec6f847f
commit
e9d219e97c
@ -1,18 +1,27 @@
|
|||||||
trait Mirror<'a> {
|
#![feature(type_alias_impl_trait)]
|
||||||
type Item;
|
|
||||||
|
// known-bug: #99840
|
||||||
|
// this should not compile
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
type Alias = impl Sized;
|
||||||
|
|
||||||
|
fn constrain() -> Alias {
|
||||||
|
1i32
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Mirror<'a> for T {
|
trait HideIt {
|
||||||
type Item = T;
|
type Assoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
trait AnotherTrait {
|
impl HideIt for () {
|
||||||
type Blah;
|
type Assoc = Alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> AnotherTrait for <u32 as Mirror<'a>>::Item {
|
pub trait Yay {}
|
||||||
//~^ ERROR: the lifetime parameter `'a` is not constrained
|
|
||||||
type Blah = &'a u32;
|
impl Yay for <() as HideIt>::Assoc {}
|
||||||
}
|
// impl Yay for i32 {} // this already errors
|
||||||
|
// impl Yay for u32 {} // this also already errors
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
|
|
||||||
--> $DIR/implied_lifetime_wf_check.rs:13:6
|
|
||||||
|
|
|
||||||
LL | impl<'a> AnotherTrait for <u32 as Mirror<'a>>::Item {
|
|
||||||
| ^^ unconstrained lifetime parameter
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0207`.
|
|
Loading…
x
Reference in New Issue
Block a user