rust/compiler/rustc_ast_lowering/src
Stuart Cook 25d282efd4
Rollup merge of #139641 - BoxyUwU:allow_parend_array_len_infer, r=compiler-errors
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
2025-04-11 13:31:49 +10:00
..
asm.rs Stabilize asm_goto 2025-03-17 11:12:10 +00:00
block.rs Implement super let. 2025-04-04 09:44:19 +02:00
delegation.rs Avoid empty identifiers for delegate params and args. 2025-04-10 14:46:53 +10:00
errors.rs Stabilize precise_capturing_in_traits 2025-03-23 14:11:04 +00:00
expr.rs Rollup merge of #139391 - TaKO8Ki:check-if-merged-attrs-list-is-empty, r=jdonszelmann 2025-04-06 18:08:11 +02:00
format.rs Simplify expansion for format_args!(). 2025-03-30 10:42:00 +02:00
index.rs Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
item.rs Rename some name variables as ident. 2025-04-10 09:30:55 +10:00
lib.rs Rollup merge of #139641 - BoxyUwU:allow_parend_array_len_infer, r=compiler-errors 2025-04-11 13:31:49 +10:00
pat.rs Add {ast,hir,thir}::PatKind::Missing variants. 2025-03-28 09:18:57 +11:00
path.rs Don't use kw::Empty in hir::Lifetime::ident. 2025-03-28 10:15:23 +11:00
stability.rs remove compiler support for extern "rust-intrinsic" blocks 2025-04-06 21:32:58 +02:00