mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
![]() Allow parenthesis around inferred array lengths In #135272 it was noticed that we weren't handling `Vec<(((((_)))))>` correctly under the new desugaring for `generic_arg_infer`, this had to be fixed in order to not regress stable code for types that should continue working. This has the side effect of *also* allowing the following to work: ```rust #![feature(generic_arg_infer)] struct Bar<const N: usize>; fn main() { let a: Bar<((_))> = Bar::<10>; } ``` However I did not make the same change for array lengths resulting in the following not compiling: ```rust #![feature(generic_arg_infer)] fn main() { let a: [u8; (((_)))] = [2; 2]; let a: [u8; 2] = [2; (((((_)))))]; } ``` This is rather inconsistent as parenthesis around `_` *are* supported for const args to non-arrays, and type args. This PR fixes this allowing the above example to compile. No stable impact. r? compiler-errors |
||
---|---|---|
.. | ||
assembly | ||
auxiliary | ||
codegen | ||
codegen-units | ||
coverage | ||
coverage-run-rustdoc | ||
crashes | ||
debuginfo | ||
incremental | ||
mir-opt | ||
pretty | ||
run-make | ||
rustdoc | ||
rustdoc-gui | ||
rustdoc-js | ||
rustdoc-js-std | ||
rustdoc-json | ||
rustdoc-ui | ||
ui | ||
ui-fulldeps | ||
COMPILER_TESTS.md |