os-rust/tests/ui/issues/issue-3702-2.rs

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

21 lines
443 B
Rust
Raw Normal View History

2015-04-17 22:12:20 -07:00
pub trait ToPrimitive {
fn to_int(&self) -> isize { 0 }
}
impl ToPrimitive for i32 {}
impl ToPrimitive for isize {}
2012-12-06 18:32:13 -08:00
trait Add {
fn to_int(&self) -> isize;
2019-05-28 14:46:13 -04:00
fn add_dynamic(&self, other: &dyn Add) -> isize;
2012-12-06 18:32:13 -08:00
}
impl Add for isize {
fn to_int(&self) -> isize { *self }
2019-05-28 14:46:13 -04:00
fn add_dynamic(&self, other: &dyn Add) -> isize {
self.to_int() + other.to_int() //~ ERROR multiple applicable items in scope
2012-12-06 18:32:13 -08:00
}
}
fn main() { }