Skip to content

Instantly share code, notes, and snippets.

@justanotherdot
Created October 27, 2020 20:49
Show Gist options
  • Save justanotherdot/cbee6941c571684143543da7f89bbc2f to your computer and use it in GitHub Desktop.
Save justanotherdot/cbee6941c571684143543da7f89bbc2f to your computer and use it in GitHub Desktop.
// cf. https://doc.rust-lang.org/reference/expressions/method-call-expr.html
trait Or {
fn f(self);
}
struct T;
impl Or for &T {
fn f(self) {
print!("1");
}
}
fn main() {
let t = T;
t.f();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment