]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-implicit-prelude.rs
0e39d9ebdc12b7abbc1fdbd0e21526b230f68c53
[rust.git] / src / test / ui / no-implicit-prelude.rs
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.
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 #![no_implicit_prelude]
12
13 // Test that things from the prelude aren't in scope. Use many of them
14 // so that renaming some things won't magically make this test fail
15 // for the wrong reason (e.g. if `Add` changes to `Addition`, and
16 // `no_implicit_prelude` stops working, then the `impl Add` will still
17 // fail with the same error message).
18
19 struct Test;
20 impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
21 impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope
22 impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
23 impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
24 impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope
25
26 fn main() {
27     drop(2) //~ ERROR cannot find function `drop` in this scope
28 }