diff --git a/compiler/noirc_frontend/src/hir_def/types.rs b/compiler/noirc_frontend/src/hir_def/types.rs index 387489f6a32..dae693a0dae 100644 --- a/compiler/noirc_frontend/src/hir_def/types.rs +++ b/compiler/noirc_frontend/src/hir_def/types.rs @@ -1311,7 +1311,7 @@ impl Type { } Type::Array(length, element) => { - (Self::should_allow_zero_sized_input() || self.array_or_string_len_is_not_zero()) + self.array_or_string_len_is_not_zero() && length.is_valid_for_program_input() && element.is_valid_for_program_input() } @@ -1334,14 +1334,6 @@ impl Type { } } - /// Check if it is okay to allow for zero-sized input (e..g zero-sized arrays) to a program. - /// This behavior is not well defined and is banned by default. - /// However, this ban is a breaking change for some dependent projects so this override - /// is provided until those projects migrate away from using zero-sized array input (e.g. ). - fn should_allow_zero_sized_input() -> bool { - std::env::var("ALLOW_EMPTY_INPUT").ok().map(|v| v == "1" || v == "true").unwrap_or_default() - } - /// Empty arrays and strings (which are arrays under the hood) are disallowed /// as input to program entry points. ///