6 fn with_to_string(x : &str) {
7 x != "foo".to_string();
8 //~^ ERROR this creates an owned instance just for comparison. Consider using `x != "foo"` to compare without allocation
10 "foo".to_string() != x;
11 //~^ ERROR this creates an owned instance just for comparison. Consider using `"foo" != x` to compare without allocation
18 x != "foo".to_owned(); //~ERROR this creates an owned instance
20 // removed String::from_str(..), as it has finally been removed in 1.4.0
23 x != String::from("foo"); //~ERROR this creates an owned instance
25 42.to_string() == "42";