@@ -186,7 +186,7 @@ enum List<T> {
186186 Nil ,
187187 Cons (T , ~List <T >),
188188}
189-
189+
190190fn main () {
191191 let list : List <int > = Cons (1 , ~Cons (2 , ~Cons (3 , ~Nil )));
192192 println! (" {:?}" , list );
@@ -251,7 +251,7 @@ struct.
251251
252252> ** Note** : the ` @ ` form of managed pointers is deprecated and behind a
253253> feature gate (it requires a ` #![feature(managed_pointers)] ` attribute on
254- > the crate root; remember the semicolon! ). There are replacements, currently
254+ > the crate root). There are replacements, currently
255255> there is ` std::rc::Rc ` and ` std::gc::Gc ` for shared ownership via reference
256256> counting and garbage collection respectively.
257257
@@ -266,7 +266,7 @@ struct Point {
266266 x: int,
267267 y: int,
268268}
269-
269+
270270fn main() {
271271 let a = ~Point { x: 10, y: 20 };
272272 let b = a;
@@ -297,7 +297,7 @@ struct Point {
297297 x : int ,
298298 y : int ,
299299}
300-
300+
301301fn main () {
302302 let a = @ Point { x : 10 , y : 20 };
303303 let b = a ;
@@ -361,7 +361,7 @@ So how is this hard? Well, because we're ignoring ownership, the compiler needs
361361to take great care to make sure that everything is safe. Despite their complete
362362safety, a reference's representation at runtime is the same as that of
363363an ordinary pointer in a C program. They introduce zero overhead. The compiler
364- does all safety checks at compile time.
364+ does all safety checks at compile time.
365365
366366This theory is called 'region pointers,' and involve a concept called
367367'lifetimes'. Here's the simple explanation: would you expect this code to
@@ -477,7 +477,7 @@ fn main() {
477477You may think that this gives us terrible performance: return a value and then
478478immediately box it up?!?! Isn't that the worst of both worlds? Rust is smarter
479479than that. There is no copy in this code. ` main ` allocates enough room for the
480- ` @int ` , passes a pointer to that memory into ` foo ` as ` x ` , and then ` foo ` writes
480+ ` @int ` , passes a pointer to that memory into ` foo ` as ` x ` , and then ` foo ` writes
481481the value straight into that pointer. This writes the return value directly into
482482the allocated box.
483483
0 commit comments