]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs
Account for method call and indexing when looking for inner-most path in expression
[rust.git] / tests / ui / suggestions / issue-106443-sugg-clone-for-arg.rs
1 #[derive(Clone)]
2 struct S;
3
4 // without Clone
5 struct T;
6
7 fn foo(_: S) {}
8
9 fn test1() {
10     let s = &S;
11     foo(s); //~ ERROR mismatched types
12 }
13
14 fn bar(_: T) {}
15 fn test2() {
16     let t = &T;
17     bar(t); //~ ERROR mismatched types
18 }
19
20 fn main() {
21     test1();
22     test2();
23 }