From 4435686a486e0228df34bf9ff739c1e27c836f22 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 15 Feb 2023 18:03:38 +0000 Subject: [PATCH] Fix warnings when building the build system in rust's CI --- build_system/mod.rs | 2 +- build_system/tests.rs | 6 +++--- y.rs | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build_system/mod.rs b/build_system/mod.rs index 8a53acdf7e396..e4ed9be23b705 100644 --- a/build_system/mod.rs +++ b/build_system/mod.rs @@ -43,7 +43,7 @@ pub(crate) enum SysrootKind { Llvm, } -pub fn main() { +pub(crate) fn main() { if env::var("RUST_BACKTRACE").is_err() { env::set_var("RUST_BACKTRACE", "1"); } diff --git a/build_system/tests.rs b/build_system/tests.rs index e2a6fa91eb3b5..a9a192242cf5b 100644 --- a/build_system/tests.rs +++ b/build_system/tests.rs @@ -277,7 +277,7 @@ struct TestRunner { } impl TestRunner { - pub fn new(dirs: Dirs, mut target_compiler: Compiler, is_native: bool) -> Self { + fn new(dirs: Dirs, mut target_compiler: Compiler, is_native: bool) -> Self { if let Ok(rustflags) = env::var("RUSTFLAGS") { target_compiler.rustflags.push(' '); target_compiler.rustflags.push_str(&rustflags); @@ -299,7 +299,7 @@ impl TestRunner { Self { is_native, jit_supported, dirs, target_compiler } } - pub fn run_testsuite(&self, tests: &[TestCase]) { + fn run_testsuite(&self, tests: &[TestCase]) { for TestCase { config, cmd } in tests { let (tag, testname) = config.split_once('.').unwrap(); let tag = tag.to_uppercase(); @@ -384,7 +384,7 @@ impl TestRunner { spawn_and_wait(self.rustc_command(args)); } - fn run_out_command<'a>(&self, name: &str, args: &[&str]) { + fn run_out_command(&self, name: &str, args: &[&str]) { let mut full_cmd = vec![]; // Prepend the RUN_WRAPPER's diff --git a/y.rs b/y.rs index 02e1e21ade1de..a68a10500f508 100755 --- a/y.rs +++ b/y.rs @@ -7,6 +7,10 @@ rustc $0 -o ${0/.rs/.bin} -Cdebuginfo=1 --edition 2021 exec ${0/.rs/.bin} $@ */ +#![warn(rust_2018_idioms)] +#![warn(unused_lifetimes)] +#![warn(unreachable_pub)] + //! The build system for cg_clif //! //! # Manual compilation