summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs
blob: e315ee842180ed30c03acdd34e728d1c26fefeb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Test that correct syntax is used in suggestion to constrain associated type

#![feature(generic_associated_types)]

trait X {
    type Y<T>;
}

fn f<T: X>(a: T::Y<i32>) {
    //~^ HELP consider constraining the associated type `<T as X>::Y<i32>` to `Vec<i32>`
    //~| SUGGESTION Y<i32> = Vec<i32>>
    let b: Vec<i32> = a;
    //~^ ERROR mismatched types
}

fn main() {}