2022-05-18から1日間の記事一覧
以下はコンパイルエラーになる。 fn main() { let foo = foo(); println!("{}", foo); } fn foo() -> &str { let m = String::from("aiueo"); m.trim() } error[E0106]: missing lifetime specifier --> src\main.rs:6:13 | 6 | fn foo() -> &str { | ^ expe…
以下はコンパイルエラーになる。 fn main() { let foo = foo(); println!("{}", foo); } fn foo() -> &str { let m = String::from("aiueo"); m.trim() } error[E0106]: missing lifetime specifier --> src\main.rs:6:13 | 6 | fn foo() -> &str { | ^ expe…