Skip to content

Instantly share code, notes, and snippets.

@speelbarrow
Created July 3, 2023 17:45
Show Gist options
  • Save speelbarrow/244ae87250331df9b20fcfab5268f26f to your computer and use it in GitHub Desktop.
Save speelbarrow/244ae87250331df9b20fcfab5268f26f to your computer and use it in GitHub Desktop.
Confusing Rust compiler behaviour
enum Example {
Example1,
Example2,
}
impl Example {
fn Example1() {
println!("Hello, World!");
}
}
fn main() {
let _ = Example::Example1;
}
enum Example {
Example1,
Example2,
}
impl Example {
fn Example1() {
println!("Hello, World!");
}
}
fn main() {
Example::Example1();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment