mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rollup merge of #56322 - petrochenkov:edlints, r=eddyb
resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate` Fixes https://github.com/rust-lang/rust/issues/56311 (stable-to-beta regression)
This commit is contained in:
commit
1fe2085441
@ -3950,7 +3950,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
||||
|
||||
let first_name = match path.get(0) {
|
||||
// In the 2018 edition this lint is a hard error, so nothing to do
|
||||
Some(seg) if seg.ident.span.rust_2015() => seg.ident.name,
|
||||
Some(seg) if seg.ident.span.rust_2015() && self.session.rust_2015() => seg.ident.name,
|
||||
_ => return,
|
||||
};
|
||||
|
||||
|
@ -9,3 +9,14 @@
|
||||
// except according to those terms.
|
||||
|
||||
pub fn foo() {}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! macro_2015 {
|
||||
() => {
|
||||
use edition_lint_paths as other_name;
|
||||
use edition_lint_paths::foo as other_foo;
|
||||
fn check_macro_2015() {
|
||||
::edition_lint_paths::foo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
src/test/ui/rust-2018/edition-lint-paths-2018.rs
Normal file
10
src/test/ui/rust-2018/edition-lint-paths-2018.rs
Normal file
@ -0,0 +1,10 @@
|
||||
// compile-pass
|
||||
// edition:2018
|
||||
// compile-flags:--extern edition_lint_paths
|
||||
// aux-build:edition-lint-paths.rs
|
||||
|
||||
#![deny(absolute_paths_not_starting_with_crate)]
|
||||
|
||||
edition_lint_paths::macro_2015!(); // OK
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user