]> git.proxmox.com Git - rustc.git/blob - tests/ui/unresolved/unresolved-import.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / unresolved / unresolved-import.rs
1 use foo::bar; //~ ERROR unresolved import `foo` [E0432]
2 //~^ maybe a missing crate `foo`?
3 //~| HELP consider adding `extern crate foo` to use the `foo` crate
4
5 use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432]
6 //~| no `Baz` in `bar`
7 //~| HELP a similar name exists in the module
8 //~| SUGGESTION Bar
9
10 use food::baz; //~ ERROR unresolved import `food::baz`
11 //~| no `baz` in `food`
12 //~| HELP a similar name exists in the module
13 //~| SUGGESTION bag
14
15 use food::{beens as Foo}; //~ ERROR unresolved import `food::beens` [E0432]
16 //~| no `beens` in `food`
17 //~| HELP a similar name exists in the module
18 //~| SUGGESTION beans
19
20 mod bar {
21 pub struct Bar;
22 }
23
24 mod food {
25 pub use self::zug::baz::{self as bag, Foobar as beans};
26
27 mod zug {
28 pub mod baz {
29 pub struct Foobar;
30 }
31 }
32 }
33
34 mod m {
35 enum MyEnum {
36 MyVariant
37 }
38
39 use MyEnum::*; //~ ERROR unresolved import `MyEnum` [E0432]
40 //~| HELP a similar path exists
41 //~| SUGGESTION self::MyEnum
42 }
43
44 mod items {
45 enum Enum {
46 Variant
47 }
48
49 use Enum::*; //~ ERROR unresolved import `Enum` [E0432]
50 //~| HELP a similar path exists
51 //~| SUGGESTION self::Enum
52
53 fn item() {}
54 }
55
56 fn main() {}