Add regression test for issue 127545
This commit is contained in:
parent
0ca92de473
commit
d9170dc666
@ -0,0 +1,6 @@
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/127545>.
|
||||
#![crate_type = "lib"]
|
||||
|
||||
pub fn foo(arg: Option<&Vec<i32>>) -> Option<&[i32]> {
|
||||
arg //~ ERROR 5:5: 5:8: mismatched types [E0308]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/transforming-option-ref-issue-127545.rs:5:5
|
||||
|
|
||||
LL | pub fn foo(arg: Option<&Vec<i32>>) -> Option<&[i32]> {
|
||||
| -------------- expected `Option<&[i32]>` because of return type
|
||||
LL | arg
|
||||
| ^^^ expected `Option<&[i32]>`, found `Option<&Vec<i32>>`
|
||||
|
|
||||
= note: expected enum `Option<&[i32]>`
|
||||
found enum `Option<&Vec<i32>>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
x
Reference in New Issue
Block a user