diff options
Diffstat (limited to 'compiler/rustc_mir/src')
6 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs index 2e854ea5be7..e43973b8db4 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs @@ -320,7 +320,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { .map(|n| format!("`{}`", n)) .unwrap_or_else(|| "the mutable reference".to_string()), ), - format!("&mut *"), + "&mut *".to_string(), Applicability::MachineApplicable, ); } diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs index 671d947d1b1..d3f9e49816a 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs @@ -721,7 +721,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { if suggestions.peek().is_some() { err.span_suggestions( path_segment.ident.span, - &format!("use mutable method"), + "use mutable method", suggestions, Applicability::MaybeIncorrect, ); diff --git a/compiler/rustc_mir/src/transform/check_consts/ops.rs b/compiler/rustc_mir/src/transform/check_consts/ops.rs index fd72ec4340f..92de8bd292c 100644 --- a/compiler/rustc_mir/src/transform/check_consts/ops.rs +++ b/compiler/rustc_mir/src/transform/check_consts/ops.rs @@ -255,7 +255,7 @@ impl NonConstOp for CellBorrow { ); err.span_label( span, - format!("this borrow of an interior mutable value may end up in the final value"), + "this borrow of an interior mutable value may end up in the final value", ); if let hir::ConstContext::Static(_) = ccx.const_kind() { err.help( diff --git a/compiler/rustc_mir/src/transform/coverage/debug.rs b/compiler/rustc_mir/src/transform/coverage/debug.rs index f6672335cb1..6fd7d29d777 100644 --- a/compiler/rustc_mir/src/transform/coverage/debug.rs +++ b/compiler/rustc_mir/src/transform/coverage/debug.rs @@ -344,7 +344,7 @@ impl DebugCounters { return if counter_format.id { format!("{}#{}", block_label, id.index()) } else { - format!("{}", block_label) + block_label.to_string() }; } } @@ -369,7 +369,7 @@ impl DebugCounters { } return format!("({})", self.format_counter_kind(counter_kind)); } - return format!("{}", self.format_counter_kind(counter_kind)); + return self.format_counter_kind(counter_kind).to_string(); } } format!("#{}", operand.index().to_string()) diff --git a/compiler/rustc_mir/src/transform/lower_intrinsics.rs b/compiler/rustc_mir/src/transform/lower_intrinsics.rs index 6d7e4cdb1c6..aff2df31b1c 100644 --- a/compiler/rustc_mir/src/transform/lower_intrinsics.rs +++ b/compiler/rustc_mir/src/transform/lower_intrinsics.rs @@ -147,8 +147,8 @@ fn validate_simd_shuffle(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span) match &args[2] { Operand::Constant(_) => {} // all good _ => { - let msg = format!("last argument of `simd_shuffle` is required to be a `const` item"); - tcx.sess.span_err(span, &msg); + let msg = "last argument of `simd_shuffle` is required to be a `const` item"; + tcx.sess.span_err(span, msg); } } } diff --git a/compiler/rustc_mir/src/util/pretty.rs b/compiler/rustc_mir/src/util/pretty.rs index d0b1bc47ea8..7598a011bb6 100644 --- a/compiler/rustc_mir/src/util/pretty.rs +++ b/compiler/rustc_mir/src/util/pretty.rs @@ -479,7 +479,7 @@ impl Visitor<'tcx> for ExtraComments<'tcx> { uv.promoted ), ty::ConstKind::Value(val) => format!("Value({:?})", val), - ty::ConstKind::Error(_) => format!("Error"), + ty::ConstKind::Error(_) => "Error".to_string(), }; self.push(&format!("+ val: {}", val)); } |
