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

One big happy family #131

Merged
merged 6 commits into from
May 21, 2018

Conversation

nikomatsakis
Copy link
Contributor

Refactor the context traits to allow rustc to implement them. The key change is that all the types go into one Context trait which offers nothing but types (well, and a few very simple helper methods). This means that, on the rustc side, we can implement Context with a type like

struct ChalkContext<'tcx> { PhantomData<&'tcx ()> }

This in turn means that types like ExClause<ChalkContext<'tcx>> are effectively the same (contravariant in the lifetime 'tcx, etc) as other rustc types like Ty<'tcx> and so forth. This unlocks the ability to implement the Lift and other traits we need.

Plus, I think this setup is ultimately simpler on the chalk side, since we don't have annoying things like ExClause<C, I>. The main downside is that we need some lift and conversion methods here and there.

r? @scalexm or @leodasvacas

///
/// At any given time, the SLG solver may have more than one context
/// active. First, there is always the *global* context, but when we
/// are in the midst of pursuing some particular strange, we will
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny typo: "strange" => "strand"

@nikomatsakis nikomatsakis merged commit 511bb62 into rust-lang:master May 21, 2018
bors added a commit to rust-lang/rust that referenced this pull request May 24, 2018
implement the chalk-engine traits

Preliminary implementation for the Chalk traits in rustc. Lots of `panic!()` placeholders to be filled in later.

This is currently blocked on us landing rust-lang/chalk#131  in chalk and issuing a new release, which should occur later today.

r? @scalexm
cc @leodasvacas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants