mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
21 lines
220 B
Rust
21 lines
220 B
Rust
// run-pass
|
|
|
|
|
|
trait Foo {
|
|
fn bar(&self) -> String {
|
|
format!("test")
|
|
}
|
|
}
|
|
|
|
enum Baz {
|
|
Quux
|
|
}
|
|
|
|
impl Foo for Baz {
|
|
}
|
|
|
|
pub fn main() {
|
|
let q = Baz::Quux;
|
|
assert_eq!(q.bar(), "test".to_string());
|
|
}
|