Open
Description
fn foo(
mut x: &(),
y: &(),
) {
x = y;
}
gives the error:
error[E0623]: lifetime mismatch
--> src/lib.rs:5:9
|
2 | mut x: &(),
| ---
3 | y: &(),
| --- these two types are declared with different lifetimes...
4 | ) {
5 | x = y;
| ^ ...but data from `y` flows into `x` here
but does not suggest the solution: adding a new lifetime parameter 'a
to foo
and giving both variables the same lifetime.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Category: An issue proposing an enhancement or a PR with one.Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.