Description
Now that @scalexm has created the basic framework for lowering, we need to flesh it out. This issue is intentionally structured as a "quest isuse" -- that is, a way for a lot of people to contribute, each doing one small thing. The goal is for everyone to get familiar with the overall "chalk" setup.
The tasks
Each task corresponds to one of the rules documented in the rustc-guide. You can search the guide for the rule name in order to find some text explaining the rule. If you want to do a rule, just check the box and edit this post to add your name (if you are a member of the GitHub team, you should have privileges for that). If you are not yet a member of the WG-traits group, leave a comment below or ping me on gitter and I will add you.
- Rule Implemented-From-Impl: this is the template rule that @scalexm started with.
- Rule Implemented-From-Env -- @varkor (PR Implement Chalk lowering rule "Implemented-From-Env" #49211)
- Rule Implied-Bound-From-Trait -- @tmandry (PR chalkify: Implement lowering rule Implied-Bound-From-Trait #49435)
- Rule WellFormed-TraitRef -- @csmoe (PR Chalk lowering rule: WellFormed-TraitRef #50250)
- Rule ProjectionEq-Normalize -- @csmoe (PR chalk lowering rule: ProjectionEq-Normalize #52153)
- Rule ProjectionEq-Skolemize -- @scalexm (PR Add chalk rules related to associated type defs #54909)
- Rule Normalize-From-Impl -- @fanzier (PR Implement Chalk lowering rule Normalize-From-Impl #49626)
- Rule Implied-Bound-From-AssocTy -- not needed until GATs
- Rule WellFormed-AssocTy -- @scalexm (PR Add chalk rules related to associated type defs #54909)
- Rule Implied-WC-From-AssocTy -- not needed until GATs / where clauses on assoc types
- Rule Implied-Trait-From-AssocTy -- @scalexm (PR # Add chalk rules related to associated type defs #54909)
Mentoring instructions
As described above, the goal is to add the code to generate appropriate program clauses from various Rust constructs. You should use the Implemented-From-Impl
rule as a kind of template:
rust/src/librustc_traits/lowering.rs
Lines 121 to 130 in a04b88d
Each rule should also have a unit-test. This rustc-guide chapter describes how to create such unit tests.
cc @rust-lang/wg-traits