rust/compiler/rustc_passes/src
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
..
liveness Reformat use declarations. 2024-07-29 08:26:52 +10:00
abi_test.rs Shrink TyKind::FnPtr. 2024-08-09 14:33:25 +10:00
check_attr.rs Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU" 2024-09-01 16:35:53 +02:00
check_const.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
dead.rs chore: Fix typos in 'compiler' (batch 2) 2024-09-02 07:50:22 +02:00
debugger_visualizer.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
diagnostic_items.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
entry.rs rustc_passes: remove a redundant #[allow(rustc::untranslatable_diagnostic)] 2024-08-10 14:32:56 +03:00
errors.rs Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU" 2024-09-01 16:35:53 +02:00
hir_id_validator.rs Actually create ranged int types in the type system. 2024-04-08 12:02:19 +00:00
hir_stats.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lang_items.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
layout_test.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lib_features.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
lib.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
liveness.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
loops.rs Don't Suggest Labeling const and unsafe Blocks 2024-08-06 14:50:09 -04:00
naked_functions.rs Rollup merge of #127853 - folkertdev:naked-function-error-messages, r=bjorn3 2024-07-28 08:57:16 +02:00
reachable.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
stability.rs don't take reachability into account when warning about missing-const-stability 2024-08-31 15:11:48 +02:00
upvars.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00
weak_lang_items.rs Add warn(unreachable_pub) to rustc_passes. 2024-08-29 20:18:40 +10:00