-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Suggest remove deref for type mismatch #107203
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 remove deref for type mismatch #107203
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
There are a few other instances of "consider removing the borrow" in this function that I think use span-to-snippet instead of looking at the HIR. Do you mind investigating those and migrating those too? It's alright if you don't want to. |
@rustbot author Pls mark as ready-to-review if you don't want to apply the suggestion. |
sure, I will take a look at it.
Michael Goulet ***@***.***> 于 2023年1月23日周一 00:51写道:
… There are a few other instances of "consider removing the borrow" in this
function that I think use span-to-snippet instead of looking at the HIR. Do
you mind investigating those and migrating those too? It's alright if you
don't want to.
—
Reply to this email directly, view it on GitHub
<#107203 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABYJ5USBH5S4GR2SEZJSHLWTVQSJANCNFSM6AAAAAAUDCK25I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm not quite understand your meaning, you mean this part? rust/compiler/rustc_hir_typeck/src/demand.rs Lines 1304 to 1341 in 2aa5555
I go through the rust/compiler/rustc_hir_typeck/src/demand.rs Lines 1272 to 1286 in 2aa5555
|
Oh, never mind. Ignore this then. |
I think this is fine to merge as-is then. @bors r+ |
@@ -1233,6 +1233,22 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
sugg_sp = receiver.span; | |||
} | |||
} | |||
|
|||
if let hir::ExprKind::Unary(hir::UnOp::Deref, ref inner) = expr.kind |
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.
it would be nice to generalize this to multiple "&&" but whatever, this seems like a very common case already!
Rollup of 7 pull requests Successful merges: - rust-lang#104926 (Move relationships from FulfillmentContext to Inherited) - rust-lang#106854 (Add `Arc::into_inner` for safely discarding `Arc`s without calling the destructor on the inner type.) - rust-lang#107108 (Consider doc(alias) when providing typo suggestions) - rust-lang#107186 (rustdoc: Use correct pseudo-element selector) - rust-lang#107192 (Add myself to the mailmap) - rust-lang#107195 (Fix typo in universal_regions.rs comment) - rust-lang#107203 (Suggest remove deref for type mismatch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #106496