Skip to content

Commit

Permalink
Rollup merge of rust-lang#118884 - matthiaskrgr:auszweimacheins, r=Na…
Browse files Browse the repository at this point in the history
…drieril

NFC: simplify merging of two vecs
  • Loading branch information
matthiaskrgr authored Dec 12, 2023
2 parents 15eb5d4 + 2a1acc2 commit 00e1710
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_pattern_analysis/src/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,8 @@ impl ConstructorSet {
&& !(pcx.is_top_level && matches!(self, Self::NoConstructors))
{
// Treat all missing constructors as nonempty.
missing.extend(missing_empty.drain(..));
// This clears `missing_empty`.
missing.append(&mut missing_empty);
}

SplitConstructorSet { present, missing, missing_empty }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 00e1710

Please sign in to comment.