rust/tests/ui/inline-const
Matthias Krüger 51c686f32b
Rollup merge of #128701 - veera-sivarajan:fix-128604, r=estebank
Don't Suggest Labeling `const` and `unsafe` Blocks

Fixes #128604

Previously, both anonymous constant blocks (E.g. The labeled block
inside `['_'; 'block: { break 'block 1 + 2; }]`) and inline const
blocks (E.g. `const { ... }`) were considered to be the same
kind of blocks. This caused the compiler to incorrectly suggest
labeling both the blocks when only anonymous constant blocks can be
labeled.

This PR adds an other enum variant to `Context` so that both the
blocks can be handled appropriately.

Also, adds some doc comments and removes unnecessary `&mut` in a
couple of places.
2024-09-03 19:13:23 +02:00
..
break-inside-inline-const-issue-128604.rs Don't Suggest Labeling const and unsafe Blocks 2024-08-06 14:50:09 -04:00
break-inside-inline-const-issue-128604.stderr Don't Suggest Labeling const and unsafe Blocks 2024-08-06 14:50:09 -04:00
const-expr-array-init.rs
const-expr-basic.rs
const-expr-generic-err.rs
const-expr-generic-err.stderr
const-expr-generic-err2.rs
const-expr-generic-err2.stderr
const-expr-generic.rs
const-expr-inference.rs
const-expr-lifetime-err.rs
const-expr-lifetime-err.stderr
const-expr-lifetime.rs
const-expr-macro.rs
const-expr-reference.rs
const-match-pat-generic.rs
const-match-pat-generic.stderr avoid creating an Instance only to immediately disassemble it again 2024-07-18 11:58:16 +02:00
const-match-pat-inference.rs
const-match-pat-lifetime-err.rs
const-match-pat-lifetime-err.stderr
const-match-pat-lifetime.rs
const-match-pat-range.rs
const-match-pat.rs
const_block_pat_liveness.rs Add regression test 2024-06-07 08:33:58 +00:00
elided-lifetime-being-infer-vars.rs
expr-unsafe-err.rs
expr-unsafe-err.stderr
expr-unsafe.rs
expr-unsafe.stderr
expr-with-block-err.rs
expr-with-block-err.stderr
expr-with-block.rs
instance-doesnt-depend-on-type.rs
interpolated.rs
macro-with-const.rs
pat-match-fndef.rs
pat-match-fndef.stderr
pat-unsafe-err.rs
pat-unsafe-err.stderr
pat-unsafe.rs
pat-unsafe.stderr
promotion.rs
promotion.stderr
referencing_local_variables.rs
referencing_local_variables.stderr
required-const.rs
required-const.stderr
uninit_local.rs Make body_owned_by return the body directly. 2024-05-29 10:04:08 +00:00
uninit_local.stderr Make body_owned_by return the body directly. 2024-05-29 10:04:08 +00:00
using-late-bound-from-closure.rs Add test 2024-08-08 00:41:39 +08:00
using-late-bound-from-closure.stderr Add test 2024-08-08 00:41:39 +08:00