]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-implicit-prelude.rs
Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwco
[rust.git] / src / test / ui / no-implicit-prelude.rs
1 #![no_implicit_prelude]
2
3 // Test that things from the prelude aren't in scope. Use many of them
4 // so that renaming some things won't magically make this test fail
5 // for the wrong reason (e.g., if `Add` changes to `Addition`, and
6 // `no_implicit_prelude` stops working, then the `impl Add` will still
7 // fail with the same error message).
8
9 struct Test;
10 impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
11 impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
12 impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
13 impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
14 impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope
15
16 fn main() {
17     drop(2) //~ ERROR cannot find function `drop` in this scope
18 }