Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deny(warnings) considered harmful #1286

Closed
RalfJung opened this issue Oct 20, 2023 · 2 comments · Fixed by #1327
Closed

deny(warnings) considered harmful #1286

RalfJung opened this issue Oct 20, 2023 · 2 comments · Fixed by #1327

Comments

@RalfJung
Copy link
Contributor

RalfJung commented Oct 20, 2023

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.

@christian-schilling
Copy link
Member

Hi, thanks for point that out. See #1290

@RalfJung
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants