@@ -1235,8 +1235,9 @@ xs = prepend::<int>(xs, 15);
1235
1235
xs = prepend::<int>(xs, 20);
1236
1236
~~~
1237
1237
1238
- In the type grammar, the language uses ` Type<T, U, V> ` to describe a list of
1239
- type parameters, but expressions use ` identifier::<T, U, V> ` .
1238
+ In declarations, the language uses ` Type<T, U, V> ` to describe a list of type
1239
+ parameters, but expressions use ` identifier::<T, U, V> ` , to disambiguate the
1240
+ ` < ` operator.
1240
1241
1241
1242
## Defining list equality with generics
1242
1243
@@ -1313,7 +1314,7 @@ provide.
1313
1314
1314
1315
In uncommon cases, the indirection can provide a performance gain or memory
1315
1316
reduction by making values smaller. However, unboxed values should almost
1316
- always be preferred.
1317
+ always be preferred when they are usable .
1317
1318
1318
1319
Note that returning large unboxed values via boxes is unnecessary. A large
1319
1320
value is returned via a hidden output parameter, and the decision on where to
@@ -1324,7 +1325,7 @@ fn foo() -> (u64, u64, u64, u64, u64, u64) {
1324
1325
(5, 5, 5, 5, 5, 5)
1325
1326
}
1326
1327
1327
- let x = ~foo(); // allocates, and writes the integers directly to it
1328
+ let x = ~foo(); // allocates a ~ box , and writes the integers directly to it
1328
1329
~~~~
1329
1330
1330
1331
Beyond the properties granted by the size, an owned box behaves as a regular
@@ -1403,7 +1404,7 @@ compute_distance(managed_box, owned_box);
1403
1404
Here the `&` operator is used to take the address of the variable
1404
1405
`on_the_stack`; this is because `on_the_stack` has the type `Point`
1405
1406
(that is, a struct value) and we have to take its address to get a
1406
- value . We also call this _borrowing_ the local variable
1407
+ reference . We also call this _borrowing_ the local variable
1407
1408
`on_the_stack`, because we are creating an alias: that is, another
1408
1409
route to the same data.
1409
1410
0 commit comments