about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-08 21:41:48 +0000
committerbors <bors@rust-lang.org>2022-01-08 21:41:48 +0000
commit23ce5fc4655ed546f74a85fc8836e95bec0c64fd (patch)
treede1cb5360f9fe14a7f7cedb87998da56e9268981 /src
parenta7e2e33960e95d2eb1a2a2aeec169dba5f73de05 (diff)
parent3ae0dabddbec41422549d2f0f4512c3d3415d0af (diff)
Auto merge of #92068 - fee1-dead:libcore2021, r=m-ou-se
Switch all libraries to the 2021 edition

The fix for https://github.com/rust-lang/rust/issues/88638#issuecomment-996620107 is to simply add const-stability for these functions.

r? `@m-ou-se`

Closes #88638.
Diffstat (limited to 'src')
-rw-r--r--src/tools/tidy/src/edition.rs33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/tools/tidy/src/edition.rs b/src/tools/tidy/src/edition.rs
index f610dbd806a..b0abee45986 100644
--- a/src/tools/tidy/src/edition.rs
+++ b/src/tools/tidy/src/edition.rs
@@ -2,11 +2,6 @@
 
 use std::path::Path;
 
-fn is_edition_2018(mut line: &str) -> bool {
-    line = line.trim();
-    line == "edition = \"2018\""
-}
-
 fn is_edition_2021(mut line: &str) -> bool {
     line = line.trim();
     line == "edition = \"2021\""
@@ -23,27 +18,13 @@ pub fn check(path: &Path, bad: &mut bool) {
                 return;
             }
 
-            // Not all library crates are ready to migrate to 2021.
-            if file.components().any(|c| c.as_os_str() == "library")
-                && file.components().all(|c| c.as_os_str() != "std")
-            {
-                let has = contents.lines().any(is_edition_2018);
-                if !has {
-                    tidy_error!(
-                        bad,
-                        "{} doesn't have `edition = \"2018\"` on a separate line",
-                        file.display()
-                    );
-                }
-            } else {
-                let is_2021 = contents.lines().any(is_edition_2021);
-                if !is_2021 {
-                    tidy_error!(
-                        bad,
-                        "{} doesn't have `edition = \"2021\"` on a separate line",
-                        file.display()
-                    );
-                }
+            let is_2021 = contents.lines().any(is_edition_2021);
+            if !is_2021 {
+                tidy_error!(
+                    bad,
+                    "{} doesn't have `edition = \"2021\"` on a separate line",
+                    file.display()
+                );
             }
         },
     );