Stream: t-compiler

Topic: compiler warnings


blitzerr (Dec 29 2018 at 00:48, on Zulip):

I found a lot of warnings while compiling rustc recently. Are we planning to remove the warnings in the future or is this an issue with my build environment ?

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:2785:18
     |
2785 |             Some(unsafe { Unique { pointer: ptr as _, _marker: PhantomData } })
     |                  ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:2841:9
     |
2841 |         unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:2848:9
     |
2848 |         unsafe { Unique { pointer: reference as *const T, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:2855:9
     |
2855 |         unsafe { Unique { pointer: p.pointer, _marker: PhantomData } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:3044:9
     |
3044 |         unsafe { NonNull { pointer: unique.pointer } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:3052:9
     |
3052 |         unsafe { NonNull { pointer: reference as *mut T } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
    --> src/libcore/ptr.rs:3060:9
     |
3060 |         unsafe { NonNull { pointer: reference as *const T } }
     |         ^^^^^^ unnecessary `unsafe` block

warning: unused attribute
oli (Dec 29 2018 at 10:02, on Zulip):

These only happen on stage 0 because the bootstrap compiler is too old. We should make this clearer somehow

blitzerr (Dec 29 2018 at 15:22, on Zulip):

These only happen on stage 0 because the bootstrap compiler is too old. We should make this clearer somehow

Thanks @Oli . That makes sense

Santiago Pastorino (Feb 09 2019 at 18:04, on Zulip):

I'm getting this ...

Santiago Pastorino (Feb 09 2019 at 18:04, on Zulip):
error: unnecessary `unsafe` block=============>                        ] 21/36: core
    --> src/libcore/mem.rs:1091:9
     |
1091 |         unsafe {
     |         ^^^^^^ unnecessary `unsafe` block
     |
     = note: `-D unused-unsafe` implied by `-D warnings`

error: aborting due to previous error

error: Could not compile `core`.
Santiago Pastorino (Feb 09 2019 at 18:04, on Zulip):

can't compile

nagisa (Feb 09 2019 at 18:10, on Zulip):

The lint warnings are made errors by the -D flags.

nagisa (Feb 09 2019 at 18:10, on Zulip):

libcore/libstd must not have any warnings to compile

nagisa (Feb 09 2019 at 18:11, on Zulip):

I remember a PR that changed something somewhere in that area, but I don’t recall that landing

Santiago Pastorino (Feb 10 2019 at 14:58, on Zulip):

I’m getting that with current master, just in case going to try pulling again

Santiago Pastorino (Feb 10 2019 at 14:59, on Zulip):

otherwise is there a way to turn that off for my runs of ./x.py?

Santiago Pastorino (Feb 10 2019 at 15:00, on Zulip):

I’m working on something completely unrelated

varkor (Feb 14 2019 at 15:09, on Zulip):

I'm getting errors when compiling master, too

varkor (Feb 14 2019 at 15:09, on Zulip):

do these not get blocked from passing on Travis?

davidtwco (Feb 14 2019 at 15:10, on Zulip):

I had an error recently, doing a clean fixed it. Still get the occasional warning for some crates.

varkor (Feb 14 2019 at 15:13, on Zulip):

I'll try that — it's not the sort of issue I've seen arising from non-clean builds before

davidtwco (Feb 14 2019 at 15:14, on Zulip):

Looking through my old scrollback, looks like it was this error that I got on stage1 codegen artifacts:

error[E0460]: found possibly newer version of crate `std` which `cc` depends on rustc-demangle, cc, num_cpus, memmap, rustc_llvm(build.rs)
   --> src/librustc_llvm/build.rs:126:19
    |
126 |     let mut cfg = cc::Build::new();
    |                   ^^
    |
    = note: perhaps that crate needs to be recompiled?
    = note: the following crate versions were found:
            crate `std`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-be1ed48da452ee8b.rlib
            crate `std`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-be1ed48da452ee8b.so
            crate `cc`: /home/david/projects/rust/workdirs/rust4/build/x86_64-unknown-linux-gnu/stage1-codegen/release/deps/libcc-f2605550c49bbccb.rlib
varkor (Feb 14 2019 at 15:15, on Zulip):

ah, yes, those do often pop up from not cleaning

varkor (Feb 14 2019 at 15:15, on Zulip):

the error I got was a warning that was #[deny]'d

davidtwco (Feb 14 2019 at 15:16, on Zulip):

Something like that rings a bell too but I none of my scrollback goes back far enough to check.

Last update: Nov 20 2019 at 01:35UTC