Skip to content

Commit f80c8d5

Browse files
committed
---
yaml --- r: 42850 b: refs/heads/try c: 72454f4 h: refs/heads/master v: v3
1 parent 87a941f commit f80c8d5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: 7b268e83167a9dc914dfea9ec4d0448cce8ee6e2
5+
refs/heads/try: 72454f401e3547468819f4dfb67d23f4056aefe1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/doc/tutorial-borrowed-ptr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Suppose we wanted to write a procedure that computed the distance between any
5050
two points, no matter where they were stored. For example, we might like to
5151
compute the distance between `on_the_stack` and `shared_box`, or between
5252
`shared_box` and `unique_box`. One option is to define a function that takes
53-
two arguments of type `Point`—that is, it takes the points by value. But we
53+
two arguments of type `Point`—that is, it takes the points by value. But if we
5454
define it this way, calling the function will cause the points to be
5555
copied. For points, this is probably not so bad, but often copies are
5656
expensive. Worse, if the data type contains mutable fields, copying can change

branches/try/src/libcore/vec.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,10 @@ pub fn remove<T>(v: &mut ~[T], i: uint) -> T {
541541
v.pop()
542542
}
543543

544-
pub fn consume<T>(mut v: ~[T], f: fn(uint, v: T)) {
544+
pub fn consume<T>(v: ~[T], f: fn(uint, v: T)) {
545545
unsafe {
546+
let mut v = v; // FIXME(#3488)
547+
546548
do as_mut_buf(v) |p, ln| {
547549
for uint::range(0, ln) |i| {
548550
// NB: This unsafe operation counts on init writing 0s to the
@@ -639,7 +641,8 @@ pub fn push_all<T: Copy>(v: &mut ~[T], rhs: &[const T]) {
639641
}
640642

641643
#[inline(always)]
642-
pub fn push_all_move<T>(v: &mut ~[T], mut rhs: ~[T]) {
644+
pub fn push_all_move<T>(v: &mut ~[T], rhs: ~[T]) {
645+
let mut rhs = rhs; // FIXME(#3488)
643646
reserve(&mut *v, v.len() + rhs.len());
644647
unsafe {
645648
do as_mut_buf(rhs) |p, len| {
@@ -1238,7 +1241,8 @@ pub pure fn zip_slice<T: Copy, U: Copy>(v: &[const T], u: &[const U])
12381241
* Returns a vector of tuples, where the i-th tuple contains contains the
12391242
* i-th elements from each of the input vectors.
12401243
*/
1241-
pub pure fn zip<T, U>(mut v: ~[T], mut u: ~[U]) -> ~[(T, U)] {
1244+
pub pure fn zip<T, U>(v: ~[T], u: ~[U]) -> ~[(T, U)] {
1245+
let mut v = v, u = u; // FIXME(#3488)
12421246
let mut i = len(v);
12431247
assert i == len(u);
12441248
let mut w = with_capacity(i);

0 commit comments

Comments
 (0)