summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/suggest-fully-qualified-closure.rs
blob: c077921c0bdd20f0d8556627ca849e802a2f0d9d (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
// check-fail
// known-bug: #103705
// normalize-stderr-test "\[closure@.*\]" -> "[closure@]"
// normalize-stderr-test "\+* ~" -> "+++ ~"

// The output of this currently suggests writing a closure in the qualified path.

trait MyTrait<T> {
   fn lol<F:FnOnce()>(&self, f:F) -> u16;
}

struct Qqq;

impl MyTrait<u32> for Qqq{
   fn lol<F:FnOnce()>(&self, _f:F) -> u16 { 5 }
}
impl MyTrait<u64> for Qqq{
   fn lol<F:FnOnce()>(&self, _f:F) -> u16 { 6 }
}

fn main() {
    let q = Qqq;
    q.lol(||());
}