-
Notifications
You must be signed in to change notification settings - Fork 13k
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
#[must_use] now suddenly warns in nightly #44213
Comments
Or at the very least, this should be made the kind of warning that doesn’t spam downstream users despite |
Unfortunately, the "soft" feature-gate warning (which is just a |
Also unfortunately, it doesn't look like the feature-gate machinery already has access to the lint-cap setting. I'm having trouble deciding whether it's less terrible/hacky/inelegant/unæsthetic to add it as another argument to |
@zackmdavis Is it possible to switch off the |
efficacious `#[must_use]` methods for nightly, fix warnings 137660d annotated many methods with `#[must_use]`, but despite not being rejected by the compiler, this is actually a no-op (as of Rust 1.20). `#[must_use]` for functions is now available on nightly Rust (since rust-lang/rust@3645b062), under a feature-gate (since rust-lang/rust@8492ad24 and 35c44941), with a warning if `#[must_use]` appears on a function or method without the feature being enabled—a warning that regrettably added a lot of noise to Euclid's build, as reported in rust-lang/rust#44213. But with judicious use of [`cfg_attr`](https://doc.rust-lang.org/1.19.0/book/first-edition/conditional-compilation.html#cfg_attr), Euclid can make use of this functionality if our "unstable" feature is enabled, and shut up the warnings in any case. ![must_euclid](https://user-images.githubusercontent.com/1076988/29959879-3f527186-8eae-11e7-915b-357f39e4be17.png) (SHA in the screenshot doesn't match because I had to amend the commit message) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/225) <!-- Reviewable:end -->
This boolean field on the error `Handler` is toggled to silence warnings when `-A warnings` is passed. (This is actually a separate mechanism from the global lint level—whether there's some redundancy to be factored away here is an important question, but not one we concern ourselves with in this commit.) But the same rationale applies for `--cap-lints allow`. In particular, this makes the "soft" feature-gate warning introduced in 8492ad2 (which is not a lint, but just calls `struct_span_warn`) not pollute the builds of dependent crates. Thanks to @kennytm for pointing out the potential of `can_emit_warnings` for this purpose. Resolves rust-lang#44213.
|
`--cap-lints allow` switches off `can_emit_warnings` This boolean field on the error `Handler` is toggled to silence warnings when `-A warnings` is passed. (This is actually a separate mechanism from the global lint level—whether there's some redundancy to be factored away here is an important question, but not one we concern ourselves with in this commit.) But the same rationale applies for `--cap-lints allow`. In particular, this makes the "soft" feature-gate warning introduced in 8492ad2 (which is not a lint, but just calls `struct_span_warn`) not pollute the builds of dependent crates. Thanks to @kennytm for pointing out the potential of `can_emit_warnings` for this purpose. Resolves #44213.
This boolean field on the error `Handler` is toggled to silence warnings when `-A warnings` is passed. (This is actually a separate mechanism from the global lint level—whether there's some redundancy to be factored away here is an important question, but not one we concern ourselves with in this commit.) But the same rationale applies for `--cap-lints allow`. In particular, this makes the "soft" feature-gate warning introduced in 8492ad2 (which is not a lint, but just calls `struct_span_warn`) not pollute the builds of dependent crates. Thanks to @kennytm for pointing out the potential of `can_emit_warnings` for this purpose. Resolves rust-lang#44213.
Building Euclid on nightly now produces a gazillion of warnings that were not there before.
Cc @nical @SimonSapin
The text was updated successfully, but these errors were encountered: