File tree Expand file tree Collapse file tree 5 files changed +6
-6
lines changed
src/tools/clippy/clippy_utils/src Expand file tree Collapse file tree 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ pub(crate) fn eval_to_valtree<'tcx>(
7272}
7373
7474#[ instrument( skip( tcx) , level = "debug" ) ]
75- pub ( crate ) fn try_destructure_mir_constant_for_diagnostics < ' tcx > (
75+ pub ( crate ) fn try_destructure_mir_constant_for_user_output < ' tcx > (
7676 tcx : TyCtxtAt < ' tcx > ,
7777 val : mir:: ConstValue < ' tcx > ,
7878 ty : Ty < ' tcx > ,
Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ pub fn provide(providers: &mut Providers) {
5454 let ( param_env, raw) = param_env_and_value. into_parts ( ) ;
5555 const_eval:: eval_to_valtree ( tcx, param_env, raw)
5656 } ;
57- providers. hooks . try_destructure_mir_constant_for_diagnostics =
58- const_eval:: try_destructure_mir_constant_for_diagnostics ;
57+ providers. hooks . try_destructure_mir_constant_for_user_output =
58+ const_eval:: try_destructure_mir_constant_for_user_output ;
5959 providers. valtree_to_const_val = |tcx, ( ty, valtree) | {
6060 const_eval:: valtree_to_const_value ( tcx, ty:: ParamEnv :: empty ( ) . and ( ty) , valtree)
6161 } ;
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ macro_rules! declare_hooks {
6666declare_hooks ! {
6767 /// Tries to destructure an `mir::Const` ADT or array into its variant index
6868 /// and its field values. This should only be used for pretty printing.
69- hook try_destructure_mir_constant_for_diagnostics ( val: mir:: ConstValue <' tcx>, ty: Ty <' tcx>) -> Option <mir:: DestructuredConstant <' tcx>>;
69+ hook try_destructure_mir_constant_for_user_output ( val: mir:: ConstValue <' tcx>, ty: Ty <' tcx>) -> Option <mir:: DestructuredConstant <' tcx>>;
7070
7171 /// Getting a &core::panic::Location referring to a span.
7272 hook const_caller_location( file: rustc_span:: Symbol , line: u32 , col: u32 ) -> mir:: ConstValue <' tcx>;
Original file line number Diff line number Diff line change @@ -1713,7 +1713,7 @@ fn pretty_print_const_value_tcx<'tcx>(
17131713 ( _, ty:: Array ( ..) | ty:: Tuple ( ..) | ty:: Adt ( ..) ) if !ty. has_non_region_param ( ) => {
17141714 let ct = tcx. lift ( ct) . unwrap ( ) ;
17151715 let ty = tcx. lift ( ty) . unwrap ( ) ;
1716- if let Some ( contents) = tcx. try_destructure_mir_constant_for_diagnostics ( ct, ty) {
1716+ if let Some ( contents) = tcx. try_destructure_mir_constant_for_user_output ( ct, ty) {
17171717 let fields: Vec < ( ConstValue < ' _ > , Ty < ' _ > ) > = contents. fields . to_vec ( ) ;
17181718 match * ty. kind ( ) {
17191719 ty:: Array ( ..) => {
Original file line number Diff line number Diff line change @@ -710,7 +710,7 @@ fn field_of_struct<'tcx>(
710710 field : & Ident ,
711711) -> Option < mir:: Const < ' tcx > > {
712712 if let mir:: Const :: Val ( result, ty) = result
713- && let Some ( dc) = lcx. tcx . try_destructure_mir_constant_for_diagnostics ( result, ty)
713+ && let Some ( dc) = lcx. tcx . try_destructure_mir_constant_for_user_output ( result, ty)
714714 && let Some ( dc_variant) = dc. variant
715715 && let Some ( variant) = adt_def. variants ( ) . get ( dc_variant)
716716 && let Some ( field_idx) = variant. fields . iter ( ) . position ( |el| el. name == field. name )
You can’t perform that action at this time.
0 commit comments