diff options
| author | bors <bors@rust-lang.org> | 2014-01-14 12:32:11 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-14 12:32:11 -0800 |
| commit | 9075025c7b48ffc028b3bddbb983ceac98ce9636 (patch) | |
| tree | e3e7c8832f1d8ecf7700665f91b2938e8bcb01b6 /src/libstd | |
| parent | b77a7e76a18f0d2237813428425c80bf78faf772 (diff) | |
| parent | 509fc92a9bb6f9a251308476ebf4e76795df60bf (diff) | |
| download | rust-9075025c7b48ffc028b3bddbb983ceac98ce9636.tar.gz rust-9075025c7b48ffc028b3bddbb983ceac98ce9636.zip | |
auto merge of #11485 : eddyb/rust/sweep-old-rust, r=nikomatsakis
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/extensions.rs | 6 | ||||
| -rw-r--r-- | src/libstd/local_data.rs | 3 | ||||
| -rw-r--r-- | src/libstd/vec.rs | 7 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs index 066dc883597..4e6f64a31e6 100644 --- a/src/libstd/io/extensions.rs +++ b/src/libstd/io/extensions.rs @@ -370,13 +370,13 @@ mod test { count: 0, }; // FIXME (#7049): Figure out some other way to do this. - //let buf = @mut ~[8, 9]; + //let buf = RefCell::new(~[8, 9]); (|| { - //reader.push_bytes(&mut *buf, 4); + //reader.push_bytes(buf.borrow_mut().get(), 4); }).finally(|| { // NB: Using rtassert here to trigger abort on failure since this is a should_fail test // FIXME: #7049 This fails because buf is still borrowed - //rtassert!(*buf == ~[8, 9, 10]); + //rtassert!(buf.borrow().get() == ~[8, 9, 10]); }) } diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 95fdce99ea6..159337bf503 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -187,8 +187,7 @@ pub fn get<T: 'static, U>(key: Key<T>, f: |Option<&T>| -> U) -> U { /// if the key provided is not present in TLS currently. /// /// It is considered a runtime error to attempt to get a value which is already -/// on loan via this or the `get` methods. This is similar to how it's a runtime -/// error to take two mutable loans on an `@mut` box. +/// on loan via this or the `get` methods. pub fn get_mut<T: 'static, U>(key: Key<T>, f: |Option<&mut T>| -> U) -> U { get_with(key, MutLoan, |x| { match x { diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 257a1e6340f..61e78b68adc 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -1837,11 +1837,8 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] { fn dedup(&mut self) { unsafe { // Although we have a mutable reference to `self`, we cannot make - // *arbitrary* changes. There exists the possibility that this - // vector is contained with an `@mut` box and hence is still - // readable by the outside world during the `Eq` comparisons. - // Moreover, those comparisons could fail, so we must ensure - // that the vector is in a valid state at all time. + // *arbitrary* changes. The `Eq` comparisons could fail, so we + // must ensure that the vector is in a valid state at all time. // // The way that we handle this is by using swaps; we iterate // over all the elements, swapping as we go so that at the end |
