-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
When needing type annotations in local bindings, account for impl Trait and closures #63507
Conversation
…it and closures Do not suggest nonsensical types when the type inference is failing on `impl Trait` or anonymous closures.
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @Centril |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
When encountering a boxed value as expected and a stack allocated value that could be boxed to fulfill the expectation, like in the following snippet, suggest `Box::new` wrapping.
c96135e
to
fb2511c
Compare
src/test/ui/inference/cannot-infer-async-enabled-impl-trait-bindings.stderr
Show resolved
Hide resolved
Thanks! r=me with ^--- addressed :) |
@bors r=Centril |
📌 Commit 939c1cb has been approved by |
@estebank I'm fine with either... ;) |
The code makes sense but could use a bit of refactoring so the method isn't too overwhelming to read. I've suggested some ways to fix that ^--- r=me with those addressed. |
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.
Thanks! r=me :)
@bors r=Centril |
📌 Commit 6c3a98e has been approved by |
…ntril When needing type annotations in local bindings, account for impl Trait and closures Fix rust-lang#46680, fix rust-lang#63504, fix rust-lang#63506, fix rust-lang#40014, cc rust-lang#63502.
Rollup of 11 pull requests Successful merges: - #62984 (Add lint for excess trailing semicolons) - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`) - #63490 (libsyntax: cleanup and refactor `pat.rs`) - #63507 (When needing type annotations in local bindings, account for impl Trait and closures) - #63509 (Point at the right enclosing scope when using `await` in non-async fn) - #63528 (syntax: Remove `DummyResult::expr_only`) - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`) - #63542 (Add NodeId for Arm, Field and FieldPat) - #63543 (Merge Variant and Variant_) - #63560 (move test that shouldn't be in test/run-pass/) - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates) Failed merges: r? @ghost
Fix #46680, fix #63504, fix #63506, fix #40014, cc #63502.