-
-
Save stevenblenkinsop/e7a39e9a3e085c4ceaa4 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::Deref; | |
fn main() { | |
let s: &'static str = "hello"; | |
let x: &'static str = &*s; | |
let y: &'static str = s.deref(); // <-- lifetime error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment