Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 13 pull requests #48776

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
238bb38
First version
pvdrz Feb 22, 2018
f9e049a
add info about sync
pvdrz Feb 23, 2018
58d1f83
remove redundant info
pvdrz Feb 23, 2018
43de01f
cleaned trailing whitespaces
pvdrz Feb 23, 2018
5344b07
Add new warning for CStr::from_ptr
GuillaumeGomez Feb 24, 2018
ce3ad26
added link to sync containers
pvdrz Feb 24, 2018
7ded7f7
corrected grammar errors
pvdrz Feb 24, 2018
397ce8a
fixed links
pvdrz Feb 25, 2018
9091584
some grammar corrections
pvdrz Feb 26, 2018
df8dd3f
doc: no need for the references
tshepang Feb 28, 2018
e822e62
Suggest type for overflowing bin/hex-literals
flip1995 Feb 22, 2018
19c4771
Implementing requested changes
flip1995 Feb 22, 2018
5c70619
Rewrite error reporting as requested
flip1995 Feb 24, 2018
f45f760
Adapt stderr of UI test to PR #48449
flip1995 Mar 1, 2018
f7693c0
Fix spelling s/casted/cast/
lukaslueg Feb 21, 2018
15ecf06
Remove isize test
flip1995 Mar 2, 2018
fc33b25
Improve getting literal representation
flip1995 Mar 3, 2018
04da856
Update sccache to its master branch
alexcrichton Mar 1, 2018
0b0e1b7
Refactor contrived match.
leoyvens Mar 4, 2018
1c191b2
Add note for unterminated raw string error
GuillaumeGomez Feb 26, 2018
16ac85c
Remove useless powerpc64 entry from ARCH_TABLE, closes #47737
debris Mar 4, 2018
88f32d1
Remove a couple of `isize` references from hashmap docs
tbu- Mar 5, 2018
2e7e68b
while let all the things
leoyvens Mar 5, 2018
831009f
Add resource-suffix option for rustdoc
GuillaumeGomez Feb 24, 2018
2ec47e0
Remove seemingly unused sugarise-doc-comments Python script.
frewsxcv Mar 6, 2018
a3201a9
Rollup merge of #48403 - lukaslueg:casted, r=steveklabnik
GuillaumeGomez Mar 6, 2018
8c07934
Rollup merge of #48432 - flip1995:lit_diag, r=oli-obk
GuillaumeGomez Mar 6, 2018
4b69bd7
Rollup merge of #48474 - christianpoveda:new_cell_docs, r=steveklabnik
GuillaumeGomez Mar 6, 2018
75bc23d
Rollup merge of #48507 - GuillaumeGomez:cstr-note, r=steveklabnik
GuillaumeGomez Mar 6, 2018
afb617a
Rollup merge of #48511 - GuillaumeGomez:rustdoc-resource-suffix, r=Qu…
GuillaumeGomez Mar 6, 2018
90b38d5
Rollup merge of #48546 - GuillaumeGomez:raw-string-error-note, r=este…
GuillaumeGomez Mar 6, 2018
11b3e72
Rollup merge of #48590 - tshepang:more-simple, r=frewsxcv
GuillaumeGomez Mar 6, 2018
ae76ad0
Rollup merge of #48647 - alexcrichton:update-sccache, r=kennytm
GuillaumeGomez Mar 6, 2018
13a9300
Rollup merge of #48727 - leodasvacas:refactor-contrived-match, r=rkruppe
GuillaumeGomez Mar 6, 2018
64cb871
Rollup merge of #48732 - debris:remove_powerpc64, r=alexcrichton
GuillaumeGomez Mar 6, 2018
c66b57a
Rollup merge of #48753 - tbu-:pr_hashmap_isize, r=BurntSushi
GuillaumeGomez Mar 6, 2018
7a548f5
Rollup merge of #48754 - leodasvacas:while-let-all-the-things, r=rkruppe
GuillaumeGomez Mar 6, 2018
b768548
Rollup merge of #48761 - frewsxcv:frewsxcv-rm-python, r=alexcrichton
GuillaumeGomez Mar 6, 2018
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
Remove a couple of isize references from hashmap docs
Also fix a spelling mistake.
  • Loading branch information
tbu- committed Mar 5, 2018
commit 88f32d15afac7bc5cff5daca7a0ac80fdedb6dce
54 changes: 27 additions & 27 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomState> {
///
/// ```
/// use std::collections::HashMap;
/// let mut map: HashMap<&str, isize> = HashMap::new();
/// let mut map: HashMap<&str, i32> = HashMap::new();
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -637,7 +637,7 @@ impl<K: Hash + Eq, V> HashMap<K, V, RandomState> {
///
/// ```
/// use std::collections::HashMap;
/// let mut map: HashMap<&str, isize> = HashMap::with_capacity(10);
/// let mut map: HashMap<&str, i32> = HashMap::with_capacity(10);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -724,7 +724,7 @@ impl<K, V, S> HashMap<K, V, S>
/// use std::collections::hash_map::RandomState;
///
/// let hasher = RandomState::new();
/// let map: HashMap<isize, isize> = HashMap::with_hasher(hasher);
/// let map: HashMap<i32, i32> = HashMap::with_hasher(hasher);
/// let hasher: &RandomState = map.hasher();
/// ```
#[stable(feature = "hashmap_public_hasher", since = "1.9.0")]
Expand All @@ -741,7 +741,7 @@ impl<K, V, S> HashMap<K, V, S>
///
/// ```
/// use std::collections::HashMap;
/// let map: HashMap<isize, isize> = HashMap::with_capacity(100);
/// let map: HashMap<i32, i32> = HashMap::with_capacity(100);
/// assert!(map.capacity() >= 100);
/// ```
#[inline]
Expand Down Expand Up @@ -770,7 +770,7 @@ impl<K, V, S> HashMap<K, V, S>
///
/// ```
/// use std::collections::HashMap;
/// let mut map: HashMap<&str, isize> = HashMap::new();
/// let mut map: HashMap<&str, i32> = HashMap::new();
/// map.reserve(10);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -849,7 +849,7 @@ impl<K, V, S> HashMap<K, V, S>
/// ```
/// use std::collections::HashMap;
///
/// let mut map: HashMap<isize, isize> = HashMap::with_capacity(100);
/// let mut map: HashMap<i32, i32> = HashMap::with_capacity(100);
/// map.insert(1, 2);
/// map.insert(3, 4);
/// assert!(map.capacity() >= 100);
Expand Down Expand Up @@ -1306,7 +1306,7 @@ impl<K, V, S> HashMap<K, V, S>
/// ```
/// use std::collections::HashMap;
///
/// let mut map: HashMap<isize, isize> = (0..8).map(|x|(x, x*10)).collect();
/// let mut map: HashMap<i32, i32> = (0..8).map(|x|(x, x*10)).collect();
/// map.retain(|&k, _| k % 2 == 0);
/// assert_eq!(map.len(), 4);
/// ```
Expand Down Expand Up @@ -1722,7 +1722,7 @@ impl<K, V, S> IntoIterator for HashMap<K, V, S>
/// map.insert("c", 3);
///
/// // Not possible with .iter()
/// let vec: Vec<(&str, isize)> = map.into_iter().collect();
/// let vec: Vec<(&str, i32)> = map.into_iter().collect();
/// ```
fn into_iter(self) -> IntoIter<K, V> {
IntoIter { inner: self.table.into_iter() }
Expand Down Expand Up @@ -2786,34 +2786,34 @@ mod test_map {
assert_eq!(m2.len(), 2);
}

thread_local! { static DROP_VECTOR: RefCell<Vec<isize>> = RefCell::new(Vec::new()) }
thread_local! { static DROP_VECTOR: RefCell<Vec<i32>> = RefCell::new(Vec::new()) }

#[derive(Hash, PartialEq, Eq)]
struct Dropable {
struct Droppable {
k: usize,
}

impl Dropable {
fn new(k: usize) -> Dropable {
impl Droppable {
fn new(k: usize) -> Droppable {
DROP_VECTOR.with(|slot| {
slot.borrow_mut()[k] += 1;
});

Dropable { k: k }
Droppable { k: k }
}
}

impl Drop for Dropable {
impl Drop for Droppable {
fn drop(&mut self) {
DROP_VECTOR.with(|slot| {
slot.borrow_mut()[self.k] -= 1;
});
}
}

impl Clone for Dropable {
fn clone(&self) -> Dropable {
Dropable::new(self.k)
impl Clone for Droppable {
fn clone(&self) -> Droppable {
Droppable::new(self.k)
}
}

Expand All @@ -2833,8 +2833,8 @@ mod test_map {
});

for i in 0..100 {
let d1 = Dropable::new(i);
let d2 = Dropable::new(i + 100);
let d1 = Droppable::new(i);
let d2 = Droppable::new(i + 100);
m.insert(d1, d2);
}

Expand All @@ -2845,7 +2845,7 @@ mod test_map {
});

for i in 0..50 {
let k = Dropable::new(i);
let k = Droppable::new(i);
let v = m.remove(&k);

assert!(v.is_some());
Expand Down Expand Up @@ -2892,8 +2892,8 @@ mod test_map {
});

for i in 0..100 {
let d1 = Dropable::new(i);
let d2 = Dropable::new(i + 100);
let d1 = Droppable::new(i);
let d2 = Droppable::new(i + 100);
hm.insert(d1, d2);
}

Expand Down Expand Up @@ -2943,13 +2943,13 @@ mod test_map {

#[test]
fn test_empty_remove() {
let mut m: HashMap<isize, bool> = HashMap::new();
let mut m: HashMap<i32, bool> = HashMap::new();
assert_eq!(m.remove(&0), None);
}

#[test]
fn test_empty_entry() {
let mut m: HashMap<isize, bool> = HashMap::new();
let mut m: HashMap<i32, bool> = HashMap::new();
match m.entry(0) {
Occupied(_) => panic!(),
Vacant(_) => {}
Expand All @@ -2960,7 +2960,7 @@ mod test_map {

#[test]
fn test_empty_iter() {
let mut m: HashMap<isize, bool> = HashMap::new();
let mut m: HashMap<i32, bool> = HashMap::new();
assert_eq!(m.drain().next(), None);
assert_eq!(m.keys().next(), None);
assert_eq!(m.values().next(), None);
Expand Down Expand Up @@ -3461,7 +3461,7 @@ mod test_map {
fn test_entry_take_doesnt_corrupt() {
#![allow(deprecated)] //rand
// Test for #19292
fn check(m: &HashMap<isize, ()>) {
fn check(m: &HashMap<i32, ()>) {
for k in m.keys() {
assert!(m.contains_key(k),
"{} is in keys() but not in the map?", k);
Expand Down Expand Up @@ -3570,7 +3570,7 @@ mod test_map {

#[test]
fn test_retain() {
let mut map: HashMap<isize, isize> = (0..100).map(|x|(x, x*10)).collect();
let mut map: HashMap<i32, i32> = (0..100).map(|x|(x, x*10)).collect();

map.retain(|&k, _| k % 2 == 0);
assert_eq!(map.len(), 50);
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl<T, S> HashSet<T, S>
/// use std::collections::HashSet;
///
/// let xs = [1,2,3,4,5,6];
/// let mut set: HashSet<isize> = xs.iter().cloned().collect();
/// let mut set: HashSet<i32> = xs.iter().cloned().collect();
/// set.retain(|&k| k % 2 == 0);
/// assert_eq!(set.len(), 3);
/// ```
Expand Down Expand Up @@ -1745,7 +1745,7 @@ mod test_set {
#[test]
fn test_retain() {
let xs = [1, 2, 3, 4, 5, 6];
let mut set: HashSet<isize> = xs.iter().cloned().collect();
let mut set: HashSet<i32> = xs.iter().cloned().collect();
set.retain(|&k| k % 2 == 0);
assert_eq!(set.len(), 3);
assert!(set.contains(&2));
Expand Down