-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest .into()
when all other coercion suggestions fail
#102496
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
r? diagnostics |
☔ The latest upstream changes (presumably #102545) made this pull request unmergeable. Please resolve the merge conflicts. |
vec![(expr.span.shrink_to_lo(), "(".to_owned()), (expr.span.shrink_to_hi(), ").into()".to_owned())] | ||
}; | ||
diag.multipart_suggestion( | ||
format!("call `into` on this expression to convert `{expr_ty}` into `{expected_ty}`"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format!("call `into` on this expression to convert `{expr_ty}` into `{expected_ty}`"), | |
format!("call `std::convert::Into::into` on this expression to convert `{expr_ty}` into `{expected_ty}`"), |
I agree with @lukaslueg that this might be clearer, maybe just Into::into
?
r=me after resolving comment |
f89cb48
to
6eb33f1
Compare
@bors r=davidtwco |
📌 Commit 6eb33f1f3221824f08f79893647e8672c7ef9e96 has been approved by It is now in the queue for this repository. |
…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
☔ The latest upstream changes (presumably #102644) made this pull request unmergeable. Please resolve the merge conflicts. |
6eb33f1
to
28eda9b
Compare
@bors r=davidtwco |
Rollup of 5 pull requests Successful merges: - rust-lang#100986 (Stop suggesting adding generic args for turbofish) - rust-lang#101061 (panic-on-uninit: adjust checks to 0x01-filling) - rust-lang#102440 (Only export `__tls_*` on wasm32-unknown-unknown.) - rust-lang#102496 (Suggest `.into()` when all other coercion suggestions fail) - rust-lang#102699 (Fix hamburger button color) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Also removes some bogus suggestions because we now short-circuit when offering coercion suggestions(instead of, for example, suggesting every one that could possibly apply)
Fixes #102415