Skip to content

Remove some test warnings. #17106

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 9, 2014
Merged

Remove some test warnings. #17106

merged 1 commit into from
Sep 9, 2014

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Sep 8, 2014

Also removed some tests for deprecated items. Unsure if it's the right thing to do?

@sfackler
Copy link
Member

sfackler commented Sep 9, 2014

I don't see any reason to remove tests for deprecated items until the items themselves are removed.

@treeman
Copy link
Contributor Author

treeman commented Sep 9, 2014

Fair point @sfackler. Rebased with silenced deprecation warnings instead.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Sep 9, 2014
@bors bors merged commit 947a1b9 into rust-lang:master Sep 9, 2014
@treeman treeman deleted the test-warnings branch September 10, 2014 05:16
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.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants