diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-12 18:42:37 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-12 18:42:37 +0100 |
| commit | 6892fcd690fe252062ffc8621e2878069a1ee3d8 (patch) | |
| tree | c423e20d7544287f12b78b6400357c1c83c38a9b | |
| parent | 27d8a577138c0d319a572cd1a464c2b755e577de (diff) | |
| download | rust-6892fcd690fe252062ffc8621e2878069a1ee3d8.tar.gz rust-6892fcd690fe252062ffc8621e2878069a1ee3d8.zip | |
simplify merging of two vecs
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/constructor.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_pattern_analysis/src/constructor.rs b/compiler/rustc_pattern_analysis/src/constructor.rs index 716ccdd4dcd..02039679517 100644 --- a/compiler/rustc_pattern_analysis/src/constructor.rs +++ b/compiler/rustc_pattern_analysis/src/constructor.rs @@ -979,7 +979,7 @@ impl ConstructorSet { && !(pcx.is_top_level && matches!(self, Self::NoConstructors)) { // Treat all missing constructors as nonempty. - missing.extend(missing_empty.drain(..)); + missing.append(&mut missing_empty); } SplitConstructorSet { present, missing, missing_empty } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index df30c185c60..ded1408b990 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2178,7 +2178,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> { let (span, text) = match path.segments.first() { Some(seg) if let Some(name) = seg.ident.as_str().strip_prefix("let") => { // a special case for #117894 - let name = name.strip_prefix("_").unwrap_or(name); + let name = name.strip_prefix('_').unwrap_or(name); (ident_span, format!("let {name}")) } _ => (ident_span.shrink_to_lo(), "let ".to_string()), |
