blob: 3bcaa53212bba5787acc1b58aa4a8f93c0daa020 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  | 
//@ run-pass
mod traits {
    pub trait Foo { fn f(&self) -> isize; }
    impl Foo for isize { fn f(&self) -> isize { 10 } }
}
trait Quux: traits::Foo { }
impl<T:traits::Foo> Quux for T { }
// Foo is not in scope but because Quux is we can still access
// Foo's methods on a Quux bound typaram
fn f<T:Quux>(x: &T) {
    assert_eq!(x.f(), 10);
}
pub fn main() {
    f(&0)
}
 
  |