about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/method/param-method-from-unnormalized-param-env-2.rs
blob: ffb99d6d638559d6c9dd481bec930dd8c062e814 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

// Regression test for <https://github.com/rust-lang/trait-system-refactor-initiative/issues/214>.
// See comment below.

trait A {
    fn hello(&self) {}
}

trait B {
    fn hello(&self) {}
}

impl<T> A for T {}
impl<T> B for T {}

fn test<F, R>(q: F::Item)
where
    F: Iterator<Item = R>,
    // We want to prefer `A` for `R.hello()`
    F::Item: A,
{
    q.hello();
}

fn main() {}