rust/tests/ui/unresolved/unresolved-import.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.5 KiB
Rust
Raw Normal View History

use foo::bar; //~ ERROR unresolved import `foo` [E0432]
2019-08-05 14:50:37 +00:00
//~^ maybe a missing crate `foo`?
//~| HELP consider adding `extern crate foo` to use the `foo` crate
2016-08-22 05:57:10 +00:00
use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432]
2019-01-16 20:30:41 +00:00
//~| no `Baz` in `bar`
//~| HELP a similar name exists in the module
//~| SUGGESTION Bar
2013-05-14 04:42:10 +00:00
2016-08-22 05:57:10 +00:00
use food::baz; //~ ERROR unresolved import `food::baz`
2019-01-16 20:30:41 +00:00
//~| no `baz` in `food`
//~| HELP a similar name exists in the module
//~| SUGGESTION bag
2016-08-22 05:57:10 +00:00
use food::{beens as Foo}; //~ ERROR unresolved import `food::beens` [E0432]
2019-01-16 20:30:41 +00:00
//~| no `beens` in `food`
//~| HELP a similar name exists in the module
//~| SUGGESTION beans
2013-05-14 04:42:10 +00:00
mod bar {
pub struct Bar;
2013-05-14 04:42:10 +00:00
}
mod food {
pub use self::zug::baz::{self as bag, Foobar as beans};
mod zug {
pub mod baz {
pub struct Foobar;
}
}
}
mod m {
enum MyEnum {
MyVariant
}
use MyEnum::*; //~ ERROR unresolved import `MyEnum` [E0432]
2019-01-16 20:30:41 +00:00
//~| HELP a similar path exists
//~| SUGGESTION self::MyEnum
}
mod items {
enum Enum {
Variant
}
use Enum::*; //~ ERROR unresolved import `Enum` [E0432]
2019-01-16 20:30:41 +00:00
//~| HELP a similar path exists
//~| SUGGESTION self::Enum
fn item() {}
}
fn main() {}