@@ -1588,7 +1588,6 @@ pointer values (pointing to a type for which an implementation of the given
1588
1588
trait is in scope) to pointers to the trait name, used as a type.
1589
1589
1590
1590
```
1591
- # use std::boxed::Box;
1592
1591
# trait Shape { }
1593
1592
# impl Shape for int { }
1594
1593
# let mycircle = 0i;
@@ -1647,7 +1646,6 @@ fn radius_times_area<T: Circle>(c: T) -> f64 {
1647
1646
Likewise, supertrait methods may also be called on trait objects.
1648
1647
1649
1648
``` {.ignore}
1650
- # use std::boxed::Box;
1651
1649
# trait Shape { fn area(&self) -> f64; }
1652
1650
# trait Circle : Shape { fn radius(&self) -> f64; }
1653
1651
# impl Shape for int { fn area(&self) -> f64 { 0.0 } }
@@ -3792,7 +3790,6 @@ enclosing `enum` or `struct` type itself. Such recursion has restrictions:
3792
3790
An example of a * recursive* type and its use:
3793
3791
3794
3792
```
3795
- # use std::boxed::Box;
3796
3793
enum List<T> {
3797
3794
Nil,
3798
3795
Cons(T, Box<List<T>>)
@@ -3905,7 +3902,6 @@ implementation of `R`, and the pointer value of `E`.
3905
3902
An example of an object type:
3906
3903
3907
3904
```
3908
- # use std::boxed::Box;
3909
3905
trait Printable {
3910
3906
fn stringify(&self) -> String;
3911
3907
}
@@ -4113,7 +4109,6 @@ the type of a box is `std::owned::Box<T>`.
4113
4109
An example of a box type and value:
4114
4110
4115
4111
```
4116
- # use std::boxed::Box;
4117
4112
let x: Box<int> = Box::new(10);
4118
4113
```
4119
4114
@@ -4123,7 +4118,6 @@ copy of a box to move ownership of the value. After a value has been moved,
4123
4118
the source location cannot be used unless it is reinitialized.
4124
4119
4125
4120
```
4126
- # use std::boxed::Box;
4127
4121
let x: Box<int> = Box::new(10);
4128
4122
let y = x;
4129
4123
// attempting to use `x` will result in an error here
0 commit comments