summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs
blob: 48efdb82c46ca6bd67688cc3e87047c18923d595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[derive(Clone)]
struct S;

// without Clone
struct T;

fn foo(_: S) {}

fn test1() {
    let s = &S;
    foo(s); //~ ERROR mismatched types
}

fn bar(_: T) {}
fn test2() {
    let t = &T;
    bar(t); //~ ERROR mismatched types
}

fn main() {
    test1();
    test2();
}