@@ -14,5 +14,45 @@ LL | arg.map(|v| &**v)
14
14
| ++++++++++++++
15
15
16
16
error: aborting due to 1 previous error
17
+ --> $DIR/transforming-option-ref-issue-127545.rs:9:19
18
+ |
19
+ LL | arg.unwrap_or(&[])
20
+ | --------- ^^^ expected `&Vec<i32>`, found `&[_; 0]`
21
+ | |
22
+ | arguments to this method are incorrect
23
+ |
24
+ = note: expected reference `&Vec<i32>`
25
+ found reference `&[_; 0]`
26
+ help: the return type of this call is `&[_; 0]` due to the type of the argument passed
27
+ --> $DIR/transforming-option-ref-issue-127545.rs:9:5
28
+ |
29
+ LL | arg.unwrap_or(&[])
30
+ | ^^^^^^^^^^^^^^---^
31
+ | |
32
+ | this argument influences the return type of `unwrap_or`
33
+ note: method defined here
34
+ --> $SRC_DIR/core/src/option.rs:LL:COL
35
+
36
+ error[E0308]: mismatched types
37
+ --> $DIR/transforming-option-ref-issue-127545.rs:13:19
38
+ |
39
+ LL | arg.unwrap_or(v)
40
+ | --------- ^ expected `&Vec<i32>`, found `&[i32]`
41
+ | |
42
+ | arguments to this method are incorrect
43
+ |
44
+ = note: expected reference `&Vec<i32>`
45
+ found reference `&'a [i32]`
46
+ help: the return type of this call is `&'a [i32]` due to the type of the argument passed
47
+ --> $DIR/transforming-option-ref-issue-127545.rs:13:5
48
+ |
49
+ LL | arg.unwrap_or(v)
50
+ | ^^^^^^^^^^^^^^-^
51
+ | |
52
+ | this argument influences the return type of `unwrap_or`
53
+ note: method defined here
54
+ --> $SRC_DIR/core/src/option.rs:LL:COL
55
+
56
+ error: aborting due to 3 previous errors
17
57
18
58
For more information about this error, try `rustc --explain E0308`.
0 commit comments