Skip to content

Instantly share code, notes, and snippets.

@stevenblenkinsop
Forked from anonymous/playground.rs
Created July 23, 2015 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenblenkinsop/e7a39e9a3e085c4ceaa4 to your computer and use it in GitHub Desktop.
Save stevenblenkinsop/e7a39e9a3e085c4ceaa4 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
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