]> git.proxmox.com Git - rustc.git/blame - src/test/ui/resolve/no-implicit-prelude.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / resolve / no-implicit-prelude.rs
CommitLineData
1a4d82fc
JJ
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
0731742a 5// for the wrong reason (e.g., if `Add` changes to `Addition`, and
1a4d82fc
JJ
6// `no_implicit_prelude` stops working, then the `impl Add` will still
7// fail with the same error message).
8
9struct Test;
32a655c1 10impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
416331ca 11impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
32a655c1
SL
12impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
13impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
14impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope
1a4d82fc
JJ
15
16fn main() {
32a655c1 17 drop(2) //~ ERROR cannot find function `drop` in this scope
1a4d82fc 18}