Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLift TypeFoldable over Result and remove the Relate hack in combine/nll #58333
Conversation
rust-highfive
assigned
nikomatsakis
Feb 9, 2019
rust-highfive
added
the
S-waiting-on-review
label
Feb 9, 2019
arielb1
force-pushed the
arielb1:fold-result
branch
from
883e93b
to
410b54c
Feb 9, 2019
This comment has been minimized.
This comment has been minimized.
The job Click to expand the log.
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 |
This comment has been minimized.
This comment has been minimized.
|
arielb1
force-pushed the
arielb1:fold-result
branch
from
23f4f47
to
7abc7ed
Feb 12, 2019
This comment has been minimized.
This comment has been minimized.
I'll check that this doesn't hurt perf @bors try |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Feb 13, 2019
nikomatsakis
approved these changes
Feb 13, 2019
r=me |
#[inline] | ||
/// If `false` - the default - then `ty::Invariant` might be used instead of the | ||
/// correct variance when folding an item with a variance. | ||
|
This comment has been minimized.
This comment has been minimized.
|
||
/// Otherwise, the correct variance is looked up from the tcx, which can | ||
/// be a performance and cycle hazard. | ||
fn use_variances(&self) -> bool { |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
Feb 13, 2019
Contributor
This seems ok, but also error-prone. i.e., if somebody forgets to make use_variances
be true, we'll have a problem. It might be worth thinking if we can turn that into a dynamic assertion or something. But I don't obviously see how to do that with this setup as in this PR -- I was imagining that if the variance was tracked in a field, then accessing it could assert that use_variances
is true or something...
This comment has been minimized.
This comment has been minimized.
arielb1
Feb 16, 2019
•
Author
Contributor
I could make variances
an Option
, but t hen the users would need to handle that. I think that forgetting to use use_variances
would cause fairly visible errors, however, so I don't think this is a large risk.
fn a_is_expected(&self) -> bool { | ||
true | ||
fn use_variances(&self) -> bool { | ||
if self.ambient_variance == ty::Variance::Invariant { |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
Feb 13, 2019
Contributor
So, in the branches that I was working on, I made the folder track the ambient variance iirc. I don't however remember exactly how I did this =)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
@rust-timer build 258c318 |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Feb 16, 2019
Insufficient permissions to issue commands to rust-timer. |
This comment has been minimized.
This comment has been minimized.
Could someone with perfbot permissions give me a rust-timer build? |
This comment has been minimized.
This comment has been minimized.
@rust-timer build 258c318 |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Feb 16, 2019
Success: Queued 258c318 with parent e544947, comparison URL. |
arielb1
added some commits
Feb 7, 2019
arielb1
force-pushed the
arielb1:fold-result
branch
from
7abc7ed
to
090f21e
Feb 16, 2019
This comment has been minimized.
This comment has been minimized.
I'm poking with the fairly hot |
This comment has been minimized.
This comment has been minimized.
@bors try |
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Feb 16, 2019
This comment has been minimized.
This comment has been minimized.
Bad github, deleting my test results like that, now I need another try |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Feb 16, 2019
Finished benchmarking try commit 258c318 |
This comment has been minimized.
This comment has been minimized.
Serde is very red in this PR (24%!). Need to investigate why. |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
@rust-timer build c5e0b61 |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Feb 17, 2019
Success: Queued c5e0b61 with parent eac0908, comparison URL. |
This comment has been minimized.
This comment has been minimized.
rust-timer
commented
Feb 17, 2019
Finished benchmarking try commit c5e0b61 |
arielb1 commentedFeb 9, 2019
No functional changes intended - just a cleanup.
r? @nikomatsakis