Skip to content

Commit

Permalink
Rollup merge of #118884 - matthiaskrgr:auszweimacheins, r=Nadrieril
Browse files Browse the repository at this point in the history
NFC: simplify merging of two vecs
  • Loading branch information
workingjubilee authored Dec 13, 2023
2 parents 18e0966 + 2a1acc2 commit 89d4a9b
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 89d4a9b

Please sign in to comment.