Make the test actually show the problematic case
This commit is contained in:
parent
90ec6f847f
commit
e9d219e97c
@ -1,18 +1,27 @@
|
||||
trait Mirror<'a> {
|
||||
type Item;
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
// known-bug: #99840
|
||||
// this should not compile
|
||||
// check-pass
|
||||
|
||||
type Alias = impl Sized;
|
||||
|
||||
fn constrain() -> Alias {
|
||||
1i32
|
||||
}
|
||||
|
||||
impl<'a, T> Mirror<'a> for T {
|
||||
type Item = T;
|
||||
trait HideIt {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
trait AnotherTrait {
|
||||
type Blah;
|
||||
impl HideIt for () {
|
||||
type Assoc = Alias;
|
||||
}
|
||||
|
||||
impl<'a> AnotherTrait for <u32 as Mirror<'a>>::Item {
|
||||
//~^ ERROR: the lifetime parameter `'a` is not constrained
|
||||
type Blah = &'a u32;
|
||||
}
|
||||
pub trait Yay {}
|
||||
|
||||
impl Yay for <() as HideIt>::Assoc {}
|
||||
// impl Yay for i32 {} // this already errors
|
||||
// impl Yay for u32 {} // this also already errors
|
||||
|
||||
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