summaryrefslogtreecommitdiff
path: root/tests/ui/suggestions/suggest-remove-deref.fixed
blob: d056f9e1f3677b612b9d08a0c369d4654bc47c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//@ 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();
}