about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-08-05 03:51:34 +0200
committerGitHub <noreply@github.com>2025-08-05 03:51:34 +0200
commit4cb0ebd24f0551de7894e2a8494dcb50727af839 (patch)
tree0da00c1ab73c58060c0691cd5b6f3570877e4bc0 /compiler/rustc_const_eval
parent58b00b088ed88a6c6ca6f80599f6abdd84c373a5 (diff)
parent7d78968bd053eb7811126b2bad991579fb78cc3a (diff)
downloadrust-4cb0ebd24f0551de7894e2a8494dcb50727af839.tar.gz
rust-4cb0ebd24f0551de7894e2a8494dcb50727af839.zip
Rollup merge of #144741 - ShoyuVanilla:tilde-const-in-block, r=fee1-dead
fix: Error on illegal `[const]`s inside blocks within legal positions

Fixes rust-lang/rust#132067

I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here:

https://github.com/rust-lang/rust/blob/3fb1b53a9dbfcdf37a4b67d35cde373316829930/compiler/rustc_ast_passes/src/ast_validation.rs#L1596-L1610

Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
Diffstat (limited to 'compiler/rustc_const_eval')
0 files changed, 0 insertions, 0 deletions