about summary refs log tree commit diff
path: root/src/test/debug-info/recursive-struct.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/debug-info/recursive-struct.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/debug-info/recursive-struct.rs')
-rw-r--r--src/test/debug-info/recursive-struct.rs45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/test/debug-info/recursive-struct.rs b/src/test/debug-info/recursive-struct.rs
index ca178468941..a46a1c248ff 100644
--- a/src/test/debug-info/recursive-struct.rs
+++ b/src/test/debug-info/recursive-struct.rs
@@ -105,13 +105,14 @@
 #![allow(unused_variable)]
 #![feature(struct_variant)]
 
+
 enum Opt<T> {
     Empty,
     Val { val: T }
 }
 
 struct UniqueNode<T> {
-    next: Opt<~UniqueNode<T>>,
+    next: Opt<Box<UniqueNode<T>>>,
     value: T
 }
 
@@ -121,27 +122,27 @@ struct ManagedNode<T> {
 }
 
 struct LongCycle1<T> {
-    next: ~LongCycle2<T>,
+    next: Box<LongCycle2<T>>,
     value: T,
 }
 
 struct LongCycle2<T> {
-    next: ~LongCycle3<T>,
+    next: Box<LongCycle3<T>>,
     value: T,
 }
 
 struct LongCycle3<T> {
-    next: ~LongCycle4<T>,
+    next: Box<LongCycle4<T>>,
     value: T,
 }
 
 struct LongCycle4<T> {
-    next: Option<~LongCycle1<T>>,
+    next: Option<Box<LongCycle1<T>>>,
     value: T,
 }
 
 struct LongCycleWithAnonymousTypes {
-    next: Opt<~~~~~LongCycleWithAnonymousTypes>,
+    next: Opt<Box<Box<Box<Box<Box<LongCycleWithAnonymousTypes>>>>>>,
     value: uint,
 }
 
@@ -163,7 +164,7 @@ struct LongCycleWithAnonymousTypes {
 fn main() {
     let stack_unique: UniqueNode<u16> = UniqueNode {
         next: Val {
-            val: ~UniqueNode {
+            val: box UniqueNode {
                 next: Empty,
                 value: 1_u16,
             }
@@ -171,9 +172,9 @@ fn main() {
         value: 0_u16,
     };
 
-    let unique_unique: ~UniqueNode<u32> = ~UniqueNode {
+    let unique_unique: Box<UniqueNode<u32>> = box UniqueNode {
         next: Val {
-            val: ~UniqueNode {
+            val: box UniqueNode {
                 next: Empty,
                 value: 3,
             }
@@ -183,7 +184,7 @@ fn main() {
 
     let box_unique: @UniqueNode<u64> = @UniqueNode {
         next: Val {
-            val: ~UniqueNode {
+            val: box UniqueNode {
                 next: Empty,
                 value: 5,
             }
@@ -193,7 +194,7 @@ fn main() {
 
     let vec_unique: [UniqueNode<f32>, ..1] = [UniqueNode {
         next: Val {
-            val: ~UniqueNode {
+            val: box UniqueNode {
                 next: Empty,
                 value: 7.5,
             }
@@ -203,7 +204,7 @@ fn main() {
 
     let borrowed_unique: &UniqueNode<f64> = &UniqueNode {
         next: Val {
-            val: ~UniqueNode {
+            val: box UniqueNode {
                 next: Empty,
                 value: 9.5,
             }
@@ -221,7 +222,7 @@ fn main() {
         value: 10,
     };
 
-    let unique_managed: ~ManagedNode<u32> = ~ManagedNode {
+    let unique_managed: Box<ManagedNode<u32>> = box ManagedNode {
         next: Val {
             val: @ManagedNode {
                 next: Empty,
@@ -263,9 +264,9 @@ fn main() {
 
     // LONG CYCLE
     let long_cycle1: LongCycle1<u16> = LongCycle1 {
-        next: ~LongCycle2 {
-            next: ~LongCycle3 {
-                next: ~LongCycle4 {
+        next: box LongCycle2 {
+            next: box LongCycle3 {
+                next: box LongCycle4 {
                     next: None,
                     value: 23,
                 },
@@ -277,8 +278,8 @@ fn main() {
     };
 
     let long_cycle2: LongCycle2<u32> = LongCycle2 {
-        next: ~LongCycle3 {
-            next: ~LongCycle4 {
+        next: box LongCycle3 {
+            next: box LongCycle4 {
                 next: None,
                 value: 26,
             },
@@ -288,7 +289,7 @@ fn main() {
     };
 
     let long_cycle3: LongCycle3<u64> = LongCycle3 {
-        next: ~LongCycle4 {
+        next: box LongCycle4 {
             next: None,
             value: 28,
         },
@@ -301,10 +302,10 @@ fn main() {
     };
 
     // It's important that LongCycleWithAnonymousTypes is encountered only at the end of the
-    // `~` chain.
-    let long_cycle_w_anonymous_types = ~~~~~LongCycleWithAnonymousTypes {
+    // `box` chain.
+    let long_cycle_w_anonymous_types = box box box box box LongCycleWithAnonymousTypes {
         next: Val {
-            val: ~~~~~LongCycleWithAnonymousTypes {
+            val: box box box box box LongCycleWithAnonymousTypes {
                 next: Empty,
                 value: 31,
             }