Skip to content

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

Closed
@nikomatsakis

Description

@nikomatsakis

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

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-traitsWorking group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions