"Expected mutable reference &mut ()
, found mutable reference &mut ()
"
#117995
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Something that allows to distinguish the lifetimes.
I doubt this is a false compiler error, because the following compiles just fine:
Rationale and extra context
No response
Other cases
The output above is from
1.75.0-beta.1
.This is what
1.62.1
gives me:Which is even worse.
cargo-bisect-rustc
tells me the error message changed at some point during e3dfeea...900c354Anything else?
Initially I was trying to write a function like
RefMut::filter_map
, but forResult
instead ofOption
Came up with this piece of code:
& was trying to test that you cannot leak any
'a
data inE
. (That's where I was greeted with a similar error message saying it foundResult<_, &mut ...>
whereResult<_, &mut ...>
was expected.)Anyways, is this implementation actually sound or am I missing something?
If it's not, is it even possible to do something like this in Rust at all?
If it is okay, I would actually love to try to get this into
std
. Any tip on what I should start with in that case? An "RFC" thing or a simple PR?Thanks!
The text was updated successfully, but these errors were encountered: