blob: 711fbca1c8d2888a2cd33d26b9417015985678bf [file] [log] [blame]
use std::fmt::{self, Display};
fn main() {
let a = Foo;
if a != "bar" {
//~^ cmp_owned
println!("foo");
}
if a != "bar" {
//~^ cmp_owned
println!("foo");
}
}
struct Foo;
impl Display for Foo {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "foo")
}
}
impl PartialEq<&str> for Foo {
fn eq(&self, other: &&str) -> bool {
"foo" == *other
}
}