Uh oh!
There was an error while loading. Please reload this page.
Suggestion when encountering assoc types from hrtb - #69048
Conversation
rust-highfive
commented
Feb 11, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
estebank
commented
Feb 11, 2020
cc @nagisa |
There was a problem hiding this comment.
Hmm, this says "not representable", but you can still do things like:
pubtraitFoo<T>{typeA;fnget(&self,t:T) -> Self::A;}structSomeStruct<'a,I:for<'x>Foo<&'xisize>>{field: <IasFoo<&'aisize>>::A}And it’ll work fine, likely doing exactly what you’d expect?
There was a problem hiding this comment.
I'll have a follow up PR with only the logic for this suggestion, as it will be more involved.
Added a very hacky version of the appropriate suggestion that would require some extra logic to be always accurate, but as a first approach it LGTM.
Very cool overall! I think we should remove the "not representable" message for now (or implement an alternative suggestion) and r=me then. |
nagisa
commented
Feb 11, 2020
cc @eddyb |
When encountering E0212, detect whether this is a representable case or not, i.e. if it's happening on an `fn` or on an ADT. If the former, provide a structured suggestion, otherwise note that this can't be represented in Rust.
eddyb
commented
Feb 11, 2020
petrochenkov
commented
Feb 12, 2020
Could someone take this over? I have too many assigned PRs. |
nagisa
commented
Feb 13, 2020
@bors r+ |
bors
commented
Feb 13, 2020
📌 Commit bde9677 has been approved by |
Suggestion when encountering assoc types from hrtb When encountering E0212, detect whether this is a representable case or not, i.e. if it's happening on an `fn` or on an ADT. If the former, provide a structured suggestion, otherwise note that this can't be represented in Rust. Fixrust-lang#69000.
Rollup of 9 pull requests Successful merges: - #67642 (Relax bounds on HashMap/HashSet) - #68848 (Hasten macro parsing) - #69008 (Properly use parent generics for opaque types) - #69048 (Suggestion when encountering assoc types from hrtb) - #69049 (Optimize image sizes) - #69050 (Micro-optimize the heck out of LEB128 reading and writing.) - #69068 (Make the SGX arg cleanup implementation a NOP) - #69082 (When expecting `BoxFuture` and using `async {}`, suggest `Box::pin`) - #69104 (bootstrap: Configure cmake when building sanitizer runtimes) Failed merges: r? @ghost
…=ecstatic-morse Select an appropriate unused lifetime name in suggestion Follow up to rust-lang#69048.
…=ecstatic-morse Select an appropriate unused lifetime name in suggestion Follow up to rust-lang#69048.
When encountering E0212, detect whether this is a representable case or
not, i.e. if it's happening on an
fnor on an ADT. If the former,provide a structured suggestion, otherwise note that this can't be
represented in Rust.
Fix#69000.