Skip to content

Commit b39ba21

Browse files
committed
tests H.R. T: 'a bounds proving themselves
1 parent ad25ee0 commit b39ba21

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Test that we consider `for<'a> &'a T: 'a` to be sufficient to prove
2+
// that `for<'a> &'a T: 'a`.
3+
//
4+
// FIXME. Except we don't!
5+
6+
#![allow(warnings)]
7+
8+
fn self_wf2<T>()
9+
where
10+
for<'a> &'a T: 'a,
11+
{
12+
self_wf2::<T>();
13+
//~^ ERROR `T` does not live long enough
14+
//
15+
// FIXME. This ought to be accepted, presumably.
16+
}
17+
18+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: `T` does not live long enough
2+
--> $DIR/forall-wf-ref-reflexive.rs:12:5
3+
|
4+
LL | self_wf2::<T>();
5+
| ^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Test that we consider `for<'a> T: 'a` to be sufficient to prove
2+
// that `for<'a> T: 'a`.
3+
//
4+
// check-pass
5+
6+
#![allow(warnings)]
7+
8+
fn self_wf1<T>()
9+
where
10+
for<'a> T: 'a,
11+
{
12+
self_wf1::<T>();
13+
}
14+
15+
fn main() {}

0 commit comments

Comments
 (0)