From cf7032f751d45bb807ce5ec3d3816870ef3a5beb Mon Sep 17 00:00:00 2001 From: Maybe Lapkin Date: Sun, 23 Jun 2024 22:29:08 +0200 Subject: [PATCH] Small fixes from review --- compiler/rustc_hir_typeck/messages.ftl | 6 +++--- compiler/rustc_hir_typeck/src/cast.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir_typeck/messages.ftl b/compiler/rustc_hir_typeck/messages.ftl index f05da5ad48a..fda3a8e256f 100644 --- a/compiler/rustc_hir_typeck/messages.ftl +++ b/compiler/rustc_hir_typeck/messages.ftl @@ -123,9 +123,9 @@ hir_typeck_option_result_asref = use `{$def_path}::as_ref` to convert `{$expecte hir_typeck_option_result_cloned = use `{$def_path}::cloned` to clone the value inside the `{$def_path}` hir_typeck_option_result_copied = use `{$def_path}::copied` to copy the value inside the `{$def_path}` -hir_typeck_ptr_cast_add_auto_to_object = adding an auto {$traits_len -> - [1] trait {$traits} - *[other] traits {$traits} +hir_typeck_ptr_cast_add_auto_to_object = adding {$traits_len -> + [1] an auto trait {$traits} + *[other] auto traits {$traits} } to a trait object in a pointer cast may cause UB later on hir_typeck_remove_semi_for_coerce = you might have meant to return the `match` expression diff --git a/compiler/rustc_hir_typeck/src/cast.rs b/compiler/rustc_hir_typeck/src/cast.rs index c2f481e6c2f..5787208516d 100644 --- a/compiler/rustc_hir_typeck/src/cast.rs +++ b/compiler/rustc_hir_typeck/src/cast.rs @@ -808,7 +808,7 @@ impl<'a, 'tcx> CastCheck<'tcx> { m_src: ty::TypeAndMut<'tcx>, m_dst: ty::TypeAndMut<'tcx>, ) -> Result { - debug!("check_ptr_ptr_cast m_expr={:?} m_cast={:?}", m_src, m_dst); + debug!("check_ptr_ptr_cast m_src={m_src:?} m_dst={m_dst:?}"); // ptr-ptr cast. vtables must match. let src_kind = fcx.tcx.erase_regions(fcx.pointer_kind(m_src.ty, self.span)?);