diff options
| author | Boxy <rust@boxyuwu.dev> | 2024-12-03 00:00:48 +0000 |
|---|---|---|
| committer | Boxy <rust@boxyuwu.dev> | 2024-12-03 00:21:51 +0000 |
| commit | 2807ba77a0b8c22d1326a6bfef87b28942fe9ab7 (patch) | |
| tree | 968056dd82d193215d63a1dcba8306583b8f9ef6 /tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs | |
| parent | d49be02cf6d2e2a01264fcdef1e20c826710c0f5 (diff) | |
| download | rust-2807ba77a0b8c22d1326a6bfef87b28942fe9ab7.tar.gz rust-2807ba77a0b8c22d1326a6bfef87b28942fe9ab7.zip | |
Use correct `hir_id` for array const arg infers
Diffstat (limited to 'tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs')
| -rw-r--r-- | tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs b/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs new file mode 100644 index 00000000000..c1f725db126 --- /dev/null +++ b/tests/ui/const-generics/generic_arg_infer/array-repeat-expr-lib.rs @@ -0,0 +1,12 @@ +//@ check-pass + +#![feature(generic_arg_infer)] +#![crate_type = "lib"] + +// Test that encoding the hallucinated `DefId` for the `_` const argument doesn't +// ICE (see #133468). This requires this to be a library crate. + +pub fn foo() { + let s: [u8; 10]; + s = [0; _]; +} |
