Rust 程序设计语言 简体中文版 1.85.0fn dangle() -> &String { 5 + fn dangle() -> String { | error[E0515]: cannot return reference to local variable `s` --> src/main.rs:8:5 | 8 | &s | ^^ returns a reference to data owned by the Compiling chapter10 v0.1.0 (file:///projects/chapter10) error[E0515]: cannot return value referencing local variable `result` --> src/main.rs:11:5 | 11 | result.as_str() | ------^^^^^^^^^ cargo run Compiling patterns v0.1.0 (file:///projects/patterns) error[E0005]: refutable pattern in local binding --> src/main.rs:3:9 | 3 | let Some(x) = some_option_value; | ^^^^^^^ pattern0 码力 | 562 页 | 3.23 MB | 23 天前3
共 1 条
- 1













