Closed
Description
(Spotted in https://users.rust-lang.org/t/the-trait-clone-is-not-implemented-for-mut-t/51989?u=scottmcm)
I tried this code https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6862c5bd66f1fcdf55fd725a93baffcd:
#[derive(Clone)]
struct Foo<'a, T> {
x: &'a mut T,
}
Which of course fails to compile, but it gives the following confusing help:
= help: the following implementations were found:
<&T as Clone>
<&mut T as Clone>
The library now has impl<'_, T> !Clone for &'_ mut T
, so it looks like this error-generation code path needs to be updated to account for that.
Ideally it'd take advantage of the explicit negative here to say that it's not clone and has been promised that it never will be, but at the very least is shouldn't be showing <&mut T as Clone>
which makes it look like it's actually Clone
.
cc #68318