Skip to content

Turn warnings into errors in std and extra #6963

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

Closed
brson opened this issue Jun 6, 2013 · 6 comments
Closed

Turn warnings into errors in std and extra #6963

brson opened this issue Jun 6, 2013 · 6 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jun 6, 2013

stage1+ only. The deluge of warnings is never ending. Fortunately, some excellent and fearless people do clean them up, but it feels like this would be more efficient to not commit the warnings in the first place.

Having too many warnings looks bad.

@catamorphism
Copy link
Contributor

Agreed. I'd even go so far as to say that all code in the rust repository should be warning-clean. We should set a good example :-) (or if there are warnings we want to ignore in rustc, it would probably be better to opt out of them explicitly).

@graydon
Copy link
Contributor

graydon commented Jun 6, 2013

Agreed

@pnkfelix
Copy link
Member

@brson what do you think about turning off warnings entirely for the stage0 build, so that we don't get annoyed by bugs in lint that are not yet fixed in the snapshot version of the compiler?

(or at least add [or just document?] an easy way, perhaps a configure flag, to let one easily opt into ignoring all warnings in the stage0 build.)

@brson
Copy link
Contributor Author

brson commented Jun 15, 2013

@pnkfelix That sounds good to me.

@alexcrichton has a pull request open for this but I think we should do a little more. In Alex's formulation all the #[deny(*)] attributes are passed as -D flags on the command line in stage1+. Passing flags on the command line though isn't very rusty - I would rather see these as attributes at the top of the crate.

Two ways we could achieve this would be to: a) add command line flags for converting warnings to errors and ignoring warnings, so each stage just has one extra command line flag instead of all the lint flags, or b) making attributes themselves conditional. I prefer the former.

@alexcrichton
Copy link
Member

@brson, what do you think about -D warnings along with a #[deny(warnings)] attribute?

That role of it would be to deny all warnings, turning them into errors by default. There could then be some validation as well to say -A warnings allows all warnings to go unnoticed, and -W warnings itself does nothing (treats warnings as warnings, non fatal)

That way stage0 would have -A warnings and stage1+ would have -D warnings and that's it. That way we could still control the lint levels manually inside the crates without having to specify them all on the command line. Additionally whenever a crate were ready to deny common lints by default, they just need to add #[deny(warnings)]

@alexcrichton
Copy link
Member

As an example, see this

@bors bors closed this as completed in 09b4525 Jun 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants