-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #225 - zackmdavis:conditional_fn_must_use, r=nox
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 -->
- Loading branch information
Showing
6 changed files
with
39 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters