You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<anon>:2:40: 2:41 error: mismatched types: expected `&'static str` but found `&str` (lifetime mismatch)
<anon>:2 let _array = ["foo", "bar", "baz", x];
^
<anon>:1:17: 3:2 note: the anonymous lifetime #1 defined on the block at 1:16...
<anon>:1 fn foo(x: &str) {
<anon>:2 let _array = ["foo", "bar", "baz", x];
<anon>:3 }
note: ...does not necessarily outlive the static lifetime
This papercut comes up a bit with process spawning, where one (relatively) often writes things like ["--some-arg", "x", user_input] to build the command invocation.