Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 984eab5

Browse files
committedDec 15, 2022
Auto merge of #105746 - matthiaskrgr:rollup-sz3grbv, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #104592 (Ensure async trait impls are async (or otherwise return an opaque type)) - #105623 (Fix `-Z print-type-sizes` for generators with discriminant field ordered first) - #105627 (Auto traits in `dyn Trait + Auto` are suggestable) - #105633 (Make `report_projection_error` more `Term` agnostic) - #105683 (Various cleanups to dest prop) - #105692 (Add regression test for #104678) - #105707 (rustdoc: remove unnecessary CSS `kbd { cursor: default }`) - #105715 (Do not mention long types in E0599 label) - #105722 (more clippy::complexity fixes) - #105724 (rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`) - #105730 (rustdoc: remove no-op CSS `.item-info:before { color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 397b66e + 2650b7b commit 984eab5

File tree

61 files changed

+509
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+509
-325
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,20 +2466,14 @@ pub enum ModKind {
24662466
Unloaded,
24672467
}
24682468

2469-
#[derive(Copy, Clone, Encodable, Decodable, Debug)]
2469+
#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)]
24702470
pub struct ModSpans {
24712471
/// `inner_span` covers the body of the module; for a file module, its the whole file.
24722472
/// For an inline module, its the span inside the `{ ... }`, not including the curly braces.
24732473
pub inner_span: Span,
24742474
pub inject_use_span: Span,
24752475
}
24762476

2477-
impl Default for ModSpans {
2478-
fn default() -> ModSpans {
2479-
ModSpans { inner_span: Default::default(), inject_use_span: Default::default() }
2480-
}
2481-
}
2482-
24832477
/// Foreign module declaration.
24842478
///
24852479
/// E.g., `extern { .. }` or `extern "C" { .. }`.

‎compiler/rustc_data_structures/src/sorted_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ impl<K: Ord, V> SortedMap<K, V> {
126126
/// Iterate over the keys, sorted
127127
#[inline]
128128
pub fn keys(&self) -> impl Iterator<Item = &K> + ExactSizeIterator + DoubleEndedIterator {
129-
self.data.iter().map(|&(ref k, _)| k)
129+
self.data.iter().map(|(k, _)| k)
130130
}
131131

132132
/// Iterate over values, sorted by key
133133
#[inline]
134134
pub fn values(&self) -> impl Iterator<Item = &V> + ExactSizeIterator + DoubleEndedIterator {
135-
self.data.iter().map(|&(_, ref v)| v)
135+
self.data.iter().map(|(_, v)| v)
136136
}
137137

138138
#[inline]
@@ -222,7 +222,7 @@ impl<K: Ord, V> SortedMap<K, V> {
222222
K: Borrow<Q>,
223223
Q: Ord + ?Sized,
224224
{
225-
self.data.binary_search_by(|&(ref x, _)| x.borrow().cmp(key))
225+
self.data.binary_search_by(|(x, _)| x.borrow().cmp(key))
226226
}
227227

228228
#[inline]
@@ -300,7 +300,7 @@ impl<K: Ord, V> FromIterator<(K, V)> for SortedMap<K, V> {
300300
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
301301
let mut data: Vec<(K, V)> = iter.into_iter().collect();
302302

303-
data.sort_unstable_by(|&(ref k1, _), &(ref k2, _)| k1.cmp(k2));
303+
data.sort_unstable_by(|(k1, _), (k2, _)| k1.cmp(k2));
304304
data.dedup_by(|&mut (ref k1, _), &mut (ref k2, _)| k1.cmp(k2) == Ordering::Equal);
305305

306306
SortedMap { data }

0 commit comments

Comments
 (0)
Please sign in to comment.