1 // Copyright 2013 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.
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.
11 // Test that things from the prelude aren't in scope. Use many of them
12 // so that renaming some things won't magically make this test fail
13 // for the wrong reason (e.g. if `Add` changes to `Addition`, and
14 // `no_implicit_prelude` stops working, then the `impl Add` will still
15 // fail with the same error message).
17 #[no_implicit_prelude]
21 impl Add for Test {} //~ ERROR: attempt to implement a nonexistent trait
22 impl Clone for Test {} //~ ERROR: attempt to implement a nonexistent trait
23 impl Iterator for Test {} //~ ERROR: attempt to implement a nonexistent trait
24 impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
25 impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
28 print("foo"); //~ ERROR: unresolved name
29 println("bar"); //~ ERROR: unresolved name
34 impl Add for Test {} //~ ERROR: attempt to implement a nonexistent trait
35 impl Clone for Test {} //~ ERROR: attempt to implement a nonexistent trait
36 impl Iterator for Test {} //~ ERROR: attempt to implement a nonexistent trait
37 impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
38 impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
41 print("foo"); //~ ERROR: unresolved name
42 println("bar"); //~ ERROR: unresolved name
47 #[no_implicit_prelude]
50 impl Add for Test {} //~ ERROR: attempt to implement a nonexistent trait
51 impl Clone for Test {} //~ ERROR: attempt to implement a nonexistent trait
52 impl Iterator for Test {} //~ ERROR: attempt to implement a nonexistent trait
53 impl ToStr for Test {} //~ ERROR: attempt to implement a nonexistent trait
54 impl Writer for Test {} //~ ERROR: attempt to implement a nonexistent trait
57 print("foo"); //~ ERROR: unresolved name
58 println("bar"); //~ ERROR: unresolved name
65 // these should work fine