-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add existential type definitions #51414
Conversation
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 |
763eec8
to
065b7cb
Compare
065b7cb
to
9b1bd94
Compare
@@ -284,7 +284,7 @@ pub fn change_return_impl_trait() -> impl Clone { | |||
} | |||
|
|||
#[cfg(not(cfail1))] | |||
#[rustc_clean(cfg = "cfail2", except = "Hir, HirBody")] | |||
#[rustc_clean(cfg = "cfail2")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is the only change that I worry about. Not sure what's going on here. cc @michaelwoerister
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you ever get resolution as to why this change is necessary and whether it is safe to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Hir
is clean, because we now store just a NodeId
and a DefId
to the existential type
declaration. If you change the trait of the impl Trait
, those ids won't change. If changing the type of a type alias has the same effect on the incremental cache, then this change is fine, if not, then it's probably not fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this on irc https://botbot.me/mozilla/rustc/2018-06-18/?msg=101231153&page=1 his is fine as it is. The HIR does indeed not change anymore, but later queries will get retriggered because the HIR of the desugared existential type
item has changed
cc @pnkfelix |
r? @pnkfelix |
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 |
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 |
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 |
245b4d6
to
adec1f9
Compare
Ping from triage @pnkfelix! This PR needs your review. |
@oli-obk this seems fine to me. I now remember that @michaelwoerister may be out of contact for a little while. I'm personally okay with taking the risk of landing this even without having resolved the question of what is going on in that test you had to change. So I'm going to tell bors to go ahead and land it. |
@bors r+ |
📌 Commit adec1f9 has been approved by |
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
☀️ Test successful - status-appveyor, status-travis |
This PR regressed the compile speed of the
@oli-obk: Do you know why this might be? Can you investigate? |
CC @rust-lang/wg-compiler-performance |
@@ -123,6 +123,11 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx | |||
let generic_ty = self.tcx().type_of(def_id); | |||
let concrete_ty = generic_ty.subst(self.tcx(), substs); | |||
self.anon_depth += 1; | |||
if concrete_ty == ty { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sanity check is on a hot path. I'll change it to a debug assert
async/await This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: #50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3. Based on #51414. cc @petrochenkov for parsing changes. r? @eddyb
Note: this does not allow creating named existential types, it just desugars
impl Trait
to a less (but still very) hacky version of actualexistential type
items.r? @nikomatsakis