Skip to content

Comments

Perform many const checks in typeck#149375

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
oli-obk:const_typeck
Feb 19, 2026
Merged

Perform many const checks in typeck#149375
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
oli-obk:const_typeck

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Nov 27, 2025

View all comments

Some smaller diagnostic changes, the biggest ones avoided by #148641

We should be able to move various checks in mir const checking to using span_bug! instead of reporting an error, just like mir typeck does as a sanity check. I would like to start doing so separately though, as this PR is a big enough (in what effects it causes, pun intended).

r? @fee1-dead

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2025

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@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 Nov 27, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 27, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 27, 2025
Perform many const checks in typeck
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 27, 2025
Comment on lines 1 to 13
//@ known-bug: #137187
#![feature(const_trait_impl, const_ops)]

use std::ops::Add;
trait A where
*const Self: Add,
const trait A where
*const Self: const Add,
{
const fn b(c: *const Self) -> <*const Self as Add>::Output {
fn b(c: *const Self) -> <*const Self as Add>::Output {
c + c
}
}

fn main() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This produces the same ICE as before, but the changes were required to pass typeck so we'd actually get to mir const checks

@rust-bors
Copy link
Contributor

rust-bors bot commented Nov 27, 2025

☀️ Try build successful (CI)
Build commit: 1a2d233 (1a2d2335c5ae8430107aa12ba73195c9b8aca1f0, parent: a4175159da185130408f71d7aa7e9bff0d455c24)

@rust-timer

This comment has been minimized.

@fmease fmease added the PG-const-traits Project group: Const traits label Nov 27, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1a2d233): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

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.1% [0.1%, 0.2%] 12
Regressions ❌
(secondary)
0.2% [0.0%, 0.3%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.2%] 12

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary -2.7%)

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)
-2.7% [-3.0%, -2.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-3.0%, -2.3%] 2

Binary size

Results (primary 0.1%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 4
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 34
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 4

Bootstrap: 472.621s -> 472.008s (-0.13%)
Artifact size: 386.88 MiB -> 386.98 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 27, 2025
@fee1-dead
Copy link
Member

there are performance regressions, are you planning on addressing them?

@fee1-dead fee1-dead added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2025
@bors
Copy link
Collaborator

bors commented Nov 30, 2025

☔ The latest upstream changes (presumably #149478) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 4, 2025

@bors try jobs=dist-arm-linux-gnueabi

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 4, 2025

🔒 Merge conflict

This pull request and the base branch diverged in a way that cannot
be automatically merged. Please rebase on top of the latest base
branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository,
you can resolve the conflict following these steps:

  1. git checkout const_typeck (switch to your branch)
  2. git fetch upstream HEAD (retrieve the latest base branch)
  3. git rebase upstream/HEAD -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self const_typeck --force-with-lease (update this PR)

You may also read
Git Rebasing to Resolve Conflicts by Drew Blessing
for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub.
It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is
handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

@rustbot

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 4, 2025

@bors try jobs=dist-arm-linux-gnueabi

rust-bors bot added a commit that referenced this pull request Dec 4, 2025
Perform many const checks in typeck

try-job: dist-arm-linux-gnueabi
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 4, 2025

☀️ Try build successful (CI)
Build commit: 7dd1e55 (7dd1e55361257601fd3b33f5f51b5cc36e1fc724, parent: 556beb9ec72360512d0294eb0855c92fb2c20c88)

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 9, 2025

@bors try jobs=dist-aarch64-linux

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 9, 2025
Perform many const checks in typeck

try-job: dist-aarch64-linux
@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 9, 2025

☀️ Try build successful (CI)
Build commit: 7bee76c (7bee76cb46d2db3f0598ce7421f5d5b65c87ae55, parent: e2893f7c95e45f74c8bc5dbd033486c5bfaa4deb)

@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

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.

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 6, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 6, 2026
Perform many const checks in typeck
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 6, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 6, 2026

☀️ Try build successful (CI)
Build commit: 8df7551 (8df75519ebaa5bab34b38dcac69345e4ce3d02ce, parent: bce89b6a56fecd6f1a150c9657e4b50dea994f83)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8df7551): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

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.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 3

Max RSS (memory usage)

Results (primary -0.7%, secondary 6.0%)

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)
6.0% [6.0%, 6.0%] 1
Improvements ✅
(primary)
-0.7% [-0.9%, -0.5%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-0.9%, -0.5%] 2

Cycles

Results (secondary -1.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)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.4% [-6.4%, -6.4%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.508s -> 475.606s (0.23%)
Artifact size: 397.96 MiB -> 398.04 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 6, 2026
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 7, 2026

@rustbot ready

The first perf run must have been a fluke. It doesn't reproduce and all my local debugging never pointed me to anything reasonable

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 7, 2026
@fee1-dead
Copy link
Member

LGTM. New perf results seem to not be cause for concern

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 17, 2026

📌 Commit 3127e92 has been approved by fee1-dead

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 Feb 17, 2026
@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 Feb 19, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 19, 2026

☀️ Test successful - CI
Approved by: fee1-dead
Duration: 3h 21m 1s
Pushing 7f99507 to main...

@rust-bors rust-bors bot merged commit 7f99507 into rust-lang:main Feb 19, 2026
13 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 19, 2026
@github-actions
Copy link
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 b6bed6f (parent) -> 7f99507 (this PR)

Test differences

Show 2 test diffs

2 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 7f99507f57e6c4aa0dce3daf6a13cca8cd4dd312 --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. aarch64-apple: 2h 31m -> 3h 13m (+28.0%)
  2. dist-aarch64-apple: 2h 20m -> 1h 44m (-25.7%)
  3. pr-check-1: 32m 46s -> 25m 24s (-22.4%)
  4. i686-gnu-nopt-1: 2h 25m -> 1h 56m (-19.5%)
  5. x86_64-gnu-llvm-21-3: 2h -> 1h 36m (-19.4%)
  6. aarch64-gnu-debug: 1h 21m -> 1h 5m (-19.1%)
  7. dist-apple-various: 2h 5m -> 1h 43m (-17.4%)
  8. i686-gnu-1: 2h 23m -> 1h 58m (-17.3%)
  9. dist-x86_64-apple: 2h 56m -> 2h 28m (-16.2%)
  10. x86_64-gnu-stable: 2h 29m -> 2h 7m (-14.4%)
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
Collaborator

Finished benchmarking commit (7f99507): comparison URL.

Overall result: ❌ regressions - please read the text below

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.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 3

Max RSS (memory usage)

Results (primary 1.9%)

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

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results (primary 0.0%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 6
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 6

Bootstrap: 481.703s -> 481.508s (-0.04%)
Artifact size: 397.81 MiB -> 397.92 MiB (0.03%)

@oli-obk oli-obk deleted the const_typeck branch February 20, 2026 06:29
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. PG-const-traits Project group: Const traits T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants