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 #47

Merged
merged 5 commits into from
Jan 4, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix link title, add explanation why not deprecated
  • Loading branch information
llogiq committed Dec 26, 2016
commit 81d5d4db00ff10cb9ad9c5e832b9a96f53923b43
6 changes: 3 additions & 3 deletions anti_patterns/deny-warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ In addition, the following `allow`ed lints may be a good idea to `deny`:
unused-results)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add missing-debug-implementations (and maybe missing-copy-implementations, though that's perhaps more controversial).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

```

Note that we explicitly did not set `deprecated`.
Note that we explicitly did not set the [deprecate attribute]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: there should be a period at the end of this sentence


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add some discussion around the fact that usually in Rust, we recommend using in-crate attributes rather than command line flags (several reasons for this, starting with ensuring consistent build experiences without needing a build script on top of Cargo or whatever). However, the advice here is an exception to that rule and maybe explain why it makes sense (which I guess comes down to, deny(warnings) whould be a personal part of the build experience, not something you force onto your clients).

It is probably worth stating the alternative of denying specific warnings as attributes which does not have the behaviour you describe.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably worth stating the alternative of denying specific warnings as attributes which does not have the behaviour you describe.

Is this true in general? Even when only specific warnings are chosen, the meanings of the warnings themselves can change over time. That was part of the motivation for rust-lang/rfcs#1193, after all.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess it would be 99% true. Warnings very rarely change their meaning. Though they might expand slightly, it is usually to cover edge cases and is unlikely to cause breakage. I expect that any problems this causes is more than outweighed by the benefits of catching errors earlier in the development process and without needing a custom script to run the builds. ISTM that the hazard of the lint case is another lint silently appearing and this approach does not have that problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right. I think the list of lints is now complete and usable.

## See also

- [`#[deprecated]`] documentation
- [deprecate attribute] documentation
- Type `rustc -W help` for a list of lints on your system. Also type
`rustc --help` for a general list of options
- [rust-clippy] is a collection of lints for better Rust code

[rust-clippy]: https://github.com/Manishearth/rust-clippy
[`#[deprecated]`]: https://doc.rust-lang.org/reference.html#miscellaneous-attributes
[deprecate attribute]: https://doc.rust-lang.org/reference.html#miscellaneous-attributes