summaryrefslogtreecommitdiffstats
path: root/tests/ui/symbol-names/trait-objects.rs
blob: 5bcbc08413fe10b83cf5c364bf2cc9cbc0e19823 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Ensure that trait objects don't include more than one binder. See #83611

// build-fail
// revisions: v0
//[v0]compile-flags: -C symbol-mangling-version=v0
//[v0]normalize-stderr-test: "core\[.*?\]" -> "core[HASH]"

#![feature(rustc_attrs)]

trait Bar {
    fn method(&self) {}
}

impl Bar for &dyn FnMut(&u8) {
    #[rustc_symbol_name]
    //[v0]~^ ERROR symbol-name
    //[v0]~| ERROR demangling
    //[v0]~| ERROR demangling-alt
    fn method(&self) {}
}

trait Foo {
    fn method(&self) {}
}

impl Foo for &(dyn FnMut(&u8) + for<'b> Send) {
    #[rustc_symbol_name]
    //[v0]~^ ERROR symbol-name
    //[v0]~| ERROR demangling
    //[v0]~| ERROR demangling-alt
    fn method(&self) {}
}

trait Baz {
    fn method(&self) {}
}

impl Baz for &(dyn for<'b> Send + FnMut(&u8)) {
    #[rustc_symbol_name]
    //[v0]~^ ERROR symbol-name
    //[v0]~| ERROR demangling
    //[v0]~| ERROR demangling-alt
    fn method(&self) {}
}

fn main() {
}