rust/tests/ui/lint/lint-owned-heap-memory.rs
2023-01-11 09:32:08 +00:00

13 lines
197 B
Rust

#![allow(dead_code)]
#![forbid(box_pointers)]
struct Foo {
x: Box<isize> //~ ERROR type uses owned
}
fn main() {
let _x: Foo = Foo { x : Box::new(10) };
//~^ ERROR type uses owned
}