cargo-semver-checks icon indicating copy to clipboard operation
cargo-semver-checks copied to clipboard

Add lint for trait default impl removed

Open dmatos2012 opened this issue 6 months ago • 2 comments

Should add another lint for #870, particularly non-sealed trait removed a default impl for a trait method. Fixes #294.

I am not sure if the object_safe @filter(op: "=", value: ["$true"]) line is needed, since otherwise it would raise another lint. I thought that it could be a False Positive, since at least if i try it locally, I only get the warning if it returns Self, like so:

struct Test;
pub trait Trait {
    // fn method(&self) -> Self; #cargo complains about trait obj safety
    fn method(&self); # cargo is fine with it
}
impl Trait for Test {}

Anyways, otherwise any feedback happy to change. Thanks!

dmatos2012 avatar Aug 22 '24 20:08 dmatos2012