Skip to content

Commit

Permalink
simplify merging of two vecs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Dec 12, 2023
1 parent 27d8a57 commit 6892fcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_pattern_analysis/src/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
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 6892fcd

Please sign in to comment.