Remove some test warnings.#17106
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 9, 2014
treeman:test-warnings
Merged
Conversation
Member
|
I don't see any reason to remove tests for deprecated items until the items themselves are removed. |
Contributor
Author
|
Fair point @sfackler. Rebased with silenced deprecation warnings instead. |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Sep 9, 2014
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
May 26, 2024
…ail-return-expr, r=Veykril Fix: infer type of async block with tail return expr Fixes rust-lang#17106 The `infer_async_block` method calls the `infer_block` method internally, which returns the never type without coercion when `tail_expr` is `None` and `ctx.diverges` is `Diverges::Always`.This is the reason for the bug in this issue. https://github.com/rust-lang/rust-analyzer/blob/cfce2bb46da62950a8b70ddb0b2a12332da1b1e1/crates/hir-ty/src/infer/expr.rs#L1411-L1413 This PR solves the bug by adding a process to coerce after calling `infer_block` method. This code passes all the tests, including tests I added for this isuue, however, I am not sure if this solution is right. I think that this solution is an ad hoc solution. So, I would appreciate to have your review. I apologize if I'm off the mark, but `infer_async_block` method should be rewritten to share code with the process of infering type of `expr::Closure` instead of the `infer_block` method. That way it will be closer to the infer process of rustc.
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.
Also removed some tests for deprecated items. Unsure if it's the right thing to do?