Skip to content

remove UnevaluatedConstKind::def_id#157374

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:remove-UnevaluatedConstKind-def_id
Jun 8, 2026
Merged

remove UnevaluatedConstKind::def_id#157374
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
khyperia:remove-UnevaluatedConstKind-def_id

Conversation

@khyperia

@khyperia khyperia commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

View all comments

this is some of the const side of #152245

not quite a full removal, there's still some spicy things such as UnevaluatedConstKind::def_span remaining that won't quite work for new non-DefID UnevaluatedConstKind cases, but IMO this is the bulk of the work, and feature-specific things can deal with their quirks in their own PRs when they know their own use cases.

r? @BoxyUwU

self-reminder: file an issue on what to do about rustc_public's handling of the raw DefIds in rustc_public AliasTy/AliasConst

@rustbot

rustbot commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

changes to the core type system

cc @lcnr

Some changes occurred in abstract_const.rs

cc @BoxyUwU

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 3, 2026
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 3, 2026
@rustbot

rustbot commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@rust-bors

This comment has been minimized.

@khyperia khyperia force-pushed the remove-UnevaluatedConstKind-def_id branch from 10e75d3 to 5070cba Compare June 4, 2026 04:36
@rustbot

rustbot commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

fn is_const_param_default(tcx: TyCtxt<'_>, def: LocalDefId) -> bool {
let hir_id = tcx.local_def_id_to_hir_id(def);
fn is_const_param_default(tcx: TyCtxt<'_>, kind: ty::UnevaluatedConstKind<'_>) -> bool {
let def_id = match kind {

@BoxyUwU BoxyUwU Jun 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fn is really a "is this anon const a default for a const prameter" so we dont really care about other alias kinds than Anon

View changes since the review

if mir_body.is_polymorphic {
let Some(local_def_id) = ct.kind.def_id().as_local() else { return };
if mir_body.is_polymorphic
&& let Some(def_id) = ct.kind.opt_def_id()

@BoxyUwU BoxyUwU Jun 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just be able to use cid.instance.def_id() here

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pushed fixes for both feedbacks, thanks ✨

@khyperia khyperia force-pushed the remove-UnevaluatedConstKind-def_id branch from 5070cba to f1099c0 Compare June 6, 2026 08:54
@BoxyUwU

BoxyUwU commented Jun 7, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup=never

sick, thanks :3

@rust-bors

rust-bors Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f1099c0 has been approved by BoxyUwU

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 7, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
…r=BoxyUwU

remove UnevaluatedConstKind::def_id

this is some of the const side of #152245

not quite a _full_ removal, there's still some spicy things such as `UnevaluatedConstKind::def_span` remaining that won't quite work for new non-DefID `UnevaluatedConstKind` cases, but IMO this is the bulk of the work, and feature-specific things can deal with their quirks in their own PRs when they know their own use cases.

r? @BoxyUwU 

self-reminder: file an issue on what to do about rustc_public's handling of the raw DefIds in rustc_public AliasTy/AliasConst
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 8, 2026
@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e8a10b1 failed: CI. Failed job:

@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

Let's see if CI will cooperate

@bors p=100

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
…r=BoxyUwU

remove UnevaluatedConstKind::def_id

this is some of the const side of #152245

not quite a _full_ removal, there's still some spicy things such as `UnevaluatedConstKind::def_span` remaining that won't quite work for new non-DefID `UnevaluatedConstKind` cases, but IMO this is the bulk of the work, and feature-specific things can deal with their quirks in their own PRs when they know their own use cases.

r? @BoxyUwU 

self-reminder: file an issue on what to do about rustc_public's handling of the raw DefIds in rustc_public AliasTy/AliasConst
@rust-bors rust-bors Bot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 8, 2026
@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

💔 Test for bac7ec3 failed: CI. Failed job:

@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors p=0 retry

@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
…r=BoxyUwU

remove UnevaluatedConstKind::def_id

this is some of the const side of #152245

not quite a _full_ removal, there's still some spicy things such as `UnevaluatedConstKind::def_span` remaining that won't quite work for new non-DefID `UnevaluatedConstKind` cases, but IMO this is the bulk of the work, and feature-specific things can deal with their quirks in their own PRs when they know their own use cases.

r? @BoxyUwU 

self-reminder: file an issue on what to do about rustc_public's handling of the raw DefIds in rustc_public AliasTy/AliasConst
@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors yield

tree is closed due to docker

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #155607.

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 8, 2026
@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: BoxyUwU
Duration: 3h 18m 49s
Pushing f3ef3bd to main...

@rust-bors rust-bors Bot merged commit f3ef3bd into rust-lang:main Jun 8, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 8, 2026
@khyperia khyperia deleted the remove-UnevaluatedConstKind-def_id branch June 8, 2026 16:44
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 877a131 (parent) -> f3ef3bd (this PR)

Test differences

Show 14 test diffs

14 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard f3ef3bd882dd24a275a60701a67c3bb330edd8c1 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-i686-mingw: 1h 36m -> 2h 38m (+65.5%)
  2. aarch64-apple: 2h 32m -> 3h 11m (+25.7%)
  3. x86_64-gnu: 1h 51m -> 2h 17m (+23.7%)
  4. dist-ohos-x86_64: 1h 3m -> 1h 18m (+22.3%)
  5. arm-android: 1h 45m -> 1h 22m (-21.5%)
  6. dist-powerpc64-linux-musl: 1h 45m -> 2h 7m (+21.1%)
  7. aarch64-gnu: 2h 9m -> 2h 24m (+11.2%)
  8. dist-aarch64-msvc: 1h 45m -> 1h 56m (+10.5%)
  9. test-various: 1h 59m -> 2h 11m (+10.4%)
  10. dist-aarch64-freebsd: 58m 56s -> 1h 4m (+10.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f3ef3bd): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Max RSS (memory usage)

Results (secondary -6.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.5% [-6.5%, -6.5%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-3.4%, -2.4%] 2
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 516.107s -> 517.572s (0.28%)
Artifact size: 401.34 MiB -> 400.85 MiB (-0.12%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 8, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member

All regressions look like noise (though recently introduced).

@rustbot label +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants