tests
This commit is contained in:
parent
49be827dca
commit
983a90d716
@ -0,0 +1,5 @@
|
||||
pub trait Trait<'a> {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
pub type Alias<'a, T> = <T as Trait<'a>>::Assoc;
|
10
src/test/ui/late-bound-lifetimes/cross_crate_alias.rs
Normal file
10
src/test/ui/late-bound-lifetimes/cross_crate_alias.rs
Normal 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() {}
|
16
src/test/ui/late-bound-lifetimes/late_bound_through_alias.rs
Normal file
16
src/test/ui/late-bound-lifetimes/late_bound_through_alias.rs
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user