diff options
| author | lcnr <rust@lcnr.de> | 2024-11-15 13:53:31 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2024-11-18 10:38:56 +0100 |
| commit | bb93c23c0854bbb8aa6a523f0b4462da0f75f6da (patch) | |
| tree | 5949651899d4072249baf66a44b9706ad0f883b0 /clippy_lints/src/trailing_empty_array.rs | |
| parent | 1ceaa9041331c277c143078942ba5683d888a98c (diff) | |
| download | rust-bb93c23c0854bbb8aa6a523f0b4462da0f75f6da.tar.gz rust-bb93c23c0854bbb8aa6a523f0b4462da0f75f6da.zip | |
use `TypingEnv` when no `infcx` is available
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
Diffstat (limited to 'clippy_lints/src/trailing_empty_array.rs')
| -rw-r--r-- | clippy_lints/src/trailing_empty_array.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/trailing_empty_array.rs b/clippy_lints/src/trailing_empty_array.rs index 52bb7c4bd68..50a1577b288 100644 --- a/clippy_lints/src/trailing_empty_array.rs +++ b/clippy_lints/src/trailing_empty_array.rs @@ -58,7 +58,7 @@ fn is_struct_with_trailing_zero_sized_array<'tcx>(cx: &LateContext<'tcx>, item: && let Some(last_field) = data.fields().last() && let field_ty = cx .tcx - .normalize_erasing_regions(cx.param_env, cx.tcx.type_of(last_field.def_id).instantiate_identity()) + .normalize_erasing_regions(cx.typing_env(), cx.tcx.type_of(last_field.def_id).instantiate_identity()) && let ty::Array(_, array_len) = *field_ty.kind() && let Some(0) = array_len.try_to_target_usize(cx.tcx) { |
