mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
16 lines
264 B
Rust
16 lines
264 B
Rust
#![crate_name="issue_3979_traits"]
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
pub trait Positioned {
|
|
fn SetX(&mut self, _: isize);
|
|
fn X(&self) -> isize;
|
|
}
|
|
|
|
pub trait Movable: Positioned {
|
|
fn translate(&mut self, dx: isize) {
|
|
let x = self.X() + dx;
|
|
self.SetX(x);
|
|
}
|
|
}
|