This commit is contained in:
Boxy 2022-11-08 22:15:40 +00:00
parent 49be827dca
commit 983a90d716
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,5 @@
pub trait Trait<'a> {
type Assoc;
}
pub type Alias<'a, T> = <T as Trait<'a>>::Assoc;

View File

@ -0,0 +1,10 @@
// aux-build:upstream_alias.rs
// check-pass
extern crate upstream_alias;
fn foo<'a, T: for<'b> upstream_alias::Trait<'b>>(_: upstream_alias::Alias<'a, T>) -> &'a () {
todo!()
}
fn main() {}

View File

@ -0,0 +1,16 @@
// check-pass
fn f(_: X) -> X {
unimplemented!()
}
fn g<'a>(_: X<'a>) -> X<'a> {
unimplemented!()
}
type X<'a> = &'a ();
fn main() {
let _: for<'a> fn(X<'a>) -> X<'a> = g;
let _: for<'a> fn(X<'a>) -> X<'a> = f;
}