Skip to content

Commit

Permalink
cleanup: don't .into() identical types
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Sep 29, 2024
1 parent 9903b25 commit e963568
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {

for i in 0..dest_len {
let place = self.project_index(&dest, i)?;
let value = if i == index {
elem.clone()
} else {
self.project_index(&input, i)?.into()
};
let value =
if i == index { elem.clone() } else { self.project_index(&input, i)? };
self.copy_op(&value, &place)?;
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
Err(e) => early_dcx.early_fatal(format!("failed to load fluent bundle: {e}")),
};

let mut locale_resources = Vec::from(config.locale_resources);
let mut locale_resources = config.locale_resources;
locale_resources.push(codegen_backend.locale_resource());

let mut sess = rustc_session::build_session(
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/if_let_rescope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl Subdiagnostic for IfLetRescopeRewrite {
.chain(repeat('}').take(closing_brackets.count))
.collect(),
));
let msg = f(diag, crate::fluent_generated::lint_suggestion.into());
let msg = f(diag, crate::fluent_generated::lint_suggestion);
diag.multipart_suggestion_with_style(
msg,
suggestions,
Expand Down

0 comments on commit e963568

Please sign in to comment.