limit packed copy-out to non-generic Copy structs
This commit is contained in:
parent
dee8a71cd5
commit
617b413e18
7 changed files with 123 additions and 15 deletions
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![deny(safe_packed_borrows)]
|
||||
|
||||
// check that derive on a packed struct with non-Copy fields
|
||||
// correctly. This can't be made to work perfectly because
|
||||
// we can't just use the field from the struct as it might
|
||||
|
|
@ -17,12 +19,10 @@
|
|||
struct Y(usize);
|
||||
|
||||
#[derive(PartialEq)]
|
||||
//~^ ERROR cannot move out of borrowed
|
||||
//~| ERROR cannot move out of borrowed
|
||||
//~| ERROR cannot move out of borrowed
|
||||
//~| ERROR cannot move out of borrowed
|
||||
#[repr(packed)]
|
||||
struct X(Y);
|
||||
//~^ ERROR #[derive] can't be used on a non-Copy #[repr(packed)]
|
||||
//~| hard error
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue