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 12 pull requests #91726

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d5f6b9c
code-cov: generate dead functions with private/default linkage
wesleywiser Dec 2, 2021
41f7692
Document all public items in `rustc_incremental`
pierwill Oct 29, 2021
913996b
Remove the match on `ErrorKind::Other`
ChrisDenton Dec 8, 2021
c7f80fc
add tests
b-naber Dec 8, 2021
c025a5d
move core/stream/stream/mod.rs to core/stream/stream.rs
ibraheemdev Dec 8, 2021
15de4cb
Remove redundant [..]s
est31 Dec 3, 2021
9f6da95
fix typo in `intrinsics::raw_eq` docs
WaffleLapkin Dec 8, 2021
4b0a9c9
Delete Utf8Lossy::from_str
dtolnay Dec 9, 2021
e18518b
Add unstable book entries for parts of asm that are not being stabilized
Amanieu Dec 9, 2021
caed83d
Add reminder to match the error kind once ` DirectoryNotEmpty` is sta…
ChrisDenton Dec 9, 2021
cebd949
Replace iterator-based set construction by *Set::From<[T; N]>
juniorbassani Dec 9, 2021
99bd24e
Fix span calculation on secondary_label as well
compiler-errors Dec 5, 2021
8a6f54f
Use more accurate wording in `bootstrap.py` logging
jyn514 Dec 9, 2021
ae6f5fb
If --verbose is passed, print a warning in `bootstrap.py` when downlo…
jyn514 Dec 9, 2021
dfcaac5
Don't print bootstrap caching/ensure info unless `-vv` is passed
jyn514 Dec 9, 2021
6840030
Default to `doc-stage = 2` for the tools profile
jyn514 Dec 9, 2021
57c66cc
Rollup merge of #90407 - pierwill:edit-rustc-incremental-docs, r=cjgi…
matthiaskrgr Dec 10, 2021
6a8c55a
Rollup merge of #91470 - wesleywiser:code_coverage_link_error, r=tmandry
matthiaskrgr Dec 10, 2021
d2d0b0b
Rollup merge of #91575 - compiler-errors:issue-91556, r=cjgillot
matthiaskrgr Dec 10, 2021
d1b5c23
Rollup merge of #91625 - est31:remove_indexes, r=oli-obk
matthiaskrgr Dec 10, 2021
c1cc4c5
Rollup merge of #91668 - ChrisDenton:bootstrap-clean-error, r=Mark-Si…
matthiaskrgr Dec 10, 2021
c8202a2
Rollup merge of #91678 - b-naber:tests-for-postpone-const-eval, r=jac…
matthiaskrgr Dec 10, 2021
28e8f15
Rollup merge of #91679 - ibraheemdev:stream-mod, r=Mark-Simulacrum
matthiaskrgr Dec 10, 2021
a416f94
Rollup merge of #91681 - WaffleLapkin:patch-3, r=scottmcm
matthiaskrgr Dec 10, 2021
781d796
Rollup merge of #91697 - dtolnay:lossyfromstr, r=Mark-Simulacrum
matthiaskrgr Dec 10, 2021
76f509b
Rollup merge of #91706 - Amanieu:asm_unstable_book2, r=joshtriplett
matthiaskrgr Dec 10, 2021
e4f3a73
Rollup merge of #91709 - juniorbassani:use-from-array-in-set-examples…
matthiaskrgr Dec 10, 2021
83e0b5c
Rollup merge of #91716 - jyn514:x.py-defaults, r=Mark-Simulacrum
matthiaskrgr Dec 10, 2021
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
37 changes: 18 additions & 19 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
/// let set = BTreeSet::from([1, 2, 3]);
/// assert_eq!(set.contains(&1), true);
/// assert_eq!(set.contains(&4), false);
/// ```
Expand All @@ -515,7 +515,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
/// let set = BTreeSet::from([1, 2, 3]);
/// assert_eq!(set.get(&2), Some(&2));
/// assert_eq!(set.get(&4), None);
/// ```
Expand All @@ -536,7 +536,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
/// let a = BTreeSet::from([1, 2, 3]);
/// let mut b = BTreeSet::new();
///
/// assert_eq!(a.is_disjoint(&b), true);
Expand All @@ -562,7 +562,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let sup: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
/// let sup = BTreeSet::from([1, 2, 3]);
/// let mut set = BTreeSet::new();
///
/// assert_eq!(set.is_subset(&sup), true);
Expand Down Expand Up @@ -639,7 +639,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let sub: BTreeSet<_> = [1, 2].iter().cloned().collect();
/// let sub = BTreeSet::from([1, 2]);
/// let mut set = BTreeSet::new();
///
/// assert_eq!(set.is_superset(&sub), false);
Expand Down Expand Up @@ -853,7 +853,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let mut set: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
/// let mut set = BTreeSet::from([1, 2, 3]);
/// assert_eq!(set.take(&2), Some(2));
/// assert_eq!(set.take(&2), None);
/// ```
Expand All @@ -876,8 +876,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let xs = [1, 2, 3, 4, 5, 6];
/// let mut set: BTreeSet<i32> = xs.iter().cloned().collect();
/// let mut set = BTreeSet::from([1, 2, 3, 4, 5, 6]);
/// // Keep only the even numbers.
/// set.retain(|&k| k % 2 == 0);
/// assert!(set.iter().eq([2, 4, 6].iter()));
Expand Down Expand Up @@ -1009,7 +1008,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<usize> = [1, 2, 3].iter().cloned().collect();
/// let set = BTreeSet::from([1, 2, 3]);
/// let mut set_iter = set.iter();
/// assert_eq!(set_iter.next(), Some(&1));
/// assert_eq!(set_iter.next(), Some(&2));
Expand All @@ -1022,7 +1021,7 @@ impl<T> BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<usize> = [3, 1, 2].iter().cloned().collect();
/// let set = BTreeSet::from([3, 1, 2]);
/// let mut set_iter = set.iter();
/// assert_eq!(set_iter.next(), Some(&1));
/// assert_eq!(set_iter.next(), Some(&2));
Expand Down Expand Up @@ -1124,7 +1123,7 @@ impl<T> IntoIterator for BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
/// let set = BTreeSet::from([1, 2, 3, 4]);
///
/// let v: Vec<_> = set.into_iter().collect();
/// assert_eq!(v, [1, 2, 3, 4]);
Expand Down Expand Up @@ -1243,8 +1242,8 @@ impl<T: Ord + Clone> Sub<&BTreeSet<T>> for &BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: BTreeSet<_> = vec![3, 4, 5].into_iter().collect();
/// let a = BTreeSet::from([1, 2, 3]);
/// let b = BTreeSet::from([3, 4, 5]);
///
/// let result = &a - &b;
/// let result_vec: Vec<_> = result.into_iter().collect();
Expand All @@ -1266,8 +1265,8 @@ impl<T: Ord + Clone> BitXor<&BTreeSet<T>> for &BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: BTreeSet<_> = vec![2, 3, 4].into_iter().collect();
/// let a = BTreeSet::from([1, 2, 3]);
/// let b = BTreeSet::from([2, 3, 4]);
///
/// let result = &a ^ &b;
/// let result_vec: Vec<_> = result.into_iter().collect();
Expand All @@ -1289,8 +1288,8 @@ impl<T: Ord + Clone> BitAnd<&BTreeSet<T>> for &BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: BTreeSet<_> = vec![2, 3, 4].into_iter().collect();
/// let a = BTreeSet::from([1, 2, 3]);
/// let b = BTreeSet::from([2, 3, 4]);
///
/// let result = &a & &b;
/// let result_vec: Vec<_> = result.into_iter().collect();
Expand All @@ -1312,8 +1311,8 @@ impl<T: Ord + Clone> BitOr<&BTreeSet<T>> for &BTreeSet<T> {
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: BTreeSet<_> = vec![3, 4, 5].into_iter().collect();
/// let a = BTreeSet::from([1, 2, 3]);
/// let b = BTreeSet::from([3, 4, 5]);
///
/// let result = &a | &b;
/// let result_vec: Vec<_> = result.into_iter().collect();
Expand Down
75 changes: 37 additions & 38 deletions library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl<T, S> HashSet<T, S> {
/// ```
/// use std::collections::HashSet;
///
/// let mut set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let mut set = HashSet::from([1, 2, 3]);
/// assert!(!set.is_empty());
///
/// // print 1, 2, 3 in an arbitrary order
Expand Down Expand Up @@ -489,8 +489,8 @@ where
///
/// ```
/// use std::collections::HashSet;
/// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// // Can be seen as `a - b`.
/// for x in a.difference(&b) {
Expand Down Expand Up @@ -518,8 +518,8 @@ where
///
/// ```
/// use std::collections::HashSet;
/// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// // Print 1, 4 in arbitrary order.
/// for x in a.symmetric_difference(&b) {
Expand Down Expand Up @@ -548,8 +548,8 @@ where
///
/// ```
/// use std::collections::HashSet;
/// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// // Print 2, 3 in arbitrary order.
/// for x in a.intersection(&b) {
Expand All @@ -576,8 +576,8 @@ where
///
/// ```
/// use std::collections::HashSet;
/// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// // Print 1, 2, 3, 4 in arbitrary order.
/// for x in a.union(&b) {
Expand Down Expand Up @@ -608,7 +608,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let set = HashSet::from([1, 2, 3]);
/// assert_eq!(set.contains(&1), true);
/// assert_eq!(set.contains(&4), false);
/// ```
Expand All @@ -633,7 +633,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let set = HashSet::from([1, 2, 3]);
/// assert_eq!(set.get(&2), Some(&2));
/// assert_eq!(set.get(&4), None);
/// ```
Expand All @@ -657,7 +657,7 @@ where
///
/// use std::collections::HashSet;
///
/// let mut set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let mut set = HashSet::from([1, 2, 3]);
/// assert_eq!(set.len(), 3);
/// assert_eq!(set.get_or_insert(2), &2);
/// assert_eq!(set.get_or_insert(100), &100);
Expand Down Expand Up @@ -744,7 +744,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let mut b = HashSet::new();
///
/// assert_eq!(a.is_disjoint(&b), true);
Expand All @@ -770,7 +770,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let sup: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let sup = HashSet::from([1, 2, 3]);
/// let mut set = HashSet::new();
///
/// assert_eq!(set.is_subset(&sup), true);
Expand All @@ -792,7 +792,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let sub: HashSet<_> = [1, 2].iter().cloned().collect();
/// let sub = HashSet::from([1, 2]);
/// let mut set = HashSet::new();
///
/// assert_eq!(set.is_superset(&sub), false);
Expand Down Expand Up @@ -893,7 +893,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let mut set: HashSet<_> = [1, 2, 3].iter().cloned().collect();
/// let mut set = HashSet::from([1, 2, 3]);
/// assert_eq!(set.take(&2), Some(2));
/// assert_eq!(set.take(&2), None);
/// ```
Expand All @@ -917,8 +917,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let xs = [1, 2, 3, 4, 5, 6];
/// let mut set: HashSet<i32> = xs.iter().cloned().collect();
/// let mut set = HashSet::from([1, 2, 3, 4, 5, 6]);
/// set.retain(|&k| k % 2 == 0);
/// assert_eq!(set.len(), 3);
/// ```
Expand Down Expand Up @@ -1097,8 +1096,8 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([3, 4, 5]);
///
/// let set = &a | &b;
///
Expand Down Expand Up @@ -1130,8 +1129,8 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([2, 3, 4]);
///
/// let set = &a & &b;
///
Expand Down Expand Up @@ -1163,8 +1162,8 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([3, 4, 5]);
///
/// let set = &a ^ &b;
///
Expand Down Expand Up @@ -1196,8 +1195,8 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([3, 4, 5]);
///
/// let set = &a - &b;
///
Expand Down Expand Up @@ -1226,7 +1225,7 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
///
/// let mut iter = a.iter();
/// ```
Expand All @@ -1248,7 +1247,7 @@ pub struct Iter<'a, K: 'a> {
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let a = HashSet::from([1, 2, 3]);
///
/// let mut iter = a.into_iter();
/// ```
Expand All @@ -1269,7 +1268,7 @@ pub struct IntoIter<K> {
/// ```
/// use std::collections::HashSet;
///
/// let mut a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let mut a = HashSet::from([1, 2, 3]);
///
/// let mut drain = a.drain();
/// ```
Expand All @@ -1291,7 +1290,7 @@ pub struct Drain<'a, K: 'a> {
///
/// use std::collections::HashSet;
///
/// let mut a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let mut a = HashSet::from([1, 2, 3]);
///
/// let mut drain_filtered = a.drain_filter(|v| v % 2 == 0);
/// ```
Expand All @@ -1315,8 +1314,8 @@ where
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// let mut intersection = a.intersection(&b);
/// ```
Expand All @@ -1342,8 +1341,8 @@ pub struct Intersection<'a, T: 'a, S: 'a> {
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// let mut difference = a.difference(&b);
/// ```
Expand All @@ -1369,8 +1368,8 @@ pub struct Difference<'a, T: 'a, S: 'a> {
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// let mut intersection = a.symmetric_difference(&b);
/// ```
Expand All @@ -1393,8 +1392,8 @@ pub struct SymmetricDifference<'a, T: 'a, S: 'a> {
/// ```
/// use std::collections::HashSet;
///
/// let a: HashSet<u32> = vec![1, 2, 3].into_iter().collect();
/// let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect();
/// let a = HashSet::from([1, 2, 3]);
/// let b = HashSet::from([4, 2, 3, 4]);
///
/// let mut union_iter = a.union(&b);
/// ```
Expand Down