aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/self-path2.rs
blob: b9b82cae5a6a502a6e6223976f8da8c5b0e7bc7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-additional-options "-w" }
struct foo;

fn bar() -> self::foo {
    crate::foo
}

fn baz() {
    let a: foo = self::bar();

    crate::bar();

    crate::self::foo();
    // { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }
}

type a = foo;
type b = crate::foo;
type c = self::foo;
type d = crate::self::foo;
// { dg-error "failed to resolve: .self. in paths can only be used in start position" "" { target *-*-* } .-1 }