Add dependent binders and explicit trait evidence representation - #162745
enginespot wants to merge 1 commit into
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @khyperia (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
b47fc22 to
7a8b709
Compare
This comment has been minimized.
This comment has been minimized.
|
This needs significant discussion with the types team; Zulip is the right place for that. I'll leave this open for now, but am going to mark this as experimental. It is not going to be reviewed without discussion. |
Represent typed const and evidence declarations in binder telescopes. Keep proof substitutions separate from ordinary generic arguments and return dependent clauses and contracts when opening a binder. Carry evidence-indexed type and const projections through interning, folding, visiting, structural relation, hashing, and serialization. Preserve sharing in proof DAGs and validate declaration, projection, and decoding invariants. Adapt existing consumers and reject unsupported evidence evaluation. Add real-TyCtxt tests for substitution, nested binders, structural proof identity, projection arguments, contract obligations, and shared-DAG codec behavior.
7a8b709 to
8010641
Compare
|
This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to the CTFE machinery changes to the core type system cc @lcnr
cc @rust-lang/clippy changes to the core type system cc @lcnr |
|
The job Click to see the possible cause of the failure (guessed by this bot)Important For more information how to resolve CI failures of this job, visit this link. |
|
@jackh726 Thanks for the guidance. I’ve started a discussion in #t-types |
|
☔ The latest upstream changes (presumably #162827) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Introduce the type-level representation needed to carry dependent binder entries and compiler-internal trait evidence through rustc. Evidence is kept separate from ordinary generic arguments so later solver and canonical-query code can preserve the proof identity associated with a projection.
The motivation is the HRTB/GAT behavior tracked in #107572, #86702, and #121437. The current E0582 check conservatively rejects some callable bounds even when the same GAT projection appears on both the input and output sides. This representation gives later stages enough information to distinguish that case from a projection whose normalized output is independent of the bound lifetime.
This change adds:
Testing:
./x check./x test --stage 2 tests/ui-fulldeps./x test src/tools/tidyRelated: #107572, #86702, and #121437.
This design is informed by @RalfJung's explicit trait-evidence discussion in #32330 and by @compiler-errors and @SkiFire13's analysis of projection normalization and lifetime constraints in #107572 and #86702.