Skip to content

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

Closed
@nikomatsakis

Description

@nikomatsakis
Contributor

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

Activity

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
WG-traits[RETIRED] Working group: Traits
on Mar 19, 2018
varkor

varkor commented on Mar 20, 2018

@varkor
Member

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

added a commit that references this issue on Mar 20, 2018
tmandry

tmandry commented on Mar 26, 2018

@tmandry
Member

Working on Rule Implied-Bound-From-Trait!

fanzier

fanzier commented on Mar 31, 2018

@fanzier
Contributor

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

nikomatsakis

nikomatsakis commented on Apr 2, 2018

@nikomatsakis
ContributorAuthor

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

17 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-traits[RETIRED] Working group: Traits

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nikomatsakis@tmandry@varkor@XAMPPRocky@fanzier

        Issue actions

          🛠 Extend the "chalk lowering" pass with remaining rules · Issue #49177 · rust-lang/rust