Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1383272
Const-stabilize `str::is_char_boundary` and `str::split_at(_mut)(_che…
zachs18 Nov 13, 2024
ef34064
core: Apply unsafe_attr_outside_unsafe
ehuss Feb 13, 2025
cc74ed0
triagebot: automatically add more rustdoc related labels
lolbinarycat Feb 13, 2025
b7c975b
library: Update rand to 0.9.0
ehuss Feb 13, 2025
0aa634e
Migrate coretests to Rust 2024
ehuss Feb 11, 2025
890530e
alloc: Workaround hidden doctest line
ehuss Feb 13, 2025
55ef73c
alloc: Apply unsafe_attr_outside_unsafe
ehuss Feb 13, 2025
07ebbdd
alloc: Apply missing_unsafe_on_extern
ehuss Feb 13, 2025
9e60b0e
std: Apply unsafe_attr_outside_unsafe
ehuss Feb 12, 2025
c1791a1
std: Apply missing_unsafe_on_extern
ehuss Feb 12, 2025
7dc9e05
std: Apply dependency_on_unit_never_type_fallback
ehuss Feb 12, 2025
1ba59f8
std: Apply rust_2024_incompatible_pat
ehuss Feb 12, 2025
1b3940f
std: Apply fixes for tail drop expressions
ehuss Feb 12, 2025
36733f3
test: Apply deprecated_safe_2024
ehuss Feb 13, 2025
ef20a1b
std: Apply deprecated_safe_2024
ehuss Feb 13, 2025
37520e6
Fix early lint check desc in query
chenyukang Feb 14, 2025
3f9cca3
remove `fr_is_local` and `outlived_fr_is_local` fields from `ErrorCon…
dianne Feb 14, 2025
00683a0
CI: split i686-mingw job to three free runners
marcoieni Feb 14, 2025
2ea9e1d
further simplify a match
dianne Feb 14, 2025
00964aa
Add safe new to NotAllOnes
kornelski Feb 11, 2025
1284765
Rename `PatCtxt::lower_lit` to `lower_pat_expr`
Zalathar Feb 5, 2025
c3eea53
Clarify control-flow in `lower_path`
Zalathar Feb 4, 2025
92fc085
More comments for `lower_inline_const`
Zalathar Feb 5, 2025
e8a4f9d
Stabilize (and const-stabilize) `integer_sign_cast`
GrigorenkoPV Feb 14, 2025
7d1262a
Add new ui test for returning an Fn trait that returns impl Trait
LFS6502 Feb 13, 2025
be2cd95
Decode metadata buffer in one go
oli-obk Feb 14, 2025
4fa3318
Rollup merge of #133312 - lolbinarycat:triagebot-rustdoc-labels, r=Gu…
jhpratt Feb 14, 2025
8b88b2e
Rollup merge of #134016 - zachs18:stable-const-str-split_at, r=Amanieu
jhpratt Feb 14, 2025
af82b11
Rollup merge of #135813 - marcoieni:free-runner-i686-mingw, r=jdno
jhpratt Feb 14, 2025
562e1ed
Rollup merge of #136879 - kornelski:non1, r=Noratrieb
jhpratt Feb 14, 2025
8356c09
Rollup merge of #136971 - HypheX:patch1, r=WaffleLapkin
jhpratt Feb 14, 2025
b963ba2
Rollup merge of #136983 - ehuss:misc-2024-prep, r=tgross35
jhpratt Feb 14, 2025
aed26c9
Rollup merge of #137002 - chenyukang:fix-early-lint-check-desc, r=com…
jhpratt Feb 14, 2025
ecca7da
Rollup merge of #137006 - dianne:remove-errci-fields, r=compiler-errors
jhpratt Feb 14, 2025
3cbe03f
Rollup merge of #137026 - GrigorenkoPV:integer_sign_cast, r=Noratrieb
jhpratt Feb 14, 2025
3235a0b
Rollup merge of #137028 - Zalathar:thir-pat-expr, r=compiler-errors
jhpratt Feb 14, 2025
8491b54
Rollup merge of #137032 - oli-obk:push-ptvssqnomkpo, r=the8472
jhpratt Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More comments for lower_inline_const
  • Loading branch information
Zalathar committed Feb 14, 2025
commit 92fc085080d446ef6fd41f7c916179454bd1c43a
5 changes: 4 additions & 1 deletion compiler/rustc_mir_build/src/thir/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
pattern
}

/// Converts inline const patterns.
/// Lowers an inline const block (e.g. `const { 1 + 1 }`) to a pattern.
fn lower_inline_const(
&mut self,
block: &'tcx hir::ConstBlock,
Expand All @@ -708,6 +708,9 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {

let ct = ty::UnevaluatedConst { def: def_id.to_def_id(), args };
let subpattern = self.const_to_pat(ty::Const::new_unevaluated(self.tcx, ct), ty, id, span);

// Wrap the pattern in a marker node to indicate that it is the result
// of lowering an inline const block.
PatKind::ExpandedConstant { subpattern, def_id: def_id.to_def_id(), is_inline: true }
}

Expand Down
Loading