Skip to content

Commit

Permalink
One extra test for higher-ranked outlives
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 2, 2023
1 parent fe7cfaa commit 1b88ace
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/ui/borrowck/alias-liveness/higher-ranked.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// check-pass

trait Captures<'a> {}
impl<T> Captures<'_> for T {}

trait Outlives<'a>: 'a {}
impl<'a, T: 'a> Outlives<'a> for T {}

// Test that we treat `for<'a> Opaque: 'a` as `Opaque: 'static`
fn test<'o>(v: &'o Vec<i32>) -> impl Captures<'o> + for<'a> Outlives<'a> {}

fn statik() -> impl Sized {
test(&vec![])
}

fn main() {}

0 comments on commit 1b88ace

Please sign in to comment.