]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/use-from-trait.rs
58e37bbfa3ea7c7729d56545777f2aff02527e81
[rust.git] / src / test / compile-fail / use-from-trait.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![feature(associated_consts)]
12
13 use Trait::foo;
14 //~^ ERROR `foo` is not directly importable
15 use Trait::Assoc;
16 //~^ ERROR `Assoc` is not directly importable
17 use Trait::C;
18 //~^ ERROR `C` is not directly importable
19
20 use Foo::new;
21 //~^ ERROR unresolved import `Foo::new` [E0432]
22 //~| Not a module `Foo`
23
24 use Foo::C2;
25 //~^ ERROR unresolved import `Foo::C2` [E0432]
26 //~| Not a module `Foo`
27
28 pub trait Trait {
29     fn foo();
30     type Assoc;
31     const C: u32;
32 }
33
34 struct Foo;
35
36 impl Foo {
37     fn new() {}
38     const C2: u32 = 0;
39 }
40
41 fn main() {}