Some test cleanups

This commit is contained in:
Oli Scherer 2022-09-23 07:18:33 +00:00
parent e9d219e97c
commit e237aaef25
4 changed files with 7 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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