summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/alias/issue-60021-assoc-method-resolve.rs
blob: 5e27ed3c6460eba62cc2ca8844ca0d1f7a2e5567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// check-pass

#![feature(trait_alias)]

trait SomeTrait {
    fn map(&self) {}
}

impl<T> SomeTrait for Option<T> {}

trait SomeAlias = SomeTrait;

fn main() {
    let x = Some(123);
    // This should resolve to the trait impl for Option
    Option::map(x, |z| z);
    // This should resolve to the trait impl for SomeTrait
    SomeTrait::map(&x);
}