rust/tests
Matthias Krüger 260e04879e
Rollup merge of #107190 - fmease:fix-81698, r=compiler-errors
Recover from more const arguments that are not wrapped in curly braces

Recover from some array, borrow, tuple & arithmetic expressions in const argument positions that lack curly braces and provide a suggestion to fix the issue continuing where #92884 left off. Examples of such expressions: `[]`, `[0]`, `[1, 2]`, `[0; 0xff]`, `&9`, `("", 0)` and `(1 + 2) * 3` (we previously did not recover from them).

I am not entirely happy with my current solution because the code that recovers from `[0]` (coinciding with a malformed slice type) and `[0; 0]` (coinciding with a malformed array type) is quite fragile as the aforementioned snippets are actually successfully parsed as types by `parse_ty` since it itself already recovers from them (returning `[⟨error⟩]` and `[⟨error⟩; 0]` respectively) meaning I have to manually look for `TyKind::Err`s and construct a separate diagnostic for the suggestion to attach to (thereby emitting two diagnostics in total).

Fixes #81698.
`@rustbot` label A-diagnostics
r? diagnostics
2023-01-28 05:20:17 +01:00
..
assembly bump failing assembly & codegen tests from LLVM 14 to LLVM 15 2023-01-17 20:02:01 +01:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen Rollup merge of #107022 - scottmcm:ordering-option-eq, r=m-ou-se 2023-01-28 05:20:15 +01:00
codegen-units Move /src/test to /tests 2023-01-11 09:32:08 +00:00
debuginfo Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incremental Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mir-opt Bless mir-opt tests. 2023-01-27 22:01:47 +00:00
pretty Bless pretty tests. 2023-01-12 00:25:46 +01:00
run-make Make output_filenames a real query 2023-01-23 10:35:21 +00:00
run-make-fulldeps Rollup merge of #106904 - khuey:preserve_debuginfo_for_rlibs, r=davidtwco 2023-01-26 15:02:19 +01:00
run-pass-valgrind Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc Add regression test for #107350 2023-01-27 12:11:01 +01:00
rustdoc-gui Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, r=GuillaumeGomez 2023-01-27 12:57:57 +09:00
rustdoc-js rustdoc: update search test cases 2023-01-14 12:04:12 -07:00
rustdoc-js-std rustdoc: update search test cases 2023-01-14 12:04:12 -07:00
rustdoc-json Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc-ui Add drop_tracking_mir option. 2023-01-27 18:57:34 +00:00
ui Rollup merge of #107190 - fmease:fix-81698, r=compiler-errors 2023-01-28 05:20:17 +01:00
ui-fulldeps Bless ui-fulldeps. 2023-01-27 20:10:25 +00:00
COMPILER_TESTS.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00