Skip to content

Commit 1468e4b

Browse files
committed
---
yaml --- r: 227911 b: refs/heads/try c: 08b2166 h: refs/heads/master i: 227909: 3641203 227907: ab1a89f 227903: f0bf1d3 v: v3
1 parent 37c4c9f commit 1468e4b

File tree

4 files changed

+25
-31
lines changed

4 files changed

+25
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: f9b6929f4603950dafafa66c67df4cd37ed0b364
4+
refs/heads/try: 08b21661c3131297c021768134d4637d62c12dcb
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/doc/trpl/references-and-borrowing.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,7 @@ In other words, `y` is only valid for the scope where `x` exists. As soon as
336336
the borrow ‘doesn’t live long enough’ because it’s not valid for the right
337337
amount of time.
338338

339-
The same problem occurs when the reference is declared _before_ the variable it
340-
refers to. This is because resources within the same scope are freed in the
341-
opposite order they were declared:
339+
The same problem occurs when the reference is declared _before_ the variable it refers to:
342340

343341
```rust,ignore
344342
let y: &i32;
@@ -371,6 +369,3 @@ statement 1 at 3:14
371369
println!("{}", y);
372370
}
373371
```
374-
375-
In the above example, `y` is declared before `x`, meaning that `y` lives longer
376-
than `x`, which is not allowed.

branches/try/src/libcore/atomic.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ impl AtomicBool {
272272
unsafe { atomic_swap(self.v.get(), val, order) > 0 }
273273
}
274274

275-
/// Stores a value into the bool if the current value is the same as the expected value.
275+
/// Stores a value into the `bool` if the current value is the same as the `current` value.
276276
///
277-
/// The return value is always the previous value. If it is equal to `old`, then the value was
278-
/// updated.
277+
/// The return value is always the previous value. If it is equal to `current`, then the value
278+
/// was updated.
279279
///
280-
/// `swap` also takes an `Ordering` argument which describes the memory ordering of this
281-
/// operation.
280+
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
281+
/// this operation.
282282
///
283283
/// # Examples
284284
///
@@ -295,11 +295,11 @@ impl AtomicBool {
295295
/// ```
296296
#[inline]
297297
#[stable(feature = "rust1", since = "1.0.0")]
298-
pub fn compare_and_swap(&self, old: bool, new: bool, order: Ordering) -> bool {
299-
let old = if old { UINT_TRUE } else { 0 };
298+
pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool {
299+
let current = if current { UINT_TRUE } else { 0 };
300300
let new = if new { UINT_TRUE } else { 0 };
301301

302-
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) > 0 }
302+
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) > 0 }
303303
}
304304

305305
/// Logical "and" with a boolean value.
@@ -515,10 +515,10 @@ impl AtomicIsize {
515515
unsafe { atomic_swap(self.v.get(), val, order) }
516516
}
517517

518-
/// Stores a value into the isize if the current value is the same as the expected value.
518+
/// Stores a value into the `isize` if the current value is the same as the `current` value.
519519
///
520-
/// The return value is always the previous value. If it is equal to `old`, then the value was
521-
/// updated.
520+
/// The return value is always the previous value. If it is equal to `current`, then the value
521+
/// was updated.
522522
///
523523
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
524524
/// this operation.
@@ -538,8 +538,8 @@ impl AtomicIsize {
538538
/// ```
539539
#[inline]
540540
#[stable(feature = "rust1", since = "1.0.0")]
541-
pub fn compare_and_swap(&self, old: isize, new: isize, order: Ordering) -> isize {
542-
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
541+
pub fn compare_and_swap(&self, current: isize, new: isize, order: Ordering) -> isize {
542+
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) }
543543
}
544544

545545
/// Add an isize to the current value, returning the previous value.
@@ -709,10 +709,10 @@ impl AtomicUsize {
709709
unsafe { atomic_swap(self.v.get(), val, order) }
710710
}
711711

712-
/// Stores a value into the usize if the current value is the same as the expected value.
712+
/// Stores a value into the `usize` if the current value is the same as the `current` value.
713713
///
714-
/// The return value is always the previous value. If it is equal to `old`, then the value was
715-
/// updated.
714+
/// The return value is always the previous value. If it is equal to `current`, then the value
715+
/// was updated.
716716
///
717717
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
718718
/// this operation.
@@ -732,8 +732,8 @@ impl AtomicUsize {
732732
/// ```
733733
#[inline]
734734
#[stable(feature = "rust1", since = "1.0.0")]
735-
pub fn compare_and_swap(&self, old: usize, new: usize, order: Ordering) -> usize {
736-
unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
735+
pub fn compare_and_swap(&self, current: usize, new: usize, order: Ordering) -> usize {
736+
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) }
737737
}
738738

739739
/// Add to the current usize, returning the previous value.
@@ -910,10 +910,10 @@ impl<T> AtomicPtr<T> {
910910
unsafe { atomic_swap(self.p.get() as *mut usize, ptr as usize, order) as *mut T }
911911
}
912912

913-
/// Stores a value into the pointer if the current value is the same as the expected value.
913+
/// Stores a value into the pointer if the current value is the same as the `current` value.
914914
///
915-
/// The return value is always the previous value. If it is equal to `old`, then the value was
916-
/// updated.
915+
/// The return value is always the previous value. If it is equal to `current`, then the value
916+
/// was updated.
917917
///
918918
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
919919
/// this operation.
@@ -933,9 +933,9 @@ impl<T> AtomicPtr<T> {
933933
/// ```
934934
#[inline]
935935
#[stable(feature = "rust1", since = "1.0.0")]
936-
pub fn compare_and_swap(&self, old: *mut T, new: *mut T, order: Ordering) -> *mut T {
936+
pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) -> *mut T {
937937
unsafe {
938-
atomic_compare_and_swap(self.p.get() as *mut usize, old as usize,
938+
atomic_compare_and_swap(self.p.get() as *mut usize, current as usize,
939939
new as usize, order) as *mut T
940940
}
941941
}

branches/try/src/librand/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ pub mod reseeding;
6666
mod rand_impls;
6767

6868
/// A type that can be randomly generated using an `Rng`.
69-
#[doc(hidden)]
7069
pub trait Rand : Sized {
7170
/// Generates a random instance of this type using the specified source of
7271
/// randomness.

0 commit comments

Comments
 (0)