Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3583423
suggest declaring modules when file found but module not defined
bend-n Jun 19, 2025
0cdd7f5
Add all rustc_std_internal_symbol to symbols.o
bjorn3 May 8, 2025
5f63b57
Remove dependency injection for the panic runtime
bjorn3 May 8, 2025
5dfe72c
Stop handling explicit dependencies on the panic runtime
bjorn3 May 8, 2025
6d3ff39
Avoid exporting panic_unwind as stdlib cargo feature
bjorn3 May 8, 2025
c44a23c
Make comment on activate_injected_dep a doc comment
bjorn3 May 9, 2025
b9c0f15
Fix LTO for internalizing rustc_std_internal_symbol symbols
bjorn3 Jun 17, 2025
f5af05b
Fix circular dependency test to use rustc_std_internal_symbol
bjorn3 Jun 17, 2025
18f4cb1
Extract const boundness parsing out into a method
oli-obk Apr 1, 2025
87c8aa1
Normalize before computing ConstArgHasType goal
compiler-errors Jun 20, 2025
3790eff
const validation: properly ignore zero-sized UnsafeCell
RalfJung Jun 26, 2025
7de39f5
make size_and_align_of_mplace work on all projectable
RalfJung Jun 26, 2025
eb7245a
Change const trait bound syntax from ~const to [const]
oli-obk Mar 11, 2025
512ff95
Rename `tilde const` test files to `conditionally const`
oli-obk Jun 26, 2025
57cb419
tests
bend-n Jun 26, 2025
4b77115
Update comments
bjorn3 Jun 27, 2025
d0fa026
const checks: avoid 'top-level scope' terminology
RalfJung Jun 27, 2025
5af7924
tag_for_variant: properly pass TypingEnv
RalfJung Jun 27, 2025
2057423
hir_analysis: prohibit `dyn PointeeSized`
davidtwco Jun 27, 2025
0e32036
gce: don't ICE on non-local const
yotamofek Jun 27, 2025
36c2b01
Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead
matthiaskrgr Jun 27, 2025
9d15167
Rollup merge of #140809 - bjorn3:panic_runtime_cleanup, r=petrochenkov
matthiaskrgr Jun 27, 2025
190a1a7
Rollup merge of #142730 - bend-n:suggest_declaring_modules_when_file_…
matthiaskrgr Jun 27, 2025
9108907
Rollup merge of #142806 - compiler-errors:norm-ct-has-ty, r=lcnr,BoxyUwU
matthiaskrgr Jun 27, 2025
2d59c4e
Rollup merge of #143046 - RalfJung:zst-unsafe-cell, r=lcnr,oli-obk
matthiaskrgr Jun 27, 2025
088f6ab
Rollup merge of #143092 - RalfJung:const-check-lifetime-ext, r=oli-obk
matthiaskrgr Jun 27, 2025
994ed31
Rollup merge of #143096 - RalfJung:tag_for_variant, r=compiler-errors
matthiaskrgr Jun 27, 2025
0f89445
Rollup merge of #143104 - davidtwco:issue-142652-dyn-pointeesized-den…
matthiaskrgr Jun 27, 2025
0e79b89
Rollup merge of #143106 - yotamofek:pr/gce/non-local-ice, r=BoxyUwU
matthiaskrgr Jun 27, 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
13 changes: 4 additions & 9 deletions compiler/rustc_const_eval/src/const_eval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,13 @@ pub(crate) fn try_destructure_mir_constant_for_user_output<'tcx>(
#[instrument(skip(tcx), level = "debug")]
pub fn tag_for_variant_provider<'tcx>(
tcx: TyCtxt<'tcx>,
(ty, variant_index): (Ty<'tcx>, VariantIdx),
key: ty::PseudoCanonicalInput<'tcx, (Ty<'tcx>, VariantIdx)>,
) -> Option<ty::ScalarInt> {
let (ty, variant_index) = key.value;
assert!(ty.is_enum());

// FIXME: This uses an empty `TypingEnv` even though
// it may be used by a generic CTFE.
let ecx = InterpCx::new(
tcx,
ty.default_span(tcx),
ty::TypingEnv::fully_monomorphized(),
crate::const_eval::DummyMachine,
);
let ecx =
InterpCx::new(tcx, ty.default_span(tcx), key.typing_env, crate::const_eval::DummyMachine);

let layout = ecx.layout_of(ty).unwrap();
ecx.tag_for_variant(layout, variant_index).unwrap().map(|(tag, _tag_field)| tag)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ rustc_queries! {
///
/// This query will panic for uninhabited variants and if the passed type is not an enum.
query tag_for_variant(
key: (Ty<'tcx>, abi::VariantIdx)
key: PseudoCanonicalInput<'tcx, (Ty<'tcx>, abi::VariantIdx)>,
) -> Option<ty::ScalarInt> {
desc { "computing variant tag for enum" }
}
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_transmute/src/layout/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ pub(crate) mod rustc {
if variant_layout.is_uninhabited() {
return Ok(Self::uninhabited());
}
let tag = cx.tcx().tag_for_variant((cx.tcx().erase_regions(ty), index));
let tag = cx.tcx().tag_for_variant(
cx.typing_env.as_query_input((cx.tcx().erase_regions(ty), index)),
);
let variant_def = Def::Variant(def.variant(index));
Self::from_variant(
variant_def,
Expand Down