Skip to content
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

🛠 Extend the "chalk lowering" pass with remaining rules #49177

Closed
9 of 11 tasks
nikomatsakis opened this issue Mar 19, 2018 · 7 comments
Closed
9 of 11 tasks

🛠 Extend the "chalk lowering" pass with remaining rules #49177

nikomatsakis opened this issue Mar 19, 2018 · 7 comments
Labels
A-trait-system Area: Trait system C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Mar 19, 2018

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.

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:

// Rule Implemented-From-Impl
//
// (see rustc guide)
let trait_ref = tcx.impl_trait_ref(def_id).unwrap();
let trait_ref = ty::TraitPredicate { trait_ref }.lower();
let where_clauses = tcx.predicates_of(def_id).predicates.lower();
let clause = Clause::Implies(where_clauses, trait_ref);
Lrc::new(vec![clause])

Each rule should also have a unit-test. This rustc-guide chapter describes how to create such unit tests.

cc @rust-lang/wg-traits

@nikomatsakis nikomatsakis added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804 labels Mar 19, 2018
@varkor
Copy link
Member

varkor commented Mar 20, 2018

I'll take Rule Implemented-From-Env to get my feet wet!

varkor added a commit to varkor/rust that referenced this issue Mar 20, 2018
This extends the Chalk lowering pass with the "Implemented-From-Env" rule for generating program clauses from a trait definition as part of rust-lang#49177.
kennytm added a commit to kennytm/rust that referenced this issue Mar 21, 2018
…rom-Env, r=nikomatsakis

Implement Chalk lowering rule "Implemented-From-Env"

This extends the Chalk lowering pass with the "Implemented-From-Env" rule for generating program clauses from a trait definition as part of rust-lang#49177.

r? @nikomatsakis
kennytm added a commit to kennytm/rust that referenced this issue Mar 22, 2018
…rom-Env, r=nikomatsakis

Implement Chalk lowering rule "Implemented-From-Env"

This extends the Chalk lowering pass with the "Implemented-From-Env" rule for generating program clauses from a trait definition as part of rust-lang#49177.

r? @nikomatsakis
@tmandry
Copy link
Member

tmandry commented Mar 26, 2018

Working on Rule Implied-Bound-From-Trait!

@fanzier
Copy link
Contributor

fanzier commented Mar 31, 2018

I'd like to try Normalize-From-Impl :) (Also, I think the rule Implemented-From-Impl occurs twice in the list.)

@nikomatsakis
Copy link
Contributor Author

@fanzier great! Let me know how it goes. Feel free to pop in on the gitter channel with questions.

bors added a commit that referenced this issue Apr 10, 2018
…atsakis

chalkify: Implement lowering rule Implied-Bound-From-Trait

For #49177.

TODO:
- [x] Implement where clauses besides trait and projection predicates
- [x] Is the output of the `lower_trait_higher_rank` test correct?
- [ ] Remove `Self::Trait` from the query `tcx.predicates_of(<trait_id>).predicates`
- [ ] Consider moving tests to compile-fail to make them more manageable
bors added a commit that referenced this issue Apr 12, 2018
Implement Chalk lowering rule Normalize-From-Impl

This extends the Chalk lowering pass with the "Normalize-From-Impl" rule for generating program clauses from a trait definition as part of #49177.

r? @nikomatsakis
kennytm added a commit to kennytm/rust that referenced this issue Apr 13, 2018
Implement Chalk lowering rule Normalize-From-Impl

This extends the Chalk lowering pass with the "Normalize-From-Impl" rule for generating program clauses from a trait definition as part of rust-lang#49177.

r? @nikomatsakis
bors added a commit that referenced this issue Apr 17, 2018
Implement Chalk lowering rule Normalize-From-Impl

This extends the Chalk lowering pass with the "Normalize-From-Impl" rule for generating program clauses from a trait definition as part of #49177.

r? @nikomatsakis
@XAMPPRocky XAMPPRocky added A-trait-system Area: Trait system C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Jun 26, 2018
bors added a commit that referenced this issue Jul 9, 2018
Chalk lowering rule: WellFormed-TraitRef

Address chalk lowering "Implemented-From-Env" as part of #49177.
r? @nikomatsakis
@bjorn3
Copy link
Member

bjorn3 commented Oct 19, 2018

@nikomatsakis I believe some check boxes should be checked.

bors added a commit that referenced this issue Nov 14, 2018
chalk lowering rule: ProjectionEq-Normalize

cc #49177
r? @scalexm
@bjorn3
Copy link
Member

bjorn3 commented Nov 14, 2018

PR #52153 has been merged.

@camelid
Copy link
Member

camelid commented Jan 13, 2021

Closed by request of @jackh726.

@camelid camelid closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
Projects
None yet
Development

No branches or pull requests

7 participants