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

Don't set #![deny(warnings)] on the whole crate #1040

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glittershark
Copy link

deny(warnings) is generally considered to be a pretty strong anti-pattern0 because new warnings can be introduced, either by new versions of rustc or by new versions of dependencies, that the binary author may want to prevent but shouldn't prevent users from building from source. In this case, a newer version of chrono deprecated NaiveDateTime::from_timestamp, which ended up breaking my CI pipeline because josh is no longer able to build.

Generally, instead, it's better practice to deny specific warnings, or build with -D warnings in CI.

deny(warnings) is generally considered to be a pretty strong
anti-pattern[0] because new warnings can be introduced, either by new
versions of rustc or by new versions of dependencies, that the binary
author may want to prevent but shouldn't prevent users from building
from source. In this case, a newer version of `chrono` deprecated
`NaiveDateTime::from_timestamp`, which ended up breaking my CI pipeline
because josh is no longer able to build.

Generally, instead, it's better practice to deny *specific* warnings, or
build with `-D warnings` in CI.

[0]: https://rust-unofficial.github.io/patterns/anti_patterns/deny-warnings.html
@vlad-ivanov-name
Copy link
Collaborator

build with -D warnings in CI.

Could you please add that? Otherwise CI will start accepting warnings

@christian-schilling
Copy link
Member

I ran into that problem myself a while ago. I still don't quite understand why a build breaking warning through a dependency change can happen with all dependencies pinned (including rustc) 🤔

But passing this from the outside via a flag does sound ok to me.

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 this pull request may close these issues.

None yet

3 participants