2019-04-07 10:56:50 -05:00
|
|
|
// aux-build:issue-59764.rs
|
|
|
|
// compile-flags:--extern issue_59764
|
|
|
|
// edition:2018
|
|
|
|
|
2019-04-07 13:34:21 -05:00
|
|
|
#![allow(warnings)]
|
|
|
|
|
|
|
|
// This tests the suggestion to import macros from the root of a crate. This aims to capture
|
|
|
|
// the case where a user attempts to import a macro from the definition location instead of the
|
|
|
|
// root of the crate and the macro is annotated with `#![macro_export]`.
|
|
|
|
|
|
|
|
// Edge cases..
|
|
|
|
|
2019-04-07 16:18:13 -05:00
|
|
|
mod multiple_imports_same_line_at_end {
|
|
|
|
use issue_59764::foo::{baz, makro};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
|
|
|
mod multiple_imports_multiline_at_end_trailing_comma {
|
|
|
|
use issue_59764::foo::{
|
|
|
|
baz,
|
|
|
|
makro, //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod multiple_imports_multiline_at_end {
|
|
|
|
use issue_59764::foo::{
|
|
|
|
baz,
|
|
|
|
makro //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod multiple_imports_same_line_in_middle {
|
|
|
|
use issue_59764::foo::{baz, makro, foobar};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
|
|
|
mod multiple_imports_multiline_in_middle_trailing_comma {
|
|
|
|
use issue_59764::foo::{
|
|
|
|
baz,
|
|
|
|
makro, //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
foobar,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod multiple_imports_multiline_in_middle {
|
|
|
|
use issue_59764::foo::{
|
|
|
|
baz,
|
|
|
|
makro, //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
foobar
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod nested_imports {
|
|
|
|
use issue_59764::{foobaz, foo::makro};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
|
|
|
mod nested_multiple_imports {
|
|
|
|
use issue_59764::{foobaz, foo::{baz, makro}};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
|
|
|
mod nested_multiline_multiple_imports_trailing_comma {
|
|
|
|
use issue_59764::{
|
|
|
|
foobaz,
|
|
|
|
foo::{
|
|
|
|
baz,
|
|
|
|
makro, //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod nested_multiline_multiple_imports {
|
|
|
|
use issue_59764::{
|
|
|
|
foobaz,
|
|
|
|
foo::{
|
|
|
|
baz,
|
|
|
|
makro //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
mod doubly_nested_multiple_imports {
|
|
|
|
use issue_59764::{foobaz, foo::{baz, makro, barbaz::{barfoo}}};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
|
|
|
mod doubly_multiline_nested_multiple_imports {
|
|
|
|
use issue_59764::{
|
|
|
|
foobaz,
|
|
|
|
foo::{
|
|
|
|
baz,
|
|
|
|
makro, //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
barbaz::{
|
|
|
|
barfoo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-04-07 13:34:21 -05:00
|
|
|
mod renamed_import {
|
|
|
|
use issue_59764::foo::makro as baz;
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
2019-04-07 16:18:13 -05:00
|
|
|
mod renamed_multiple_imports {
|
|
|
|
use issue_59764::foo::{baz, makro as foobar};
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
}
|
|
|
|
|
2019-04-11 18:19:02 -05:00
|
|
|
mod lots_of_whitespace {
|
|
|
|
use
|
|
|
|
issue_59764::{
|
|
|
|
|
|
|
|
foobaz,
|
|
|
|
|
|
|
|
|
|
|
|
foo::{baz,
|
|
|
|
|
|
|
|
makro as foobar} //~ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-04-07 13:34:21 -05:00
|
|
|
// Simple case..
|
|
|
|
|
2019-04-07 10:56:50 -05:00
|
|
|
use issue_59764::foo::makro;
|
|
|
|
//~^ ERROR unresolved import `issue_59764::foo::makro` [E0432]
|
|
|
|
|
|
|
|
makro!(bar);
|
|
|
|
//~^ ERROR cannot determine resolution for the macro `makro`
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
bar();
|
|
|
|
//~^ ERROR cannot find function `bar` in this scope [E0425]
|
|
|
|
}
|