Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new test and add an existing scenario I didn't see covered
- Loading branch information
1 parent
9f11714
commit dfd2a13
Showing
6 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// run-rustfix | ||
|
||
#![feature(rust_2018_preview)] | ||
#![deny(absolute_path_not_starting_with_crate)] | ||
|
||
use crate::foo::{a, b}; | ||
//~^ ERROR absolute paths must start with | ||
//~| this was previously accepted | ||
|
||
mod foo { | ||
crate fn a() {} | ||
crate fn b() {} | ||
} | ||
|
||
fn main() { | ||
a(); | ||
b(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// run-rustfix | ||
|
||
#![feature(rust_2018_preview)] | ||
#![deny(absolute_path_not_starting_with_crate)] | ||
|
||
use foo::{a, b}; | ||
//~^ ERROR absolute paths must start with | ||
//~| this was previously accepted | ||
|
||
mod foo { | ||
crate fn a() {} | ||
crate fn b() {} | ||
} | ||
|
||
fn main() { | ||
a(); | ||
b(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition | ||
--> $DIR/edition-lint-nested-paths.rs:16:5 | ||
| | ||
LL | use foo::{a, b}; | ||
| ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}` | ||
| | ||
note: lint level defined here | ||
--> $DIR/edition-lint-nested-paths.rs:14:9 | ||
| | ||
LL | #![deny(absolute_path_not_starting_with_crate)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! | ||
= note: for more information, see issue TBD | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters