Skip to content

Instantly share code, notes, and snippets.

Created September 11, 2017 15:54
Show Gist options
  • Save anonymous/4df57da244f82ebfe5731a8c8460f2ff to your computer and use it in GitHub Desktop.
Save anonymous/4df57da244f82ebfe5731a8c8460f2ff to your computer and use it in GitHub Desktop.
Rust code shared from the playground
use std::ops::Add;
struct S;
impl<'a> Add for &'a S {
type Output = &'a S;
fn add(self, _other: Self) -> Self {
self
}
}
fn main() {
let x = &&S;
&S + x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment