Properly suggest deref in else block#79755
Properly suggest deref in else block#79755mibac138 wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
r? @davidtwco maybe? |
|
Can you add a test for this as well? fn main() {
let a = &1;
let b = &2;
let val = if true {
*a
} else if true {
b
} else {
&0
};
}Current output: |
| false | ||
| } | ||
|
|
||
| crate fn hir_id_sole_block_element(&self, hir_id: hir::HirId) -> Option<&'tcx hir::Expr<'tcx>> { |
There was a problem hiding this comment.
| crate fn hir_id_sole_block_element(&self, hir_id: hir::HirId) -> Option<&'tcx hir::Expr<'tcx>> { | |
| crate fn maybe_get_block_expr(&self, hir_id: hir::HirId) -> Option<&'tcx hir::Expr<'tcx>> { |
Could you add a doc comment too?
|
@mibac138 Ping from triage can you please address the comments from the reviewer? |
|
@mibac138 Ping from triage: any updates on this? |
|
Triage: |
|
I can push this to the finish line |
…twco Properly suggest deref in else block Continues rust-lang#79755, fixes rust-lang#79736 r? `@davidtwco`
Fixes #79736