]> git.lizzy.rs Git - rust.git/blob - src/test/auxiliary/reexported_static_methods.rs
test: Remove all uses of `~str` from the test suite.
[rust.git] / src / test / auxiliary / reexported_static_methods.rs
1 // Copyright 2012 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 pub use sub_foo::Foo;
12 pub use Baz = self::Bar;
13 pub use sub_foo::Boz;
14 pub use sub_foo::Bort;
15
16 pub trait Bar {
17     fn bar() -> Self;
18 }
19
20 impl Bar for int {
21     fn bar() -> int { 84 }
22 }
23
24 pub mod sub_foo {
25     pub trait Foo {
26         fn foo() -> Self;
27     }
28
29     impl Foo for int {
30         fn foo() -> int { 42 }
31     }
32
33     pub struct Boz {
34         unused_str: StrBuf
35     }
36
37     impl Boz {
38         pub fn boz(i: int) -> bool {
39             i > 0
40         }
41     }
42
43     pub enum Bort {
44         Bort1,
45         Bort2
46     }
47
48     impl Bort {
49         pub fn bort() -> StrBuf {
50             "bort()".to_strbuf()
51         }
52     }
53 }