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

on-demand-ify custom_coerce_unsized_kind and inherent-impls #40683

Merged
merged 3 commits into from
Mar 29, 2017

Conversation

nikomatsakis
Copy link
Contributor

This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of CoerceUnsized; invoking it on any other kind of impl results in a bug. This is just to avoid having an Option, could easily be changed.

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Mar 20, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Mar 20, 2017

📌 Commit 8effa01 has been approved by eddyb

@bors
Copy link
Contributor

bors commented Mar 20, 2017

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

@nikomatsakis nikomatsakis changed the title convert custom_coerce_unsized_kind into a coerce_unsized_info on-demand-ify custom_coerce_unsized_kind and inherent-impls Mar 20, 2017
@nikomatsakis
Copy link
Contributor Author

@eddyb -- I added another commit, converting inherent-impl things.

r? on those commits.

let mut collect = InherentCollect { tcx };
krate.visit_all_item_likes(&mut collect);

herent
Copy link
Member

Choose a reason for hiding this comment

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

What's this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, what is that? weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, that file never got removed...it was supposed to be.

match self_ty.sty {
ty::TyAdt(def, _) => {
self.check_def_id(item, def.did);
}
Copy link
Member

Choose a reason for hiding this comment

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

This isn't moved from anywhere else?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is, not sure why git didn't figure it out. I split up inherent.rs into two files, since it was doing two things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I could keep it together. Might be cleaner diff.

Copy link
Member

Choose a reason for hiding this comment

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

What I mean is, you don't have a negative diff on inherent.rs matching the positive diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it's because inherent.rs is all dead now. just pushed a revised version which deleted it.

@nikomatsakis
Copy link
Contributor Author

@eddyb r? on the new changes

@eddyb
Copy link
Member

eddyb commented Mar 22, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Mar 22, 2017

📌 Commit ba85dc7 has been approved by eddyb

@bors
Copy link
Contributor

bors commented Mar 23, 2017

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

This "on-demand" task both checks for errors and computes the custom
unsized kind, if any. This task is only defined on impls of
`CoerceUnsized`; invoking it on any other kind of impl results in a bug.
This is just to avoid having an `Option`, could easily be changed.
There are now 3 queries:

- inherent_impls(def-id): for a given type, get a `Rc<Vec<DefId>>` with
  all its inherent impls. This internally uses `crate_inherent_impls`,
  doing some hacks to keep the current deps (which, btw, are not clearly
  correct).
- crate_inherent_impls(crate): gathers up a map from types
  to `Rc<Vec<DefId>>`, touching the entire krate, possibly generating
  errors.
- crate_inherent_impls_overlap_check(crate): performs overlap checks
  between the inherent impls for a given type, generating errors.
@nikomatsakis
Copy link
Contributor Author

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Mar 23, 2017

📌 Commit a29ae30 has been approved by eddyb

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 25, 2017
…ed-info, r=eddyb

on-demand-ify `custom_coerce_unsized_kind` and `inherent-impls`

This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of `CoerceUnsized`; invoking it on any other kind of impl results in a bug. This is just to avoid having an `Option`, could easily be changed.

r? @eddyb
bors added a commit that referenced this pull request Mar 25, 2017
Rollup of 11 pull requests

- Successful merges: #40347, #40501, #40516, #40524, #40540, #40642, #40683, #40764, #40778, #40807, #40809
- Failed merges: #40771
bors added a commit that referenced this pull request Mar 25, 2017
Rollup of 11 pull requests

- Successful merges: #40347, #40501, #40516, #40524, #40540, #40642, #40683, #40764, #40778, #40807, #40809
- Failed merges: #40771
@bors
Copy link
Contributor

bors commented Mar 25, 2017

⌛ Testing commit a29ae30 with merge 774298f...

@bors
Copy link
Contributor

bors commented Mar 25, 2017

💔 Test failed - status-travis

@arielb1
Copy link
Contributor

arielb1 commented Mar 25, 2017

@bors
Copy link
Contributor

bors commented Mar 25, 2017

⌛ Testing commit a29ae30 with merge a7890df...

@bors
Copy link
Contributor

bors commented Mar 25, 2017

💔 Test failed - status-travis

@arielb1
Copy link
Contributor

arielb1 commented Mar 25, 2017

@bors
Copy link
Contributor

bors commented Mar 25, 2017

⌛ Testing commit a29ae30 with merge 63c826f...

@bors
Copy link
Contributor

bors commented Mar 25, 2017

💔 Test failed - status-travis

@arielb1
Copy link
Contributor

arielb1 commented Mar 25, 2017

@bors
Copy link
Contributor

bors commented Mar 26, 2017

⌛ Testing commit a29ae30 with merge 68c387c...

@bors
Copy link
Contributor

bors commented Mar 26, 2017

💔 Test failed - status-appveyor

@nikomatsakis
Copy link
Contributor Author

Error in gdb. Seems unlikely to be related to this PR, but not impossible.

@nikomatsakis
Copy link
Contributor Author

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 27, 2017
…ed-info, r=eddyb

on-demand-ify `custom_coerce_unsized_kind` and `inherent-impls`

This "on-demand" task both checks for errors and computes the custom unsized kind, if any. This task is only defined on impls of `CoerceUnsized`; invoking it on any other kind of impl results in a bug. This is just to avoid having an `Option`, could easily be changed.

r? @eddyb
bors added a commit that referenced this pull request Mar 27, 2017
bors added a commit that referenced this pull request Mar 28, 2017
@bors bors merged commit a29ae30 into rust-lang:master Mar 29, 2017
@nikomatsakis nikomatsakis deleted the incr-comp-coerce-unsized-info branch April 14, 2017 10:12
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.

4 participants