diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs index ff0d51e49f2..77f1df100b3 100644 --- a/src/test/compile-fail/lint-heap-memory.rs +++ b/src/test/compile-fail/lint-heap-memory.rs @@ -10,12 +10,13 @@ #[forbid(heap_memory)]; -type Foo = { //~ ERROR type uses managed - x: @int -}; +struct Foo { + x: @int //~ ERROR type uses managed +} + +struct Bar { x: ~int } //~ ERROR type uses owned fn main() { - let _x : { x : ~int } = {x : ~10}; + let _x : Bar = Bar {x : ~10}; //~^ ERROR type uses owned - //~^^ ERROR type uses owned } diff --git a/src/test/compile-fail/lint-managed-heap-memory.rs b/src/test/compile-fail/lint-managed-heap-memory.rs index 4df874a81d7..6dccc17b2cb 100644 --- a/src/test/compile-fail/lint-managed-heap-memory.rs +++ b/src/test/compile-fail/lint-managed-heap-memory.rs @@ -10,12 +10,11 @@ #[forbid(managed_heap_memory)]; -type Foo = { //~ ERROR type uses managed - x: @int -}; +struct Foo { + x: @int //~ ERROR type uses managed +} fn main() { - let _x : Foo = {x : @10}; + let _x : Foo = Foo {x : @10}; //~^ ERROR type uses managed - //~^^ ERROR type uses managed } diff --git a/src/test/compile-fail/lint-owned-heap-memory.rs b/src/test/compile-fail/lint-owned-heap-memory.rs index 84427644d92..9f5b4497d93 100644 --- a/src/test/compile-fail/lint-owned-heap-memory.rs +++ b/src/test/compile-fail/lint-owned-heap-memory.rs @@ -10,12 +10,11 @@ #[forbid(owned_heap_memory)]; -type Foo = { //~ ERROR type uses owned - x: ~int -}; +struct Foo { + x: ~int //~ ERROR type uses owned +} fn main() { - let _x : Foo = {x : ~10}; + let _x : Foo = Foo {x : ~10}; //~^ ERROR type uses owned - //~^^ ERROR type uses owned }