From 7b7caae30e2b23055f2cb686b15757904a3d840d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 3 Sep 2023 10:23:04 +0200 Subject: get rid of duplicate primitive_docs --- src/tools/tidy/src/lib.rs | 1 - src/tools/tidy/src/main.rs | 1 - src/tools/tidy/src/primitive_docs.rs | 17 ----------------- 3 files changed, 19 deletions(-) delete mode 100644 src/tools/tidy/src/primitive_docs.rs (limited to 'src/tools') diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index ca160017202..fc69c143222 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -63,7 +63,6 @@ pub mod features; pub mod fluent_alphabetical; pub mod mir_opt_tests; pub mod pal; -pub mod primitive_docs; pub mod rustdoc_css_themes; pub mod rustdoc_gui_tests; pub mod style; diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 5585e125f2d..80e58ba00fc 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -112,7 +112,6 @@ fn main() { // Checks that only make sense for the std libs. check!(pal, &library_path); - check!(primitive_docs, &library_path); // Checks that need to be done for both the compiler and std libraries. check!(unit_tests, &src_path); diff --git a/src/tools/tidy/src/primitive_docs.rs b/src/tools/tidy/src/primitive_docs.rs deleted file mode 100644 index f3200e0afd7..00000000000 --- a/src/tools/tidy/src/primitive_docs.rs +++ /dev/null @@ -1,17 +0,0 @@ -//! Tidy check to make sure `library/{std,core}/src/primitive_docs.rs` are the same file. These are -//! different files so that relative links work properly without having to have `CARGO_PKG_NAME` -//! set, but conceptually they should always be the same. - -use std::path::Path; - -pub fn check(library_path: &Path, bad: &mut bool) { - let std_name = "std/src/primitive_docs.rs"; - let core_name = "core/src/primitive_docs.rs"; - let std_contents = std::fs::read_to_string(library_path.join(std_name)) - .unwrap_or_else(|e| panic!("failed to read library/{std_name}: {e}")); - let core_contents = std::fs::read_to_string(library_path.join(core_name)) - .unwrap_or_else(|e| panic!("failed to read library/{core_name}: {e}")); - if std_contents != core_contents { - tidy_error!(bad, "library/{core_name} and library/{std_name} have different contents"); - } -} -- cgit 1.4.1-3-g733a5