1 error[E0308]: mismatched types
2 --> $DIR/copied-and-cloned.rs:7:26
4 LL | expect::<Option<()>>(x);
5 | -------------------- ^ expected `()`, found `&()`
7 | arguments to this function are incorrect
9 = note: expected enum `Option<()>`
10 found enum `Option<&()>`
11 note: function defined here
12 --> $DIR/copied-and-cloned.rs:3:4
14 LL | fn expect<T>(_: T) {}
16 help: use `Option::copied` to copy the value inside the `Option`
18 LL | expect::<Option<()>>(x.copied());
21 error[E0308]: mismatched types
22 --> $DIR/copied-and-cloned.rs:11:30
24 LL | expect::<Result<(), ()>>(x);
25 | ------------------------ ^ expected `()`, found `&()`
27 | arguments to this function are incorrect
29 = note: expected enum `Result<(), ()>`
30 found enum `Result<&(), _>`
31 note: function defined here
32 --> $DIR/copied-and-cloned.rs:3:4
34 LL | fn expect<T>(_: T) {}
36 help: use `Result::copied` to copy the value inside the `Result`
38 LL | expect::<Result<(), ()>>(x.copied());
41 error[E0308]: mismatched types
42 --> $DIR/copied-and-cloned.rs:16:30
44 LL | expect::<Option<String>>(x);
45 | ------------------------ ^ expected struct `String`, found `&String`
47 | arguments to this function are incorrect
49 = note: expected enum `Option<String>`
50 found enum `Option<&String>`
51 note: function defined here
52 --> $DIR/copied-and-cloned.rs:3:4
54 LL | fn expect<T>(_: T) {}
56 help: use `Option::cloned` to clone the value inside the `Option`
58 LL | expect::<Option<String>>(x.cloned());
61 error[E0308]: mismatched types
62 --> $DIR/copied-and-cloned.rs:20:34
64 LL | expect::<Result<String, ()>>(x);
65 | ---------------------------- ^ expected struct `String`, found `&String`
67 | arguments to this function are incorrect
69 = note: expected enum `Result<String, ()>`
70 found enum `Result<&String, _>`
71 note: function defined here
72 --> $DIR/copied-and-cloned.rs:3:4
74 LL | fn expect<T>(_: T) {}
76 help: use `Result::cloned` to clone the value inside the `Result`
78 LL | expect::<Result<String, ()>>(x.cloned());
81 error: aborting due to 4 previous errors
83 For more information about this error, try `rustc --explain E0308`.