mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +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);
|
|
}
|
|
}
|