tests H.R. T: 'a
bounds proving themselves
This commit is contained in:
parent
ad25ee09c7
commit
b39ba21fcb
18
src/test/ui/regions/forall-wf-ref-reflexive.rs
Normal file
18
src/test/ui/regions/forall-wf-ref-reflexive.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// Test that we consider `for<'a> &'a T: 'a` to be sufficient to prove
|
||||
// that `for<'a> &'a T: 'a`.
|
||||
//
|
||||
// FIXME. Except we don't!
|
||||
|
||||
#![allow(warnings)]
|
||||
|
||||
fn self_wf2<T>()
|
||||
where
|
||||
for<'a> &'a T: 'a,
|
||||
{
|
||||
self_wf2::<T>();
|
||||
//~^ ERROR `T` does not live long enough
|
||||
//
|
||||
// FIXME. This ought to be accepted, presumably.
|
||||
}
|
||||
|
||||
fn main() {}
|
8
src/test/ui/regions/forall-wf-ref-reflexive.stderr
Normal file
8
src/test/ui/regions/forall-wf-ref-reflexive.stderr
Normal file
@ -0,0 +1,8 @@
|
||||
error: `T` does not live long enough
|
||||
--> $DIR/forall-wf-ref-reflexive.rs:12:5
|
||||
|
|
||||
LL | self_wf2::<T>();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
15
src/test/ui/regions/forall-wf-reflexive.rs
Normal file
15
src/test/ui/regions/forall-wf-reflexive.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Test that we consider `for<'a> T: 'a` to be sufficient to prove
|
||||
// that `for<'a> T: 'a`.
|
||||
//
|
||||
// check-pass
|
||||
|
||||
#![allow(warnings)]
|
||||
|
||||
fn self_wf1<T>()
|
||||
where
|
||||
for<'a> T: 'a,
|
||||
{
|
||||
self_wf1::<T>();
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user