Skip to content

reflection: erase bound regions in function_ptr() - #166169

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:153176_lifetime_const_eval_equality
Nov 23, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:153176_lifetime_const_eval_equality

Conversation

@sgasho

@sgasho sgasho commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Fixes: #153176

skip_binder() only removes for<'a, ...> bound region declarations, so regions without declarations were left behind.
On nightly, the problem issue mentioned occurs.
ICE Not enough bound vars: '^0 not found in [] on local (with debug assertions) when calling trait_info_of

Fixed this issue by using instantiate_bound_regions_with_erased to erase bound regions on function_ptr() not to leave regions without declarations.

r? @oli-obk

(since you are the compiler champion of reflection & comptime, and I saw you asked the reviewee to leave a FIXME that I removed on this PR: #152173 (comment))

@rustbot

rustbot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE machinery

cc @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 Nov 19, 2026
let (variant, variant_place) = ecx.project_downcast_named(dest, sym::Some)?;
let field_place = ecx.project_field(&variant_place, FieldIdx::ZERO)?;
let sig = sig.skip_binder(); // FIXME: handle lifetime bounds
let sig = ecx.tcx.instantiate_bound_regions_with_erased(*sig);

@oli-obk oli-obk Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

leave the FIXME here, we may want to actually expose binders in the API somehow

View changes since the review

@rustbot rustbot 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 19, 2026
@rustbot

rustbot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@sgasho

sgasho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@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 Nov 19, 2026
@oli-obk

oli-obk commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit aabc982 has been tentatively approved by oli-obk

It will be put into the queue for this repository once PR CI succeeds.

@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 Nov 19, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2026
@rust-bors

rust-bors Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

❌ Commit aabc982 has been unapproved due to PR CI failure. Reapprove it with @bors r+ force if you want to ignore the failure.

View changes since this unapproval

@sgasho

sgasho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

101: Network is unreachable errors

@sgasho

sgasho commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@bors squash

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

🔨 2 commits were squashed into 78d5de8.

@rust-bors
rust-bors Bot force-pushed the 153176_lifetime_const_eval_equality branch from aabc982 to 78d5de8 Compare November 20, 2026 12:51
@rust-bors

This comment has been minimized.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the 153176_lifetime_const_eval_equality branch from 78d5de8 to 296ce75 Compare November 20, 2026 16:10
@sgasho

sgasho commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@oli-obk

CI is green now (no code changes since your last approval, just squashed and resolved conflicts). Could you please reapprove this?

@rustbot ready

@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 Nov 20, 2026
@rust-bors

This comment has been minimized.

* reflection: erase bound regions in function_ptr()
* leave FIXME for handling bound lifetimes
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the 153176_lifetime_const_eval_equality branch from 296ce75 to 48e85dd Compare November 21, 2026 03:11
@sgasho

sgasho commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 48e85dd has been approved by oli-obk

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 Nov 23, 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 Nov 23, 2026
@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: oli-obk
Duration: 2h 58m 32s
Pushing 0259d5e to main...

@rust-bors
rust-bors Bot merged commit 0259d5e into rust-lang:main Nov 23, 2026
15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 23, 2026
@github-actions

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 5debe6a (parent) -> 0259d5e (this PR)

Test differences

Show 1 test diff

1 doctest diff were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 0259d5e9a81c6af08e40f8c204f2c0c41dca1647 --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-ohos-armv7: -> 55m (+inf%)
  2. dist-powerpc64le-linux-musl: -> 1h 27m (+inf%)
  3. dist-x86_64-musl: -> 1h 32m (+inf%)
  4. test-x86_64-gnu-stdlib-semver-check: -> 10m 42s (+inf%)
  5. test-i686-msvc: -> 1h 49m (+inf%)
  6. test-aarch64-apple-1: -> 2h 25m (+inf%)
  7. test-x86_64-msvc-ext2: -> 1h 40m (+inf%)
  8. test-x86_64-msvc-ext3: -> 1h 10m (+inf%)
  9. test-aarch64-gnu-llvm-22-2: -> 54m 3s (+inf%)
  10. test-aarch64-apple-macos-26-1: -> 2h 38m (+inf%)
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 (0259d5e): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 3.1%, secondary 1.8%)

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

mean range count
Regressions ❌
(primary)
3.1% [1.5%, 4.6%] 2
Regressions ❌
(secondary)
3.2% [0.8%, 6.6%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-2.6%, -0.5%] 4
All ❌✅ (primary) 3.1% [1.5%, 4.6%] 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)
0.8% [0.8%, 0.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-6.0%, -0.5%] 4
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 460.778s -> 460.582s (-0.04%)
Artifact size: 405.75 MiB -> 405.69 MiB (-0.01%)

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. 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.

type_info on higher-ranked function pointer produces TypeId with strange lifetime.

5 participants