Don't call try_eval_target_usize in error reporting
This commit is contained in:
@@ -4621,7 +4621,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||||||
format!("&{}{ty}", mutability.prefix_str())
|
format!("&{}{ty}", mutability.prefix_str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ty::Array(ty, len) if let Some(len) = len.try_eval_target_usize(tcx, param_env) => {
|
ty::Array(ty, len) if let Some(len) = len.try_to_target_usize(tcx) => {
|
||||||
if len == 0 {
|
if len == 0 {
|
||||||
"[]".to_string()
|
"[]".to_string()
|
||||||
} else if self.type_is_copy_modulo_regions(param_env, ty) || len == 1 {
|
} else if self.type_is_copy_modulo_regions(param_env, ty) || len == 1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user