1
Fork 0

Get rid of const eval_* and try_eval_* helpers

This commit is contained in:
Michael Goulet 2024-09-27 12:56:51 -04:00
parent a2a1206811
commit e83e4e8112
31 changed files with 119 additions and 172 deletions

View file

@ -231,7 +231,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
// Arrays give us `[]`, `[{ty}; _]` and `[{ty}; N]`
if let ty::Array(aty, len) = self_ty.kind() {
flags.push((sym::_Self, Some("[]".to_string())));
let len = len.try_to_valtree().and_then(|v| v.try_to_target_usize(self.tcx));
let len = len.try_to_target_usize(self.tcx);
flags.push((sym::_Self, Some(format!("[{aty}; _]"))));
if let Some(n) = len {
flags.push((sym::_Self, Some(format!("[{aty}; {n}]"))));