diff --git a/tests/ui/borrowck/alias-liveness/higher-ranked.rs b/tests/ui/borrowck/alias-liveness/higher-ranked.rs new file mode 100644 index 0000000000000..e9f985f93ac88 --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/higher-ranked.rs @@ -0,0 +1,16 @@ +// check-pass + +trait Captures<'a> {} +impl 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) -> impl Captures<'o> + for<'a> Outlives<'a> {} + +fn statik() -> impl Sized { + test(&vec![]) +} + +fn main() {}