Created
July 3, 2023 17:45
-
-
Save speelbarrow/244ae87250331df9b20fcfab5268f26f to your computer and use it in GitHub Desktop.
Confusing Rust compiler behaviour
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
enum Example { | |
Example1, | |
Example2, | |
} | |
impl Example { | |
fn Example1() { | |
println!("Hello, World!"); | |
} | |
} | |
fn main() { | |
let _ = Example::Example1; | |
} |
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
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