From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_middle/src/mir/pretty.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compiler/rustc_middle/src/mir/pretty.rs') diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 2a4ff4b88..40289af25 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -88,7 +88,7 @@ pub fn dump_mir<'tcx, F>( dump_matched_mir_node(tcx, pass_num, pass_name, disambiguator, body, extra_data); } -pub fn dump_enabled<'tcx>(tcx: TyCtxt<'tcx>, pass_name: &str, def_id: DefId) -> bool { +pub fn dump_enabled(tcx: TyCtxt<'_>, pass_name: &str, def_id: DefId) -> bool { let Some(ref filters) = tcx.sess.opts.unstable_opts.dump_mir else { return false; }; @@ -421,7 +421,7 @@ impl<'tcx> ExtraComments<'tcx> { } } -fn use_verbose<'tcx>(ty: Ty<'tcx>, fn_def: bool) -> bool { +fn use_verbose(ty: Ty<'_>, fn_def: bool) -> bool { match *ty.kind() { ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char | ty::Float(_) => false, // Unit type @@ -448,15 +448,15 @@ impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> { // FIXME: this is a poor version of `pretty_print_const_value`. let fmt_val = |val: &ConstValue<'tcx>| match val { - ConstValue::ZeroSized => format!(""), + ConstValue::ZeroSized => "".to_string(), ConstValue::Scalar(s) => format!("Scalar({:?})", s), - ConstValue::Slice { .. } => format!("Slice(..)"), - ConstValue::ByRef { .. } => format!("ByRef(..)"), + ConstValue::Slice { .. } => "Slice(..)".to_string(), + ConstValue::ByRef { .. } => "ByRef(..)".to_string(), }; let fmt_valtree = |valtree: &ty::ValTree<'tcx>| match valtree { ty::ValTree::Leaf(leaf) => format!("ValTree::Leaf({:?})", leaf), - ty::ValTree::Branch(_) => format!("ValTree::Branch(..)"), + ty::ValTree::Branch(_) => "ValTree::Branch(..)".to_string(), }; let val = match literal { -- cgit v1.2.3