Created
November 9, 2023 15:48
-
-
Save AndyShiue/09cc09ffd62d62972e9dea0e07707491 to your computer and use it in GitHub Desktop.
overlapping instances in Rust
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
trait Foo {} | |
trait Bar {} | |
trait Demo<T> { | |
fn t(_: T) -> T; | |
} | |
struct Test; | |
impl <T: Foo> Demo<T> for Test { | |
fn t(_: T) -> T { panic!() } | |
} | |
impl <T: Bar> Demo<T> for Test { | |
fn t(_: T) -> T { panic!() } | |
} | |
fn main() { | |
println!("Hello, world!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment