Skip to content

Don't fold in Instantiate when there's nothing to fold #142317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

Maybe this helps idk

r? 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 10, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 10, 2025

⌛ Trying commit cbd67db with merge 4b9e637

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 10, 2025
Don't fold in Instantiate when there's nothing to fold

Maybe this helps idk

r? lcnr
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 10, 2025
@compiler-errors
Copy link
Member Author

i feel like ive tested this before lol

@rust-bors
Copy link

rust-bors bot commented Jun 11, 2025

☀️ Try build successful (CI)
Build commit: 4b9e637 (4b9e63748fe7159cca76930c0864086580bb664a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4b9e637): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.3% [0.1%, 0.5%] 2
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 4
Improvements ✅
(secondary)
-1.7% [-3.4%, -0.1%] 12
All ❌✅ (primary) -0.0% [-0.3%, 0.5%] 6

Max RSS (memory usage)

Results (primary -2.1%)

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

Cycles

Results (secondary 2.1%)

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)
3.7% [3.6%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 755.415s -> 754.049s (-0.18%)
Artifact size: 372.14 MiB -> 372.20 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 12, 2025
@compiler-errors
Copy link
Member Author

I think the perf wins outweigh the perf hits.

@rustbot ready

@@ -622,6 +622,10 @@ impl<I: Interner, T: TypeFoldable<I>> ty::EarlyBinder<I, T> {
where
A: SliceLike<Item = I::GenericArg>,
{
// Nothing to fold.
if !cfg!(debug_assertions) && args.is_empty() {
Copy link
Member Author

Choose a reason for hiding this comment

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

We still fold if cfg!(debug_assertions) since the arg folder can detect out of bound arg instantiations, and that's useful in debug builds.

I believe that this is morally a debug assertion, since we never expect it in practice.

Copy link
Contributor

Choose a reason for hiding this comment

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

instead of still folding with debug assertions, check whether the value has params.

r=me after this nit

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Jun 13, 2025

📌 Commit 2b52d65 has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 13, 2025
@bors
Copy link
Collaborator

bors commented Jun 14, 2025

⌛ Testing commit 2b52d65 with merge 696433c...

bors added a commit that referenced this pull request Jun 14, 2025
Don't fold in Instantiate when there's nothing to fold

Maybe this helps idk

r? lcnr
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[TIMING] core::build_steps::test::Ui { compiler: Compiler { stage: 2, host: aarch64-apple-darwin, forced_compiler: false }, target: aarch64-apple-darwin } -- 0.000
##[group]Testing stage2 compiletest suite=crashes mode=crashes (aarch64-apple-darwin)

running 265 tests
2025-06-14T23:18:28.174277Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/101036.rs ... FAILED
test [crashes] tests/crashes/100041.rs ... ok
test [crashes] tests/crashes/101557.rs ... ok
test [crashes] tests/crashes/102047.rs ... ok
test [crashes] tests/crashes/102252.rs ... ok
---
test [crashes] tests/crashes/111419.rs ... ok
test [crashes] tests/crashes/111742.rs ... ok
test [crashes] tests/crashes/113846.rs ... ok
test [crashes] tests/crashes/114198-2.rs ... ok
2025-06-14T23:18:28.454036Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/114212-2.rs ... FAILED
test [crashes] tests/crashes/114198.rs ... ok
2025-06-14T23:18:28.482768Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/114212.rs ... FAILED
test [crashes] tests/crashes/114663.rs ... ok
test [crashes] tests/crashes/114920.rs ... ok
test [crashes] tests/crashes/116519-2.rs ... ok
test [crashes] tests/crashes/115435.rs ... ok
2025-06-14T23:18:28.559731Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/116554.rs ... FAILED
test [crashes] tests/crashes/116519.rs ... ok
test [crashes] tests/crashes/116979.rs ... ignored, ignored if rustc wasn't built with debug assertions
test [crashes] tests/crashes/116947.rs ... ok
test [crashes] tests/crashes/117392-2.rs ... ok
test [crashes] tests/crashes/117392.rs ... ok
2025-06-14T23:18:28.608802Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/117460.rs ... FAILED
test [crashes] tests/crashes/117629.rs ... ok
test [crashes] tests/crashes/117496.rs ... ok
test [crashes] tests/crashes/117696-2.rs ... ok
test [crashes] tests/crashes/117795.rs ... ok
---
test [crashes] tests/crashes/119729.rs ... ok
test [crashes] tests/crashes/119694.rs ... ok
test [crashes] tests/crashes/119783.rs ... ok
test [crashes] tests/crashes/119786.rs ... ok
2025-06-14T23:18:29.091275Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/119824.rs ... FAILED
test [crashes] tests/crashes/120016.rs ... ok
test [crashes] tests/crashes/120175.rs ... ignored, ignored if rustc wasn't built with debug assertions
test [crashes] tests/crashes/120033.rs ... ok
test [crashes] tests/crashes/120254.rs ... ok
---
test [crashes] tests/crashes/136188.rs ... ok
test [crashes] tests/crashes/136379.rs ... ok
test [crashes] tests/crashes/136381.rs ... ok
test [crashes] tests/crashes/136442.rs ... ok
2025-06-14T23:18:30.800844Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/136416.rs ... FAILED
test [crashes] tests/crashes/136661.rs ... ok
test [crashes] tests/crashes/136678.rs ... ok
test [crashes] tests/crashes/136666.rs ... ok
test [crashes] tests/crashes/136859.rs ... ok
---
test [crashes] tests/crashes/141124.rs ... ok
test [crashes] tests/crashes/88296.rs ... ok
test [crashes] tests/crashes/93182.rs ... ok
test [crashes] tests/crashes/92470.rs ... ok
2025-06-14T23:18:31.676447Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`."
test [crashes] tests/crashes/94846.rs ... FAILED
test [crashes] tests/crashes/92004.rs ... ok
test [crashes] tests/crashes/98322.rs ... ok
test [crashes] tests/crashes/const_mut_ref_check_bypass.rs ... ok
test [crashes] tests/crashes/project-to-simd-array-field.rs ... ok
test [crashes] tests/crashes/95134.rs ... ok
test [crashes] tests/crashes/93237.rs ... ok

failures:

---- [crashes] tests/crashes/101036.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/101036.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- [crashes] tests/crashes/114212-2.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/114212-2.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/114212.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/114212.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/116554.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/116554.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/117460.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/117460.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/119824.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/119824.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/136416.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/136416.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error

---- [crashes] tests/crashes/94846.rs stdout ----

error: crashtest no longer crashes/triggers ICE, hooray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge. If you want to see verbose output, set `COMPILETEST_VERBOSE_CRASHES=1`.

thread '[crashes] tests/crashes/94846.rs' panicked at src/tools/compiletest/src/runtest/crashes.rs:17:18:
fatal error


@bors
Copy link
Collaborator

bors commented Jun 14, 2025

💔 Test failed - checks-actions

@bors bors 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 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants