Add lint modes for uses of @ and ~ pointers, in general.

This commit is contained in:
Graydon Hoare 2012-08-28 18:25:41 -07:00
parent b769e29680
commit ecb646477b
4 changed files with 119 additions and 1 deletions

View file

@ -0,0 +1,11 @@
#[forbid(heap_memory)];
type foo = { //~ ERROR type uses managed
x: @int
};
fn main() {
let _x : { x : ~int } = {x : ~10};
//~^ ERROR type uses owned
//~^^ ERROR type uses owned
}

View file

@ -0,0 +1,11 @@
#[forbid(managed_heap_memory)];
type foo = { //~ ERROR type uses managed
x: @int
};
fn main() {
let _x : foo = {x : @10};
//~^ ERROR type uses managed
//~^^ ERROR type uses managed
}

View file

@ -0,0 +1,11 @@
#[forbid(owned_heap_memory)];
type foo = { //~ ERROR type uses owned
x: ~int
};
fn main() {
let _x : foo = {x : ~10};
//~^ ERROR type uses owned
//~^^ ERROR type uses owned
}