Skip to content

deny(warnings) considered harmful #1286

Closed
@RalfJung

Description

@RalfJung
Contributor

josh fails to install on recent versions of rustc:

$ cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
[...]
error: call to `.clone()` on a reference in this situation does nothing
    --> josh-proxy/src/bin/josh-proxy.rs:1144:44
     |
1144 |     cmd.env("GIT_NAMESPACE", temp_ns.name().clone());
     |                                            ^^^^^^^^ help: remove this redundant call
     |
     = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed
note: the lint level is defined here
    --> josh-proxy/src/bin/josh-proxy.rs:1:9
     |
1    | #![deny(warnings)]
     |         ^^^^^^^^
     = note: `#[deny(noop_method_call)]` implied by `#[deny(warnings)]`

It's generally a bad idea to have deny(warnings) in your code; instead you should setRUSTFLFAGS="-D warnings" on CI. That way you get told about warnings but you don't prevent users from installing your project.

Activity

christian-schilling

christian-schilling commented on Oct 26, 2023

@christian-schilling
Member

Hi, thanks for point that out. See #1290

RalfJung

RalfJung commented on Mar 31, 2024

@RalfJung
ContributorAuthor

This is still causing build failures:

$ cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r23.12.04
[...]
error: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp_opt`: use `DateTime::from_timestamp` instead
   --> josh-core/src/graphql.rs:150:42
    |
150 |         let ndt = chrono::NaiveDateTime::from_timestamp_opt(ts, 0)
    |                                          ^^^^^^^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> josh-core/src/lib.rs:1:9
    |
1   | #![deny(warnings)]
    |         ^^^^^^^^
    = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @christian-schilling@RalfJung

      Issue actions

        deny(warnings) considered harmful · Issue #1286 · josh-project/josh