blob: b0cb8b2ac7b329155dfb004ae6a77f9c76ee233f [file]
//@ run-pass
// Make sure we don't prefer a subtrait that we would've otherwise eliminated
// in `consider_probe` during method probing.
#![allow(dead_code)]
struct W<T>(T);
trait Upstream {
fn hello(&self) -> &'static str {
"upstream"
}
}
impl<T> Upstream for T {}
trait Downstream: Upstream {
fn hello(&self) -> &'static str {
"downstream"
}
}
impl<T> Downstream for W<T> where T: Foo {}
trait Foo {}
fn main() {
let x = W(1i32);
assert_eq!(x.hello(), "upstream");
}