Skip to content

Commit

Permalink
tidy: Remove submodules from edition exception list
Browse files Browse the repository at this point in the history
Both style-check and date-check are now on the 2021 edition, and this
commit also updates their repositories' submodules.
  • Loading branch information
camelid committed Oct 24, 2021
1 parent 00d5e42 commit f410bc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/doc/reference
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide
10 changes: 1 addition & 9 deletions src/tools/tidy/src/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,13 @@ pub fn check(path: &Path, bad: &mut bool) {
&mut |path| super::filter_dirs(path) || path.ends_with("src/test"),
&mut |entry, contents| {
let file = entry.path();
let filestr = file.to_string_lossy().replace("\\", "/");
let filename = file.file_name().unwrap();
if filename != "Cargo.toml" {
return;
}

// Library crates are not yet ready to migrate to 2021.
//
// The reference and rustc-dev-guide are submodules, so are left at
// 2018 for now. They should be removed from this exception list
// when bumped.
if path.components().any(|c| c.as_os_str() == "library")
|| filestr.contains("src/doc/reference/style-check/Cargo.toml")
|| filestr.contains("src/doc/rustc-dev-guide/ci/date-check/Cargo.toml")
{
if path.components().any(|c| c.as_os_str() == "library") {
let has = contents.lines().any(is_edition_2018);
if !has {
tidy_error!(
Expand Down

0 comments on commit f410bc7

Please sign in to comment.