1 // Copyright 2016 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.
40 // When we comment the next line:
43 // BEFORE, we got the following error for the `impl` below:
44 // error: use of undeclared trait name `Mul` [E0405]
45 // AFTER, we get this message:
46 // error: trait `Mul` is not in scope.
48 // help: you can import several candidates into scope (`use ...;`):
51 // help: `std::ops::Mul`
54 //~^ ERROR unresolved trait `Mul`
55 //~| HELP possible candidates are found in other modules, you can import them into scope
58 //~| HELP `std::ops::Mul`
62 // error: use of undeclared type name `Mul` [E0412]
64 // error: type name `Mul` is not in scope. Maybe you meant:
66 // help: you can import several candidates into scope (`use ...;`):
71 // help: and 2 other candidates
73 //~^ ERROR unresolved type `Mul`
74 //~| HELP possible candidates are found in other modules, you can import them into scope
79 //~| HELP and 2 other candidates
82 // Let's also test what happens if the trait doesn't exist:
83 impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo {
84 //~^ ERROR unresolved trait `ThisTraitReallyDoesntExistInAnyModuleReally`
87 // Let's also test what happens if there's just one alternative:
89 //~^ ERROR unresolved trait `Div`
90 //~| HELP `use std::ops::Div;`
95 println!("Hello, {:?}!", foo);