rust/tests/ui/suggestions/suggest-remove-deref.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
364 B
Rust
Raw Normal View History

// run-rustfix
//issue #106496
struct S;
trait X {}
impl X for S {}
fn foo<T: X>(_: &T) {}
fn test_foo() {
let hello = &S;
foo(hello);
//~^ ERROR mismatched types
}
fn bar(_: &String) {}
fn test_bar() {
let v = String::from("hello");
let s = &v;
bar(s);
//~^ ERROR mismatched types
}
fn main() {
test_foo();
test_bar();
}