Uh oh!
There was an error while loading. Please reload this page.
Suggest unwrap_or_else when a closure is given - #102441
Conversation
chenyukang
commented
Sep 28, 2022
May need more work to expand to suggest |
Uh oh!
There was an error while loading. Please reload this page.
fcc5a23 to
5c3a8e2CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bors
commented
Oct 1, 2022
☔ The latest upstream changes (presumably #102545) made this pull request unmergeable. Please resolve the merge conflicts. |
5c3a8e2 to
aebc5e1Compare
This comment has been minimized.
This comment has been minimized.
aebc5e1 to
5d69f3aCompare… to unwrap_or instead of suggesting calling it
5d69f3a to
f712c41CompareThere was a problem hiding this comment.
This doesn't need to be an argument. Can you inline the can_coerce call here by passing in expected: Ty<'tcx>?
There was a problem hiding this comment.
I think there is an expr_ty_opt version of this that doesn't ICE if the node is missing a type If so, then please use that, just in case.
There was a problem hiding this comment.
| fn_args.len() == args.len() +1{ | |
| fn_args.len() == args.len() +1{ |
There was a problem hiding this comment.
| let fn_ty = self.tcx.type_of(pick.item.def_id) && | |
| let fn_sig = fn_ty.fn_sig(self.tcx) && | |
| let fn_sig = self.tcx.fn_sig(pick.item.def_id) && |
compiler-errors
commented
Oct 3, 2022
Few more nits |
f712c41 to
0188273Comparechenyukang
commented
Oct 3, 2022
Fixed, thanks! |
compiler-errors
commented
Oct 4, 2022
Hm, this suggestion might have some false positives still, but this is probably ok... @bors r+ |
bors
commented
Oct 4, 2022
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#102441 (Suggest unwrap_or_else when a closure is given) - rust-lang#102547 (Migrate CSS theme for search results) - rust-lang#102567 (Delay evaluating lint primary message until after it would be suppressed) - rust-lang#102624 (rustdoc: remove font family CSS on `.rustdoc-toggle summary::before`) - rust-lang#102628 (Change the parameter name of From::from to `value`) - rust-lang#102637 (Ignore fuchsia on two compiler tests) - rust-lang#102639 (Improve spans when splitting multi-char operator tokens for proc macros.) Failed merges: - rust-lang#102496 (Suggest `.into()` when all other coercion suggestions fail) r? `@ghost` `@rustbot` modify labels: rollup
Fixes#102320
r? @compiler-errors