oops...
This commit is contained in:
parent
220ed09b26
commit
875024ca6b
3 changed files with 36 additions and 2 deletions
13
src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs
Normal file
13
src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
struct Wrapper<'a, T>(&'a T)
|
||||
where
|
||||
T: 'a;
|
||||
|
||||
impl<'a, T> Drop for Wrapper<'a, T>
|
||||
where
|
||||
T: 'static,
|
||||
//~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
|
||||
{
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
17
src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr
Normal file
17
src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error[E0367]: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
|
||||
--> $DIR/relate_lt_in_type_outlives_bound.rs:7:8
|
||||
|
|
||||
LL | T: 'static,
|
||||
| ^^^^^^^
|
||||
|
|
||||
note: the implementor must specify the same requirement
|
||||
--> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
|
||||
|
|
||||
LL | / struct Wrapper<'a, T>(&'a T)
|
||||
LL | | where
|
||||
LL | | T: 'a;
|
||||
| |__________^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0367`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue