Files
rust/tests/ui/traits/default_method_simple.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
293 B
Rust
Raw Normal View History

2025-06-07 16:17:21 +05:00
//! Checks basic default method functionality.
2025-06-07 16:17:21 +05:00
//@ run-pass
2012-12-17 14:57:37 -08:00
trait Foo {
fn f(&self) {
println!("Hello!");
self.g();
}
fn g(&self);
}
2025-06-07 16:17:21 +05:00
struct A;
impl Foo for A {
fn g(&self) {
println!("Goodbye!");
}
}
pub fn main() {
2025-06-07 16:17:21 +05:00
let a = A;
a.f();
}