Uh oh!
There was an error while loading. Please reload this page.
impl trait in bindings (feature: impl-trait-existential-types) - #53542
Conversation
alexreg
commented
Aug 20, 2018
Seems to be blocked on #53469 at the moment. |
Uh oh!
There was an error while loading. Please reload this page.
rust-highfive
commented
Aug 20, 2018
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 |
alexreg
commented
Aug 21, 2018
rust-highfive
commented
Aug 21, 2018
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 |
oli-obk
commented
Aug 21, 2018
I don't see anything in the errors. All I see is some diagnostic message changes. Can you bless those and give me some more info? |
@oli-obk You're right. I was too cursory in looking at those. Are the changes a bad thing necessarily? I'm not sure how I even caused them. Anyway, do please elaborate on how I can give you more info. |
rust-highfive
commented
Aug 21, 2018
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 |
bors
commented
Aug 23, 2018
☔ The latest upstream changes (presumably #53384) made this pull request unmergeable. Please resolve the merge conflicts. |
@oli-obk@eddyb Feedback would be greatly appreciated at this point. I get this error now: The test file is simply: fnmain(){let x:implPartialEq<i32> = 123_i32;}Note that if instead of the following line in code: let c_ty = self.fcx.inh.infcx.canonicalize_response(&o_ty);I do this: let c_ty = self.fcx.inh.infcx.canonicalize_response(&revealed_ty);then things work, although |
rust-highfive
commented
Aug 30, 2018
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 |
oli-obk
commented
Aug 30, 2018
I think the error you were getting was related to the initializer value of |
oli-obk
commented
Aug 30, 2018
also: your rebase has gone very wrong |
alexreg
commented
Sep 3, 2018
rust-highfive
commented
Sep 3, 2018
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 |
There was a problem hiding this comment.
I think you need to track both o_ty and revealed_ty here, and add a special check so that assigning to the variable is only allowed with revealed_ty and reading from the variable is only allowed with o_ty.
There was a problem hiding this comment.
Probably very related to what the assign method on self does.
There was a problem hiding this comment.
Good idea. It occurred to me before in fact, but I was hoping there may be a simpler way... I think you're right in that it's necessary though.
alexreg
commented
Sep 4, 2018
@oli-obk New WIP version pushed. The problem seems to be that |
rust-highfive
commented
Sep 4, 2018
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 |
alexreg
commented
Sep 5, 2018
Okay, this is my declaration that I'm officially giving up on this, at least until someone provides in @rust-lang/lang provides can provide proper mentorship. (I thank @oli-obk for his efforts to guide me so far, but I'm afraid I need more low-level guidance. MIR officially makes everything here an unholy mess, which I don't see any way around.) e.g. The current main obstacle is this error: |
rust-highfive
commented
Sep 5, 2018
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 |
rust-highfive
commented
Sep 9, 2018
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 |
1 similar comment
rust-highfive
commented
Sep 9, 2018
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 |
rust-highfive
commented
Sep 10, 2018
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 |
bors
commented
Sep 10, 2018
☔ The latest upstream changes (presumably #54000) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Is this line needed/right, @oli-obk? If so, is traits::SizedReturnType the right value of argument to pass?
There was a problem hiding this comment.
The line is needed. not sure about the third arg, what other values are possible?
There was a problem hiding this comment.
@cramertj Advice on this, specifically the value of the third arg?
There was a problem hiding this comment.
This looks correct to me.
Edit: scratch that-- after looking further, I don't think we need this? @oli-obk why do we need to force that the type of the local is sized? Is this just to prevent unsized locals? I'd think that whatever existing protections we have against unsized rvalues would be sufficient there (especially since we're now working to allow unsized rvalues).
@oli-obk Latest version looking pretty good now. Just three failures, and I think two are nothing to do with me (could be happening on nightly?). Do you have any idea about the source of the |
rust-highfive
commented
Sep 24, 2018
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 |
rust-highfive
commented
Sep 24, 2018
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 |
rust-highfive
commented
Sep 24, 2018
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 |
rust-highfive
commented
Sep 24, 2018
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 |
alexreg
commented
Sep 25, 2018
@Aaronepower This is no longer blocked. |
alexreg
commented
Sep 25, 2018
@cramertj All tests passing. LGTM! |
| @@ -0,0 +1,35 @@ | |||
| error[E0434]: can't capture dynamic environment in a fn item | |||
There was a problem hiding this comment.
Nit: these error messages are pretty misleading. Can you open an issue about improving these?
There was a problem hiding this comment.
I agree, it could definitely be clearer. I figured out what it meant immediately, but probably only because I've been working on this for a while. Will open an issue now.
cramertj
commented
Sep 25, 2018
Awesome! Looks good apart from the one error message, but we can tackle that in a followup. @bors r+ |
bors
commented
Sep 25, 2018
📌 Commit 16cf404 has been approved by |
alexreg
commented
Sep 25, 2018
@cramertj Okay great, thanks! |
bors
commented
Sep 25, 2018
`impl trait` in bindings (feature: impl-trait-existential-types) This PR enables `impl Trait` syntax (opaque types) to be used in bindings, e.g. * `let foo: impl Clone = 1;` * `static foo: impl Clone = 2;` * `const foo: impl Clone = 3;` This is part of [RFC 2071](https://github.com/rust-lang/rfcs/blob/master/text/2071-impl-trait-existential-types.md) ([tracking issue](#34511)), but exists behind the separate feature gate `impl_trait_in_bindings`. CC @cramertj@oli-obk@eddyb@Centril@varkor
bors
commented
Sep 25, 2018
☀️ Test successful - status-appveyor, status-travis |
cc @nikomatsakis I believe this PR caused #54593, can you take a look at the NLL changes? |
| ) | ||
| } | ||
| fn sub_types_or_anon( |
There was a problem hiding this comment.
Is "anon" here supposed to be opaque?
There was a problem hiding this comment.
Anyway this PR is already merged, so best to open a new one with these changes.
| fn eq_opaque_type_and_type( | ||
| &mut self, | ||
| revealed_ty: Ty<'tcx>, | ||
| anon_ty: Ty<'tcx>, |
There was a problem hiding this comment.
I think anon_ty as a parameter name fits in with the naming scheme elsewhere, but not sure...
There was a problem hiding this comment.
That naming scheme probably got missed by the anon -> opaque mass rename.
| None => return Ok(()), | ||
| }; | ||
| // Finally, if we instantiated the anon types successfully, we |
This PR enables
impl Traitsyntax (opaque types) to be used in bindings, e.g.let foo: impl Clone = 1;static foo: impl Clone = 2;const foo: impl Clone = 3;This is part of RFC 2071 (tracking issue), but exists behind the separate feature gate
impl_trait_in_bindings.CC @cramertj@oli-obk@eddyb@Centril@varkor