Compiler doesn't recognize existing #[derive(Clone)]
and suggests to add it
#122750
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Example on Rust playground
I expected to see this happen: Since
Dynamic<T>
has a#[derive(Clone)]
I'd expect it to implementClone
, and the code to compile.Instead, this happened: The code doesn't compile. The compiler claims
Dynamic<T>
does not implementClone
and suggests that I should add a#[derive(Clone)]
exactly at where it already is. The exact error is:Meta
rustc --version --verbose
:Related issues
I spend a while searching for existing issues, expecting that there probably is already an open issue for that. I found these issue which seem the have a connection, but still didn't manifest exactly the same:
Clone
bound suggestion #110446The text was updated successfully, but these errors were encountered: