Skip to content

x.py build --warnings deny does not fail despite warnings #62402

Closed
@RalfJung

Description

@RalfJung

I patched libstd and wanted to be sure it builds without warnings, so I did:

$ ./x.py build --stage 0 src/libstd --warnings deny

However, this build succeeded despite there being warnings:

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
warning: /home/r/src/rust/rustc.3/src/tools/miri/Cargo.toml: the cargo feature `default-run` is now stable and is no longer necessary to be listed in the manifest
   Compiling cc v1.0.35
   Compiling core v0.0.0 (/home/r/src/rust/rustc.3/src/libcore)
   Compiling build_helper v0.1.0 (/home/r/src/rust/rustc.3/src/build_helper)
   Compiling autocfg v0.1.4
   Compiling backtrace v0.3.29
   Compiling compiler_builtins v0.1.16
   Compiling backtrace-sys v0.1.27
   Compiling cmake v0.1.38
   Compiling std v0.0.0 (/home/r/src/rust/rustc.3/src/libstd)
   Compiling rustc_msan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_msan)
   Compiling rustc_lsan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_lsan)
   Compiling rustc_asan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_asan)
   Compiling rustc_tsan v0.0.0 (/home/r/src/rust/rustc.3/src/librustc_tsan)
   Compiling unwind v0.0.0 (/home/r/src/rust/rustc.3/src/libunwind)
   Compiling rustc-std-workspace-core v1.0.0 (/home/r/src/rust/rustc.3/src/tools/rustc-std-workspace-core)
   Compiling libc v0.2.54
   Compiling alloc v0.0.0 (/home/r/src/rust/rustc.3/src/liballoc)
   Compiling cfg-if v0.1.8
   Compiling rustc-demangle v0.1.15
   Compiling panic_abort v0.0.0 (/home/r/src/rust/rustc.3/src/libpanic_abort)
   Compiling rustc-std-workspace-alloc v1.0.0 (/home/r/src/rust/rustc.3/src/tools/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/home/r/src/rust/rustc.3/src/libpanic_unwind)
   Compiling hashbrown v0.4.0
warning: use of item 'core::mem::uninitialized' that will be deprecated in future version 1.38.0: use `mem::MaybeUninit` instead
  --> src/libstd/io/util.rs:48:54
   |
48 |         let mut buf: [u8; super::DEFAULT_BUF_SIZE] = mem::uninitialized();
   |                                                      ^^^^^^^^^^^^^^^^^^
   |
note: lint level defined here
  --> src/libstd/lib.rs:208:9
   |
208| #![warn(deprecated_in_future)]
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of item 'sync::once::ONCE_INIT' that will be deprecated in future version 1.38.0: the `new` function is now preferred
   --> src/libstd/sync/mod.rs:167:39
    |
167 | pub use self::once::{Once, OnceState, ONCE_INIT};
    |                                       ^^^^^^^^^

    Finished release [optimized] target(s) in 31.86s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Build completed successfully in 0:00:32

I have deny-warnings = false in my config.toml, but that shouldn't render --warnings unusable (at least, the help for --warnings does not say anything like that). In fact, it seems like the flag would be a NOP anyway with deny-warnings = true?

Also, --warnings denyyyy just builds fine, so it seems like there is no input sensitization going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions