Skip to content

Commit 2c8a418

Browse files
committed
---
yaml --- r: 234999 b: refs/heads/stable c: b1907a0 h: refs/heads/master i: 234997: 3784363 234995: f08679e 234991: db45d97 v: v3
1 parent 25dbee6 commit 2c8a418

File tree

24 files changed

+352
-417
lines changed

24 files changed

+352
-417
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 080d5b74ddcb09410830bbf7b3545b6206075477
32+
refs/heads/stable: b1907a04e44d49008e5b25341fb509541fe18ea8
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
% The Rust Pointer Guide
1+
% The (old) Rust Pointer Guide
22

3-
This content has been removed, with no direct replacement. Rust only
4-
has two built-in pointer types now,
5-
[references](book/references-and-borrowing.html) and [raw
6-
pointers](book/raw-pointers.html). Older Rusts had many more pointer
7-
types, they’re gone now.
3+
This content has moved into
4+
[the Rust Programming Language book](book/pointers.html).

branches/stable/src/doc/trpl/academic-research.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Recommended for inspiration and a better understanding of Rust's background.
1212
* [Macros that work together](https://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf)
1313
* [Traits: composable units of behavior](http://scg.unibe.ch/archive/papers/Scha03aTraits.pdf)
1414
* [Alias burying](http://www.cs.uwm.edu/faculty/boyland/papers/unique-preprint.ps) - We tried something similar and abandoned it.
15-
* [External uniqueness is unique enough](http://www.computingscience.nl/research/techreps/repo/CS-2002/2002-048.pdf)
15+
* [External uniqueness is unique enough](http://www.cs.uu.nl/research/techreps/UU-CS-2002-048.html)
1616
* [Uniqueness and Reference Immutability for Safe Parallelism](https://research.microsoft.com/pubs/170528/msr-tr-2012-79.pdf)
1717
* [Region Based Memory Management](http://www.cs.ucla.edu/~palsberg/tba/papers/tofte-talpin-iandc97.pdf)
1818

@@ -26,10 +26,10 @@ Recommended for inspiration and a better understanding of Rust's background.
2626
* [Dynamic circular work stealing deque](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1097&rep=rep1&type=pdf) - The Chase/Lev deque
2727
* [Work-first and help-first scheduling policies for async-finish task parallelism](http://www.cs.rice.edu/%7Eyguo/pubs/PID824943.pdf) - More general than fully-strict work stealing
2828
* [A Java fork/join calamity](http://www.coopsoft.com/ar/CalamityArticle.html) - critique of Java's fork/join library, particularly its application of work stealing to non-strict computation
29-
* [Scheduling techniques for concurrent systems](http://www.ece.rutgers.edu/%7Eparashar/Classes/ece572-papers/05/ps-ousterhout.pdf)
29+
* [Scheduling techniques for concurrent systems](http://www.stanford.edu/~ouster/cgi-bin/papers/coscheduling.pdf)
3030
* [Contention aware scheduling](http://www.blagodurov.net/files/a8-blagodurov.pdf)
3131
* [Balanced work stealing for time-sharing multicores](http://www.cse.ohio-state.edu/hpcs/WWW/HTML/publications/papers/TR-12-1.pdf)
32-
* [Three layer cake](http://www.upcrc.illinois.edu/workshops/paraplop10/papers/paraplop10_submission_8.pdf)
32+
* [Three layer cake for shared-memory programming](http://dl.acm.org/citation.cfm?id=1953616&dl=ACM&coll=DL&CFID=524387192&CFTOKEN=44362705)
3333
* [Non-blocking steal-half work queues](http://www.cs.bgu.ac.il/%7Ehendlerd/papers/p280-hendler.pdf)
3434
* [Reagents: expressing and composing fine-grained concurrency](http://www.mpi-sws.org/~turon/reagents.pdf)
3535
* [Algorithms for scalable synchronization of shared-memory multiprocessors](https://www.cs.rochester.edu/u/scott/papers/1991_TOCS_synch.pdf)

branches/stable/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/stable/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 `current` value.
275+
/// Stores a value into the bool if the current value is the same as the expected value.
276276
///
277-
/// The return value is always the previous value. If it is equal to `current`, then the value
278-
/// was updated.
277+
/// The return value is always the previous value. If it is equal to `old`, then the value was
278+
/// updated.
279279
///
280-
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
281-
/// this operation.
280+
/// `swap` also takes an `Ordering` argument which describes the memory ordering of this
281+
/// 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, current: bool, new: bool, order: Ordering) -> bool {
299-
let current = if current { UINT_TRUE } else { 0 };
298+
pub fn compare_and_swap(&self, old: bool, new: bool, order: Ordering) -> bool {
299+
let old = if old { UINT_TRUE } else { 0 };
300300
let new = if new { UINT_TRUE } else { 0 };
301301

302-
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) > 0 }
302+
unsafe { atomic_compare_and_swap(self.v.get(), old, 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 `current` value.
518+
/// Stores a value into the isize if the current value is the same as the expected value.
519519
///
520-
/// The return value is always the previous value. If it is equal to `current`, then the value
521-
/// was updated.
520+
/// The return value is always the previous value. If it is equal to `old`, then the value was
521+
/// 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, current: isize, new: isize, order: Ordering) -> isize {
542-
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) }
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) }
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 `current` value.
712+
/// Stores a value into the usize if the current value is the same as the expected value.
713713
///
714-
/// The return value is always the previous value. If it is equal to `current`, then the value
715-
/// was updated.
714+
/// The return value is always the previous value. If it is equal to `old`, then the value was
715+
/// 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, current: usize, new: usize, order: Ordering) -> usize {
736-
unsafe { atomic_compare_and_swap(self.v.get(), current, new, order) }
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) }
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 `current` value.
913+
/// Stores a value into the pointer if the current value is the same as the expected value.
914914
///
915-
/// The return value is always the previous value. If it is equal to `current`, then the value
916-
/// was updated.
915+
/// The return value is always the previous value. If it is equal to `old`, then the value was
916+
/// 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, current: *mut T, new: *mut T, order: Ordering) -> *mut T {
936+
pub fn compare_and_swap(&self, old: *mut T, new: *mut T, order: Ordering) -> *mut T {
937937
unsafe {
938-
atomic_compare_and_swap(self.p.get() as *mut usize, current as usize,
938+
atomic_compare_and_swap(self.p.get() as *mut usize, old as usize,
939939
new as usize, order) as *mut T
940940
}
941941
}

branches/stable/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.

branches/stable/src/librustc/middle/infer/higher_ranked/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ fn fold_regions_in<'tcx, T, F>(tcx: &ty::ctxt<'tcx>,
359359
where T: TypeFoldable<'tcx>,
360360
F: FnMut(ty::Region, ty::DebruijnIndex) -> ty::Region,
361361
{
362-
ty_fold::fold_regions(tcx, unbound_value, &mut false, |region, current_depth| {
362+
unbound_value.fold_with(&mut ty_fold::RegionFolder::new(tcx, &mut |region, current_depth| {
363363
// we should only be encountering "escaping" late-bound regions here,
364364
// because the ones at the current level should have been replaced
365365
// with fresh variables
@@ -369,7 +369,7 @@ fn fold_regions_in<'tcx, T, F>(tcx: &ty::ctxt<'tcx>,
369369
});
370370

371371
fldr(region, ty::DebruijnIndex::new(current_depth))
372-
})
372+
}))
373373
}
374374

375375
impl<'a,'tcx> InferCtxtExt for InferCtxt<'a,'tcx> {
@@ -437,10 +437,11 @@ impl<'a,'tcx> InferCtxtExt for InferCtxt<'a,'tcx> {
437437
let escaping_types =
438438
self.type_variables.borrow().types_escaping_snapshot(&snapshot.type_snapshot);
439439

440-
let mut escaping_region_vars = FnvHashSet();
441-
for ty in &escaping_types {
442-
ty_fold::collect_regions(self.tcx, ty, &mut escaping_region_vars);
443-
}
440+
let escaping_region_vars: FnvHashSet<_> =
441+
escaping_types
442+
.iter()
443+
.flat_map(|&t| ty_fold::collect_regions(self.tcx, &t))
444+
.collect();
444445

445446
region_vars.retain(|&region_vid| {
446447
let r = ty::ReInfer(ty::ReVar(region_vid));
@@ -648,7 +649,7 @@ pub fn plug_leaks<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
648649
// binder is that we encountered in `value`. The caller is
649650
// responsible for ensuring that (a) `value` contains at least one
650651
// binder and (b) that binder is the one we want to use.
651-
let result = ty_fold::fold_regions(infcx.tcx, &value, &mut false, |r, current_depth| {
652+
let result = ty_fold::fold_regions(infcx.tcx, &value, |r, current_depth| {
652653
match inv_skol_map.get(&r) {
653654
None => r,
654655
Some(br) => {

branches/stable/src/librustc/middle/traits/fulfill.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -421,18 +421,16 @@ fn process_predicate<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
421421
// regions. If there are, we will call this obligation an
422422
// error. Eventually we should be able to support some
423423
// cases here, I imagine (e.g., `for<'a> int : 'a`).
424-
match selcx.tcx().no_late_bound_regions(binder) {
425-
None => {
426-
errors.push(
427-
FulfillmentError::new(
428-
obligation.clone(),
429-
CodeSelectionError(Unimplemented)))
430-
}
431-
Some(ty::OutlivesPredicate(t_a, r_b)) => {
432-
register_region_obligation(t_a, r_b,
433-
obligation.cause.clone(),
434-
region_obligations);
435-
}
424+
if selcx.tcx().count_late_bound_regions(binder) != 0 {
425+
errors.push(
426+
FulfillmentError::new(
427+
obligation.clone(),
428+
CodeSelectionError(Unimplemented)));
429+
} else {
430+
let ty::OutlivesPredicate(t_a, r_b) = binder.0;
431+
register_region_obligation(t_a, r_b,
432+
obligation.cause.clone(),
433+
region_obligations);
436434
}
437435
true
438436
}
@@ -503,3 +501,5 @@ impl<'tcx> FulfilledPredicates<'tcx> {
503501
!self.set.insert(p.clone())
504502
}
505503
}
504+
505+

0 commit comments

Comments
 (0)