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

Replace ParamEnv with a new type in chalk context. #55040

Merged
merged 8 commits into from
Oct 19, 2018

Conversation

scalexm
Copy link
Member

@scalexm scalexm commented Oct 13, 2018

I left a few FIXMEs.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2018
@@ -97,24 +99,24 @@ impl context::Context for ChalkArenas<'tcx> {

type Parameter = Kind<'tcx>;

type ProgramClause = ProgramClause<'tcx>;
Copy link
Member

Choose a reason for hiding this comment

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

Why doesn’t the terminology line up here anymore with chalk?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmh at some point the terminology diverged, we use Clause in rustc for ProgramClause in chalk, and ProgramClause in rustc for ProgramClauseImplication in chalk. I agree we should somehow resolve that conflict.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the meaning of these words I would like to be using:

  • "clause" is one of the "base facts" we know to be true
    • in particular, this includes clauses injected via hypothesis, e.g. the clause A in A => G.
  • "program clause" is something that was given in the "input program"
    • in our case, this means the stuff we created by lowering impls and so forth

In particular, program clauses are available globally at all times, whereas clauses may only be available to some goals.

let ty::InstantiatedPredicates { predicates } =
tcx.predicates_of(def_id).instantiate_identity(tcx);

let clauses = predicates.into_iter()
Copy link
Member

Choose a reason for hiding this comment

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

I love how clean this is.

@bors
Copy link
Contributor

bors commented Oct 15, 2018

☔ The latest upstream changes (presumably #54858) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

r=me once rebased

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:12:27]    Compiling rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[00:12:27]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:12:28]    Compiling rustc_allocator v0.0.0 (/checkout/src/librustc_allocator)
[00:13:29]    Compiling rustc_traits v0.0.0 (/checkout/src/librustc_traits)
[00:13:30] error[E0491]: in type `&'set mut std::collections::HashSet<rustc::traits::Clause<'tcx>, std::hash::BuildHasherDefault<rustc_data_structures::fx::FxHasher>>`, reference has a longer lifetime than the data it references
[00:13:30]   --> librustc_traits/lowering/environment.rs:26:5
[00:13:30]    |
[00:13:30] 26 |     round: &'set mut FxHashSet<Clause<'tcx>>,
[00:13:30]    |
[00:13:30]    |
[00:13:30] note: the pointer is valid for the lifetime 'set as defined on the struct at 24:22
[00:13:30]   --> librustc_traits/lowering/environment.rs:24:22
[00:13:30]    |
[00:13:30] 24 | struct ClauseVisitor<'set, 'a, 'tcx: 'a> {
[00:13:30]    |                      ^^^^
[00:13:30] note: but the referenced data is only valid for the lifetime 'tcx as defined on the struct at 24:32
[00:13:30]   --> librustc_traits/lowering/environment.rs:24:32
[00:13:30]    |
[00:13:30] 24 | struct ClauseVisitor<'set, 'a, 'tcx: 'a> {
[00:13:30] 
[00:13:30] error: aborting due to previous error
[00:13:30] 
[00:13:30] For more information about this error, try `rustc --explain E0491`.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@scalexm
Copy link
Member Author

scalexm commented Oct 16, 2018

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Oct 16, 2018

📌 Commit 0684ead65930bd8b24f0e9779e0db3d35d17760b has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2018
@bors
Copy link
Contributor

bors commented Oct 17, 2018

☔ The latest upstream changes (presumably #55093) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 17, 2018
@scalexm
Copy link
Member Author

scalexm commented Oct 17, 2018

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Oct 17, 2018

📌 Commit 55ce7a2 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 17, 2018
@bors
Copy link
Contributor

bors commented Oct 19, 2018

⌛ Testing commit 55ce7a2 with merge dbab381...

bors added a commit that referenced this pull request Oct 19, 2018
Replace `ParamEnv` with a new type in chalk context.

I left a few FIXMEs.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Oct 19, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing dbab381 to master...

@bors bors merged commit 55ce7a2 into rust-lang:master Oct 19, 2018
@scalexm scalexm deleted the param-env branch October 22, 2018 12:17
@tmandry tmandry added the WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804 label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants