Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
aa40c02
Unstable Book: add links to tracking issues for FFI features
ArekPiekarz Aug 26, 2020
f03d0b3
`impl Rc::new_cyclic`
mental32 Aug 27, 2020
42fb270
typo
mental32 Aug 29, 2020
bb5e79c
Link vec doc to & reference
pickfire Aug 29, 2020
20a6866
Try removing [prim@reference]
pickfire Aug 30, 2020
81e85ce
Move to Arc::clone(&x) over x.clone() in library/std
poliorcetics Aug 30, 2020
6b75e3d
Move to Arc::clone(&x) over x.clone() in library/core
poliorcetics Aug 30, 2020
0f301e8
Removed [inline] and copied over comments from Arc::new_cyclic
mental32 Sep 1, 2020
8783c62
Add missing link in README
camelid Sep 2, 2020
3e29fdb
Remove a number of vec UI tests, make them unit tests in the alloc li…
CraftSpider Sep 3, 2020
791f93c
Allow try blocks as the argument to return expressions
scottmcm Sep 3, 2020
4231fbc
Condense StringReader's API to a single function
matklad Sep 3, 2020
4df6490
Link & primitive using relative link
pickfire Sep 3, 2020
ccf41dd
Rename IsJoint -> Spacing
matklad Sep 3, 2020
c6ab3ff
Add test for checking if-let or-patterns
JulianKnodt Aug 16, 2020
2278c72
Remove vec-to_str.rs, merge the remaining test in with vec
CraftSpider Sep 3, 2020
a2e077e
Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`
CDirkx Sep 3, 2020
8c93125
Address review comments on `Peekable::next_if`
jyn514 Sep 3, 2020
7b823df
Link to `#capacity-and-reallocation` when using with_capacity
jyn514 Sep 3, 2020
538e198
Move various ui const tests to `library`
CDirkx Sep 4, 2020
85146b9
Add slice primitive link to vec
pickfire Sep 4, 2020
4dd8ebd
Rollup merge of #75580 - JulianKnodt:or_pattern, r=wesleywiser
matklad Sep 4, 2020
ba2e0ed
Rollup merge of #75954 - ArekPiekarz:unstable_book_ffi_tracking_issue…
matklad Sep 4, 2020
5886e94
Rollup merge of #75994 - mental32:impl-rc-new-cyclic, r=KodrAus
matklad Sep 4, 2020
30a4742
Rollup merge of #76060 - pickfire:patch-12, r=jyn514
matklad Sep 4, 2020
99ce4da
Rollup merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAus
matklad Sep 4, 2020
7ab6e80
Rollup merge of #76229 - camelid:patch-3, r=jonas-schievink
matklad Sep 4, 2020
b4e784b
Rollup merge of #76273 - CraftSpider:master, r=matklad
matklad Sep 4, 2020
8aa90a3
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
matklad Sep 4, 2020
8e70471
Rollup merge of #76291 - matklad:spacing, r=petrochenkov
matklad Sep 4, 2020
61a381e
Rollup merge of #76299 - CDirkx:ip-tests, r=matklad
matklad Sep 4, 2020
3b3b5a8
Rollup merge of #76302 - jyn514:peekable-2, r=Dylan-DPC
matklad Sep 4, 2020
e819fdf
Rollup merge of #76303 - jyn514:vec-assert-doc, r=Dylan-DPC
matklad Sep 4, 2020
1320c1a
Rollup merge of #76305 - CDirkx:const-tests, r=matklad
matklad Sep 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move to Arc::clone(&x) over x.clone() in library/std
  • Loading branch information
poliorcetics committed Aug 30, 2020
commit 81e85ce76d6630a8f87f81df2470e76fbe73de7d
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2381,15 +2381,15 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
/// use std::rc::Rc;
///
/// let mut map: HashMap<Rc<String>, u32> = HashMap::new();
/// let mut known_strings: Vec<Rc<String>> = Vec::new();
/// let known_strings: Vec<Rc<String>> = Vec::new();
///
/// // Initialise known strings, run program, etc.
///
/// reclaim_memory(&mut map, &known_strings);
///
/// fn reclaim_memory(map: &mut HashMap<Rc<String>, u32>, known_strings: &[Rc<String>] ) {
/// for s in known_strings {
/// if let Entry::Occupied(entry) = map.entry(s.clone()) {
/// if let Entry::Occupied(entry) = map.entry(Rc::clone(s)) {
/// // Replaces the entry's key with our version of it in `known_strings`.
/// entry.replace_key();
/// }
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sync/barrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::sync::{Condvar, Mutex};
/// let mut handles = Vec::with_capacity(10);
/// let barrier = Arc::new(Barrier::new(10));
/// for _ in 0..10 {
/// let c = barrier.clone();
/// let c = Arc::clone(&barrier);
/// // The same messages will be printed together.
/// // You will NOT see any interleaving.
/// handles.push(thread::spawn(move|| {
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Barrier {
/// let mut handles = Vec::with_capacity(10);
/// let barrier = Arc::new(Barrier::new(10));
/// for _ in 0..10 {
/// let c = barrier.clone();
/// let c = Arc::clone(&barrier);
/// // The same messages will be printed together.
/// // You will NOT see any interleaving.
/// handles.push(thread::spawn(move|| {
Expand Down
18 changes: 9 additions & 9 deletions library/std/src/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl WaitTimeoutResult {
/// use std::time::Duration;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move || {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -90,7 +90,7 @@ impl WaitTimeoutResult {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// // Inside of our lock, spawn a new thread, and then wait for it to start.
/// thread::spawn(move|| {
Expand Down Expand Up @@ -173,7 +173,7 @@ impl Condvar {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -229,7 +229,7 @@ impl Condvar {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(true), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -288,7 +288,7 @@ impl Condvar {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -360,7 +360,7 @@ impl Condvar {
/// use std::time::Duration;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -429,7 +429,7 @@ impl Condvar {
/// use std::time::Duration;
///
/// let pair = Arc::new((Mutex::new(true), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -493,7 +493,7 @@ impl Condvar {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down Expand Up @@ -533,7 +533,7 @@ impl Condvar {
/// use std::thread;
///
/// let pair = Arc::new((Mutex::new(false), Condvar::new()));
/// let pair2 = pair.clone();
/// let pair2 = Arc::clone(&pair);
///
/// thread::spawn(move|| {
/// let (lock, cvar) = &*pair2;
Expand Down
8 changes: 4 additions & 4 deletions library/std/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ use crate::sys_common::poison::{self, LockResult, TryLockError, TryLockResult};
/// use std::thread;
///
/// let lock = Arc::new(Mutex::new(0_u32));
/// let lock2 = lock.clone();
/// let lock2 = Arc::clone(&lock);
///
/// let _ = thread::spawn(move || -> () {
/// // This thread will acquire the mutex first, unwrapping the result of
Expand Down Expand Up @@ -256,7 +256,7 @@ impl<T: ?Sized> Mutex<T> {
/// use std::thread;
///
/// let mutex = Arc::new(Mutex::new(0));
/// let c_mutex = mutex.clone();
/// let c_mutex = Arc::clone(&mutex);
///
/// thread::spawn(move || {
/// *c_mutex.lock().unwrap() = 10;
Expand Down Expand Up @@ -292,7 +292,7 @@ impl<T: ?Sized> Mutex<T> {
/// use std::thread;
///
/// let mutex = Arc::new(Mutex::new(0));
/// let c_mutex = mutex.clone();
/// let c_mutex = Arc::clone(&mutex);
///
/// thread::spawn(move || {
/// let mut lock = c_mutex.try_lock();
Expand Down Expand Up @@ -328,7 +328,7 @@ impl<T: ?Sized> Mutex<T> {
/// use std::thread;
///
/// let mutex = Arc::new(Mutex::new(0));
/// let c_mutex = mutex.clone();
/// let c_mutex = Arc::clone(&mutex);
///
/// let _ = thread::spawn(move || {
/// let _lock = c_mutex.lock().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<T: ?Sized> RwLock<T> {
/// use std::thread;
///
/// let lock = Arc::new(RwLock::new(1));
/// let c_lock = lock.clone();
/// let c_lock = Arc::clone(&lock);
///
/// let n = lock.read().unwrap();
/// assert_eq!(*n, 1);
Expand Down Expand Up @@ -318,7 +318,7 @@ impl<T: ?Sized> RwLock<T> {
/// use std::thread;
///
/// let lock = Arc::new(RwLock::new(0));
/// let c_lock = lock.clone();
/// let c_lock = Arc::clone(&lock);
///
/// let _ = thread::spawn(move || {
/// let _lock = c_lock.write().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys_common/poison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct Guard {
/// let mutex = Arc::new(Mutex::new(1));
///
/// // poison the mutex
/// let c_mutex = mutex.clone();
/// let c_mutex = Arc::clone(&mutex);
/// let _ = thread::spawn(move || {
/// let mut data = c_mutex.lock().unwrap();
/// *data = 2;
Expand Down Expand Up @@ -168,7 +168,7 @@ impl<T> PoisonError<T> {
/// let mutex = Arc::new(Mutex::new(HashSet::new()));
///
/// // poison the mutex
/// let c_mutex = mutex.clone();
/// let c_mutex = Arc::clone(&mutex);
/// let _ = thread::spawn(move || {
/// let mut data = c_mutex.lock().unwrap();
/// data.insert(10);
Expand Down