about summary refs log tree commit diff
path: root/src/test/compile-fail/check-static-values-constraints.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-05 18:56:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-06 23:12:54 -0700
commit090040bf4037a094e50b03d79e4baf5cd89c912b (patch)
tree27fa91d623889d59260d3db167abdfa8c4288849 /src/test/compile-fail/check-static-values-constraints.rs
parent24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff)
downloadrust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz
rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
Diffstat (limited to 'src/test/compile-fail/check-static-values-constraints.rs')
-rw-r--r--src/test/compile-fail/check-static-values-constraints.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs
index a8581534848..6c1e759cc2f 100644
--- a/src/test/compile-fail/check-static-values-constraints.rs
+++ b/src/test/compile-fail/check-static-values-constraints.rs
@@ -94,7 +94,7 @@ static STATIC10: UnsafeStruct = UnsafeStruct;
 
 struct MyOwned;
 
-static STATIC11: ~MyOwned = ~MyOwned;
+static STATIC11: Box<MyOwned> = box MyOwned;
 //~^ ERROR static items are not allowed to have owned pointers
 
 // The following examples test that mutable structs are just forbidden
@@ -109,11 +109,12 @@ static mut STATIC13: SafeStruct = SafeStruct{field1: Variant1, field2: Variant3(
 static mut STATIC14: SafeStruct = SafeStruct{field1: Variant1, field2: Variant4("str".to_owned())};
 //~^ ERROR mutable static items are not allowed to have destructors
 
-static STATIC15: &'static [~MyOwned] = &'static [~MyOwned, ~MyOwned];
+static STATIC15: &'static [Box<MyOwned>] = &'static [box MyOwned, box MyOwned];
 //~^ ERROR static items are not allowed to have owned pointers
 //~^^ ERROR static items are not allowed to have owned pointers
 
-static STATIC16: (&'static ~MyOwned, &'static ~MyOwned) = (&'static ~MyOwned, &'static ~MyOwned);
+static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) =
+    (&'static box MyOwned, &'static box MyOwned);
 //~^ ERROR static items are not allowed to have owned pointers
 //~^^ ERROR static items are not allowed to have owned pointers
 
@@ -123,10 +124,10 @@ static mut STATIC17: SafeEnum = Variant1;
 static STATIC18: @SafeStruct = @SafeStruct{field1: Variant1, field2: Variant2(0)};
 //~^ ERROR static items are not allowed to have managed pointers
 
-static STATIC19: ~int = box 3;
+static STATIC19: Box<int> = box 3;
 //~^ ERROR static items are not allowed to have owned pointers
 
 pub fn main() {
-    let y = { static x: ~int = ~3; x };
+    let y = { static x: Box<int> = box 3; x };
     //~^ ERROR static items are not allowed to have owned pointers
 }