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

@@ -346,7 +346,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
None
}
}
ty::Array(ty, len) => match len.try_eval_target_usize(cx.tcx, cx.param_env) {
ty::Array(ty, len) => match len.try_to_target_usize(cx.tcx) {
// If the array is empty we don't lint, to avoid false positives
Some(0) | None => None,
// If the array is definitely non-empty, we can do `#[must_use]` checking.