11error[E0308]: mismatched types
2- --> $DIR/issue-127545- option-of- ref.rs:5:5
2+ --> $DIR/transforming- option-ref-issue-127545 .rs:5:5
33 |
44LL | pub fn foo(arg: Option<&Vec<i32>>) -> Option<&[i32]> {
55 | -------------- expected `Option<&[i32]>` because of return type
@@ -14,7 +14,7 @@ LL | arg.map(|v| &**v)
1414 | ++++++++++++++
1515
1616error[E0308]: mismatched types
17- --> $DIR/issue-127545- option-of- ref.rs:9:19
17+ --> $DIR/transforming- option-ref-issue-127545 .rs:9:19
1818 |
1919LL | arg.unwrap_or(&[])
2020 | --------- ^^^ expected `&Vec<i32>`, found `&[_; 0]`
@@ -24,7 +24,7 @@ LL | arg.unwrap_or(&[])
2424 = note: expected reference `&Vec<i32>`
2525 found reference `&[_; 0]`
2626help: 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
2828 |
2929LL | arg.unwrap_or(&[])
3030 | ^^^^^^^^^^^^^^---^
@@ -38,7 +38,7 @@ LL | arg.map_or(&[], |v| v)
3838 | ~~~~~~~~~~~~~~~~~~
3939
4040error[E0308]: mismatched types
41- --> $DIR/issue-127545- option-of- ref.rs:13:19
41+ --> $DIR/transforming- option-ref-issue-127545 .rs:13:19
4242 |
4343LL | arg.unwrap_or(v)
4444 | --------- ^ expected `&Vec<i32>`, found `&[i32]`
@@ -48,7 +48,7 @@ LL | arg.unwrap_or(v)
4848 = note: expected reference `&Vec<i32>`
4949 found reference `&'a [i32]`
5050help: 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
5252 |
5353LL | arg.unwrap_or(v)
5454 | ^^^^^^^^^^^^^^-^
0 commit comments