Some test cleanups
This commit is contained in:
parent
e9d219e97c
commit
e237aaef25
@ -105,7 +105,7 @@ pub(crate) fn insert_outlives_predicate<'tcx>(
|
||||
// struct Ss<'a, T>(&'a Opaque<T>);
|
||||
// ```
|
||||
//
|
||||
// Here we want to require an explicit `where Opaque<T>: 'a`
|
||||
// Here we want to have an implied bound `Opaque<T>: 'a`
|
||||
|
||||
let ty = tcx.mk_opaque(def_id, substs);
|
||||
required_predicates
|
||||
|
@ -17,7 +17,6 @@ trait Yay<AdditionalValue> {
|
||||
|
||||
impl<T> Yay<T> for () {
|
||||
type InnerStream<'s> = impl Stream<Item = i32> + 's;
|
||||
//^ ERROR does not fulfill the required lifetime
|
||||
fn foo<'s>() -> Self::InnerStream<'s> { () }
|
||||
}
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
// check-pass
|
||||
|
||||
trait Tr { type Assoc; }
|
||||
impl<'a> Tr for &'a str { type Assoc = &'a str; }
|
||||
|
||||
type OpaqueTy<'a> = impl Tr;
|
||||
fn defining(s: &str) -> OpaqueTy<'_> { s }
|
||||
|
||||
// now we must be able to conclude `'a: 'static` from `Opaque<'a>: 'static`
|
||||
|
||||
fn main() {}
|
@ -5,4 +5,10 @@
|
||||
fn defining<T>() -> Opaque<T> {}
|
||||
struct Ss<'a, T>(&'a Opaque<T>);
|
||||
|
||||
|
||||
fn test<'a, T>(_: Ss<'a, T>) {
|
||||
// test that we have an implied bound `Opaque<T>: 'a` from fn signature
|
||||
None::<&'a Opaque<T>>;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user