Take advantage of negative_impls in error messages #79683
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
F-negative_impls
#![feature(negative_impls)]
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
(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=6c22f56bb7cfec1e8e04a79fc078cdd6:
Which of course fails to compile. And it gives the following:
It would be nice to take advantage of the negative implementation to not say "perhaps you need to implement it" and in fact to say that it explicitly is not implemented. Other good similar cases would be things like
Foo::foo(&x)
.(This is a follow-up issue to #79458, as the bug part was fixed, so this is the lower-priority improvement part.)
cc #68318
The text was updated successfully, but these errors were encountered: