1
1
error[E0308]: mismatched types
2
- --> $DIR/issue-127545- option-of- ref.rs:5:5
2
+ --> $DIR/transforming- option-ref-issue-127545 .rs:5:5
3
3
|
4
4
LL | pub fn foo(arg: Option<&Vec<i32>>) -> Option<&[i32]> {
5
5
| -------------- expected `Option<&[i32]>` because of return type
@@ -14,7 +14,7 @@ LL | arg.map(|v| &**v)
14
14
| ++++++++++++++
15
15
16
16
error[E0308]: mismatched types
17
- --> $DIR/issue-127545- option-of- ref.rs:9:19
17
+ --> $DIR/transforming- option-ref-issue-127545 .rs:9:19
18
18
|
19
19
LL | arg.unwrap_or(&[])
20
20
| --------- ^^^ expected `&Vec<i32>`, found `&[_; 0]`
@@ -24,7 +24,7 @@ LL | arg.unwrap_or(&[])
24
24
= note: expected reference `&Vec<i32>`
25
25
found reference `&[_; 0]`
26
26
help: the return type of this call is `&[_; 0]` due to the type of the argument passed
27
- --> $DIR/issue-127545- option-of- ref.rs:9:5
27
+ --> $DIR/transforming- option-ref-issue-127545 .rs:9:5
28
28
|
29
29
LL | arg.unwrap_or(&[])
30
30
| ^^^^^^^^^^^^^^---^
@@ -38,7 +38,7 @@ LL | arg.map_or(&[], |v| v)
38
38
| ~~~~~~~~~~~~~~~~~~
39
39
40
40
error[E0308]: mismatched types
41
- --> $DIR/issue-127545- option-of- ref.rs:13:19
41
+ --> $DIR/transforming- option-ref-issue-127545 .rs:13:19
42
42
|
43
43
LL | arg.unwrap_or(v)
44
44
| --------- ^ expected `&Vec<i32>`, found `&[i32]`
@@ -48,7 +48,7 @@ LL | arg.unwrap_or(v)
48
48
= note: expected reference `&Vec<i32>`
49
49
found reference `&'a [i32]`
50
50
help: the return type of this call is `&'a [i32]` due to the type of the argument passed
51
- --> $DIR/issue-127545- option-of- ref.rs:13:5
51
+ --> $DIR/transforming- option-ref-issue-127545 .rs:13:5
52
52
|
53
53
LL | arg.unwrap_or(v)
54
54
| ^^^^^^^^^^^^^^-^
0 commit comments