Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Nov 8, 2022
1 parent 49be827 commit 983a90d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/late-bound-lifetimes/auxiliary/upstream_alias.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub trait Trait<'a> {
type Assoc;
}

pub type Alias<'a, T> = <T as Trait<'a>>::Assoc;
10 changes: 10 additions & 0 deletions src/test/ui/late-bound-lifetimes/cross_crate_alias.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions src/test/ui/late-bound-lifetimes/late_bound_through_alias.rs
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 983a90d

Please sign in to comment.