Closed
Description
Code
fn get_arguments(data: &[u8]) -> (Vec<String>, &[u8]) {
(Vec::new(), data)
}
let x = true;
let cmd = &[1, 2, 3, 4];
let (cmd, proc_args) = if x {
get_arguments(cmd)
} else {
(Vec::new(), &[])
};
Current output
error[E0277]: the size for values of type `[_]` cannot be known at compilation time
--> src/unix/apple/macos/process.rs:581:10
|
581 | let (cmd, proc_args) = if x {
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[_]`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
Desired output
error[E0277]: the size for values of type `[_]` cannot be known at compilation time
--> src/unix/apple/macos/process.rs:581:10
|
581 | let (cmd, proc_args) = if x {
| ^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[_]`
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
Rationale and extra context
It's underlining the wrong argument.
Other cases
No response
Anything else?
No response