When needing type annotations in local bindings, account for impl Trait and closures#63507
Merged
bors merged 7 commits intorust-lang:masterfrom Aug 15, 2019
Merged
Conversation
…it and closures Do not suggest nonsensical types when the type inference is failing on `impl Trait` or anonymous closures.
Contributor
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
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
Centril
reviewed
Aug 13, 2019
src/test/ui/inference/cannot-infer-async-enabled-impl-trait-bindings.stderr
Show resolved
Hide resolved
Contributor
|
Thanks! r=me with ^--- addressed :) |
This was referenced Aug 13, 2019
Contributor
Author
|
@bors r=Centril |
Collaborator
|
📌 Commit 939c1cb has been approved by |
Contributor
Author
Contributor
|
@estebank I'm fine with either... ;) |
Contributor
Author
estebank
commented
Aug 13, 2019
Centril
reviewed
Aug 14, 2019
Contributor
|
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. |
Contributor
Author
|
@bors r=Centril |
Collaborator
|
📌 Commit 6c3a98e has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Aug 14, 2019
…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.
bors
added a commit
that referenced
this pull request
Aug 15, 2019
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #46680, fix #63504, fix #63506, fix #40014, cc #63502.