blob: 5d03a0e9e993134aab66c3e51635d39f97a6294c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#![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);
}
}
|