Skip to content

Commit 1be24d7

Browse files
committedJun 7, 2024
Auto merge of rust-lang#125918 - oli-obk:const_block_ice, r=compiler-errors
Revert: create const block bodies in typeck via query feeding as per the discussion in rust-lang#125806 (comment) It was a mistake to try to shoehorn const blocks and some specific anon consts into the same box and feed them during typeck. It turned out not simplifying anything (my hope was that we could feed `type_of` to start avoiding the huge HIR matcher, but that didn't work out), but instead making a few things more fragile. reverts the const-block-specific parts of rust-lang#124650 `@bors` rollup=never had a small perf impact previously fixes rust-lang#125846 r? `@compiler-errors`
2 parents 468310e + 321d69d commit 1be24d7

File tree

44 files changed

+211
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+211
-189
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ pub enum ExprKind {
13921392
/// An array (e.g, `[a, b, c, d]`).
13931393
Array(ThinVec<P<Expr>>),
13941394
/// Allow anonymous constants from an inline `const` block
1395-
ConstBlock(P<Expr>),
1395+
ConstBlock(AnonConst),
13961396
/// A function call
13971397
///
13981398
/// The first field resolves to the function itself,

‎compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
14171417
match kind {
14181418
ExprKind::Array(exprs) => visit_thin_exprs(exprs, vis),
14191419
ExprKind::ConstBlock(anon_const) => {
1420-
vis.visit_expr(anon_const);
1420+
vis.visit_anon_const(anon_const);
14211421
}
14221422
ExprKind::Repeat(expr, count) => {
14231423
vis.visit_expr(expr);

0 commit comments

Comments
 (0)
Please sign in to comment.