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

Add #[must_use] to all functions 'fn(float) -> float' #63871

Merged
merged 5 commits into from
Nov 9, 2019

Conversation

BatmanAoD
Copy link
Member

@BatmanAoD BatmanAoD commented Aug 24, 2019

These are pure functions.

impl f32/f64 {
    fn floor(self) -> Self;
    fn ceil(self) -> Self;
    fn round(self) -> Self;
    fn trunc(self) -> Self;
    fn fract(self) -> Self;
    fn abs(self) -> Self;
    fn signum(self) -> Self;
    fn mul_add(self, a: Self, b: Self) -> Self;
    fn div_euclid(self, rhs: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
    fn powi(self, n: i32) -> Self;
    fn powf(self, n: Self) -> Self;
    fn sqrt(self) -> Self;
    fn exp(self) -> Self;
    fn exp2(self) -> Self;
    fn ln(self) -> Self;
    fn log(self, base: Self) -> Self;
    fn log2(self) -> Self;
    fn log10(self) -> Self;
    fn abs_sub(self, other: Self) -> Self;
    fn cbrt(self) -> Self;
    fn hypot(self, other: Self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn tan(self) -> Self;
    fn asin(self) -> Self;
    fn acos(self) -> Self;
    fn atan(self) -> Self;
    fn atan2(self, other: Self) -> Self;
    fn exp_m1(self) -> Self;
    fn ln_1p(self) -> Self;
    fn sinh(self) -> Self;
    fn cosh(self) -> Self;
    fn tanh(self) -> Self;
    fn asinh(self) -> Self;
    fn acosh(self) -> Self;
    fn atanh(self) -> Self;
    fn clamp(self, min: Self, max: Self) -> Self;
}

Part of #48926

@BatmanAoD BatmanAoD added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 24, 2019
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2019
@BatmanAoD BatmanAoD marked this pull request as ready for review August 24, 2019 22:12
@hanna-kruppe
Copy link
Contributor

My impression (confirmed by re-reading the linked issue and others cross-referenced there) was that we don't currently have a precedent for applying must_use sweepingly to entire classses of functions, and instead only add it to individual functions when there's concrete motivation for that specific functions being must_use (i.e., real world bugs involving that function's result being ignored). This PR deviates from that, which... at least requires broader decision-making than just merging it.

@BatmanAoD
Copy link
Member Author

@rkruppe I personally misused .round(), but I don't think there's anything special about round that makes it more likely to be misused. So while I agree that the last comment in that thread recommends a conservative metric for annotatinmg on a per-function basis only, I think that annotating only round would be a code smell at best.

@killercup
Copy link
Member

I don't have any opinion on whether this should land, but if it does, I'd like there to be a message that makes the error a bit more expressive (something along the lines of #[must_use = "method returns a new number and does not mutate the caller"]).

@BatmanAoD
Copy link
Member Author

@killercup That sounds good! How about "...mutate the original value" rather than "caller"?

@joshtriplett
Copy link
Member

joshtriplett commented Aug 28, 2019

I feel like this makes sense, and fits the spirit of must_use. I also feel like many of these functions, because they operate on a number, might look like they could mutate the number in-place, so I think they fit the use case of must_use.

I don't know of any general policy for whether we should add must_use annotations to any function that fits such a pattern. I personally feel we should, but I also do want to get some opinions and broader consensus first. As such:

@rfcbot merge

@BatmanAoD
Copy link
Member Author

@joshtriplett I think it would be good to continue the discussion in the linked tracking issue and eventually determine a heuristic that Clippy can apply to treat certain types of functions as must_use even if they're not explicitly annotated. By introducing such a heuristic in Clippy first, we can have an immediate benefit but also determine how widespread the effect of a lint in the compiler itself would be.

@BatmanAoD
Copy link
Member Author

I've added the message discussed above. I've also added must_use to functions that take additional arguments beyond self but still return a single new float.

One such function, sub_abs, is deprecated, but I'm assuming it's okay to add new annotations to deprecated functions.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-28T15:42:35.1416231Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-28T15:42:35.1643996Z ##[command]git config gc.auto 0
2019-08-28T15:42:35.1818089Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-28T15:42:35.1896048Z ##[command]git config --get-all http.proxy
2019-08-28T15:42:35.2065713Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63871/merge:refs/remotes/pull/63871/merge
---
2019-08-28T16:46:00.4040306Z .................................................................................................... 1500/8969
2019-08-28T16:46:06.3208847Z .................................................................................................... 1600/8969
2019-08-28T16:46:19.5727777Z .............................................i...............i...................................... 1700/8969
2019-08-28T16:46:28.1883740Z .................................................................................................... 1800/8969
2019-08-28T16:46:43.0283762Z ....................................iiiii........................................................... 1900/8969
2019-08-28T16:46:54.4033275Z .................................................................................................... 2100/8969
2019-08-28T16:46:57.0661977Z .................................................................................................... 2200/8969
2019-08-28T16:47:01.5411426Z .................................................................................................... 2300/8969
2019-08-28T16:47:09.1004222Z .................................................................................................... 2400/8969
---
2019-08-28T16:50:15.0688482Z .......................i...............i............................................................ 4700/8969
2019-08-28T16:50:27.1544472Z .................................................................................................... 4800/8969
2019-08-28T16:50:33.6882152Z .................................................................................................... 4900/8969
2019-08-28T16:50:44.9591664Z .................................................................................................... 5000/8969
2019-08-28T16:50:50.4001723Z ....ii.ii........................................................................................... 5100/8969
2019-08-28T16:51:05.0707634Z .................................................................................................... 5300/8969
2019-08-28T16:51:12.6433592Z ...................................................................i................................ 5400/8969
2019-08-28T16:51:20.3248160Z .................................................................................................... 5500/8969
2019-08-28T16:51:27.5880059Z .................................................................................................... 5600/8969
2019-08-28T16:51:27.5880059Z .................................................................................................... 5600/8969
2019-08-28T16:51:38.2835392Z .............................................................ii...i..ii...........i................. 5700/8969
2019-08-28T16:52:04.9100807Z .................................................................................................... 5900/8969
2019-08-28T16:52:14.9167931Z .................................................................................................... 6000/8969
2019-08-28T16:52:14.9167931Z .................................................................................................... 6000/8969
2019-08-28T16:52:22.0602498Z ..............................................................i..ii................................. 6100/8969
2019-08-28T16:52:50.8454658Z .................................................................................................... 6300/8969
2019-08-28T16:52:53.1025249Z .................i.................................................................................. 6400/8969
2019-08-28T16:52:55.3296970Z .........................................................................................i.......... 6500/8969
2019-08-28T16:52:58.1492226Z .................................................................................................... 6600/8969
---
2019-08-28T16:57:48.2766523Z  finished in 21.888
2019-08-28T16:57:48.2977318Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:57:48.8260180Z 
2019-08-28T16:57:48.8261035Z running 149 tests
2019-08-28T16:57:51.9096410Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/149
2019-08-28T16:57:53.9185632Z ..iiii..............i.........iii.i......ii......
2019-08-28T16:57:53.9186127Z 
2019-08-28T16:57:53.9190093Z  finished in 5.621
2019-08-28T16:57:53.9382574Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:57:54.1012892Z 
---
2019-08-28T16:57:56.2285015Z  finished in 2.290
2019-08-28T16:57:56.2476844Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:57:56.4090429Z 
2019-08-28T16:57:56.4091164Z running 9 tests
2019-08-28T16:57:56.4092802Z iiiiiiiii
2019-08-28T16:57:56.4093573Z 
2019-08-28T16:57:56.4098390Z  finished in 0.162
2019-08-28T16:57:56.4289001Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:57:56.5917661Z 
---
2019-08-28T16:58:14.8812607Z  finished in 18.452
2019-08-28T16:58:14.9006080Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:58:15.0668052Z 
2019-08-28T16:58:15.0668290Z running 122 tests
2019-08-28T16:58:40.1871805Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
2019-08-28T16:58:44.9389986Z .i.i......iii.i.....ii
2019-08-28T16:58:44.9390461Z 
2019-08-28T16:58:44.9395059Z  finished in 30.039
2019-08-28T16:58:44.9404925Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-28T16:58:44.9407951Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-08-28T17:13:02.6142835Z 
2019-08-28T17:13:02.6143545Z    Doc-tests core
2019-08-28T17:13:07.9449659Z 
2019-08-28T17:13:07.9455248Z running 2379 tests
2019-08-28T17:13:20.8317847Z ......iiiii......................................................................................... 100/2379
2019-08-28T17:13:33.6255985Z .........................................................................ii......................... 200/2379
2019-08-28T17:14:04.7392363Z .................................................................................................... 400/2379
2019-08-28T17:14:04.7392363Z .................................................................................................... 400/2379
2019-08-28T17:14:16.4858111Z ..............................i..i.................iiii............................................. 500/2379
2019-08-28T17:14:42.1247437Z .................................................................................................... 700/2379
2019-08-28T17:14:55.2519132Z .................................................................................................... 800/2379
2019-08-28T17:15:07.9026516Z .................................................................................................... 900/2379
2019-08-28T17:15:20.7127913Z .................................................................................................... 1000/2379
---
2019-08-28T17:18:40.8366711Z    Compiling rand_pcg v0.1.1
2019-08-28T17:18:40.8367188Z    Compiling rand_chacha v0.1.0
2019-08-28T17:18:41.2274185Z    Compiling rand v0.6.1
2019-08-28T17:18:45.6157653Z    Compiling std v0.0.0 (/checkout/src/libstd)
2019-08-28T17:19:11.5044247Z error: unused return value of `realstd::f32::<impl f32>::clamp` that must be used
2019-08-28T17:19:11.5045683Z     --> src/libstd/f32.rs:1635:9
2019-08-28T17:19:11.5046242Z      |
2019-08-28T17:19:11.5046805Z 1635 |         1.0f32.clamp(3.0, 1.0);
2019-08-28T17:19:11.5047799Z      |
2019-08-28T17:19:11.5048328Z      = note: `-D unused-must-use` implied by `-D warnings`
2019-08-28T17:19:11.5048328Z      = note: `-D unused-must-use` implied by `-D warnings`
2019-08-28T17:19:11.5048903Z      = note: method returns a new number and does not mutate the original value
2019-08-28T17:19:11.5049110Z 
2019-08-28T17:19:11.5049632Z error: unused return value of `realstd::f32::<impl f32>::clamp` that must be used
2019-08-28T17:19:11.5050146Z     --> src/libstd/f32.rs:1641:9
2019-08-28T17:19:11.5050610Z      |
2019-08-28T17:19:11.5051127Z 1641 |         1.0f32.clamp(NAN, 1.0);
2019-08-28T17:19:11.5052618Z      |
2019-08-28T17:19:11.5052618Z      |
2019-08-28T17:19:11.5053162Z      = note: method returns a new number and does not mutate the original value
2019-08-28T17:19:11.5053365Z 
2019-08-28T17:19:11.5053852Z error: unused return value of `realstd::f32::<impl f32>::clamp` that must be used
2019-08-28T17:19:11.5054337Z     --> src/libstd/f32.rs:1647:9
2019-08-28T17:19:11.5054808Z      |
2019-08-28T17:19:11.5055349Z 1647 |         1.0f32.clamp(3.0, NAN);
2019-08-28T17:19:11.5056608Z      |
2019-08-28T17:19:11.5056608Z      |
2019-08-28T17:19:11.5057150Z      = note: method returns a new number and does not mutate the original value
2019-08-28T17:19:11.8629187Z error: aborting due to 3 previous errors
2019-08-28T17:19:11.8630009Z 
2019-08-28T17:19:12.1287704Z error: Could not compile `std`.
2019-08-28T17:19:12.1287885Z 
2019-08-28T17:19:12.1287885Z 
2019-08-28T17:19:12.1299251Z To learn more, run the command again with --verbose.
2019-08-28T17:19:12.1315777Z 
2019-08-28T17:19:12.1316011Z 
2019-08-28T17:19:12.1317169Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "std" "--" "--quiet"
2019-08-28T17:19:12.1317382Z 
2019-08-28T17:19:12.1317418Z 
2019-08-28T17:19:12.1325659Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-08-28T17:19:12.1325952Z Build completed unsuccessfully in 1:29:20
2019-08-28T17:19:12.1325952Z Build completed unsuccessfully in 1:29:20
2019-08-28T17:19:12.1383692Z == clock drift check ==
2019-08-28T17:19:12.1413497Z   local time: Wed Aug 28 17:19:12 UTC 2019
2019-08-28T17:19:12.2288502Z   network time: Wed, 28 Aug 2019 17:19:12 GMT
2019-08-28T17:19:12.2293658Z == end clock drift check ==
2019-08-28T17:19:13.0935030Z ##[error]Bash exited with code '1'.
2019-08-28T17:19:13.0971514Z ##[section]Starting: Checkout
2019-08-28T17:19:13.0973778Z ==============================================================================
2019-08-28T17:19:13.0973835Z Task         : Get sources
2019-08-28T17:19:13.0973901Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@BatmanAoD
Copy link
Member Author

BatmanAoD commented Aug 28, 2019 via email

@BatmanAoD
Copy link
Member Author

Ah, okay, those are should_panic tests. I'll un-annotate clamp for now. I wonder if it would be appropriate to allow-unused by default in should_panic tests?

@BatmanAoD
Copy link
Member Author

We could fix the tests (let _ =), but that could lead to some ecosystem breakage if anyone else is intentionally triggering panic with clamp (or any other floating-point lib function). How do we make the decision?

@@ -1015,7 +1015,8 @@ impl f32 {
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
/// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
/// ```
#[must_use = "method returns a new number and does not mutate the original value"]
// The tests below invoke `clamp` without a return value in order to cause a `panic`.
Copy link
Contributor

@fbstj fbstj Aug 29, 2019

Choose a reason for hiding this comment

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

are these worthy of FIXME or some kind of (new?) issue number?

@BatmanAoD
Copy link
Member Author

BatmanAoD commented Aug 29, 2019 via email

@BatmanAoD
Copy link
Member Author

I've gone ahead and restored the annotation for clamp and fixed the tests.

@JohnCSimon
Copy link
Member

Ping from triage
@joshtriplett @fbstj can you please re-review this PR?

CC @BatmanAoD

Thanks!

@joshtriplett
Copy link
Member

I'm a little confused why rfcbot didn't do its thing.

Let's try this instead:

@rfcbot poll Merge this?

@rfcbot
Copy link

rfcbot commented Sep 20, 2019

Team member @joshtriplett has asked teams: T-libs, for consensus on:

Merge this?

@Centril
Copy link
Contributor

Centril commented Sep 29, 2019

I'm a little confused why rfcbot didn't do its thing.

The team label was T-libs and you're not on that team. :)

Ping @Amanieu @Kimundi @SimonSapin @sfackler @withoutboats

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 27, 2019
@Dylan-DPC-zz
Copy link

Thanks @withoutboats

@bors
Copy link
Contributor

bors commented Oct 27, 2019

⌛ Testing commit 1aa5d0c with merge 4e54f7c3b97b164eb2c6728afa0453e590016a83...

Centril added a commit to Centril/rust that referenced this pull request Oct 27, 2019
…boats

Add #[must_use] to all functions 'fn(float) -> float'

These are pure functions.

```rust
impl f32/f64 {
    fn floor(self) -> Self;
    fn ceil(self) -> Self;
    fn round(self) -> Self;
    fn trunc(self) -> Self;
    fn fract(self) -> Self;
    fn abs(self) -> Self;
    fn signum(self) -> Self;
    fn mul_add(self, a: Self, b: Self) -> Self;
    fn div_euclid(self, rhs: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
    fn powi(self, n: i32) -> Self;
    fn powf(self, n: Self) -> Self;
    fn sqrt(self) -> Self;
    fn exp(self) -> Self;
    fn exp2(self) -> Self;
    fn ln(self) -> Self;
    fn log(self, base: Self) -> Self;
    fn log2(self) -> Self;
    fn log10(self) -> Self;
    fn abs_sub(self, other: Self) -> Self;
    fn cbrt(self) -> Self;
    fn hypot(self, other: Self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn tan(self) -> Self;
    fn asin(self) -> Self;
    fn acos(self) -> Self;
    fn atan(self) -> Self;
    fn atan2(self, other: Self) -> Self;
    fn exp_m1(self) -> Self;
    fn ln_1p(self) -> Self;
    fn sinh(self) -> Self;
    fn cosh(self) -> Self;
    fn tanh(self) -> Self;
    fn asinh(self) -> Self;
    fn acosh(self) -> Self;
    fn atanh(self) -> Self;
    fn clamp(self, min: Self, max: Self) -> Self;
}
```

Part of rust-lang#48926
@Centril
Copy link
Contributor

Centril commented Oct 27, 2019

@bors retry rolled up.

@bors
Copy link
Contributor

bors commented Oct 27, 2019

⌛ Testing commit 1aa5d0c with merge dd5967887cb4a8743d649c137db63863a4e29f34...

@rust-highfive
Copy link
Collaborator

The job i686-mingw-1 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-27T21:48:39.8108677Z do so (now or later) by using -b with the checkout command again. Example:
2019-10-27T21:48:39.8109898Z 
2019-10-27T21:48:39.8110463Z   git checkout -b <new-branch-name>
2019-10-27T21:48:39.8110921Z 
2019-10-27T21:48:39.8111340Z HEAD is now at dd5967887 Auto merge of #63871 - BatmanAoD:FloatFnMustUse, r=withoutboats
2019-10-27T21:48:39.8525737Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-10-27T21:48:39.8632326Z ==============================================================================
2019-10-27T21:48:39.8632435Z Task         : Bash
2019-10-27T21:48:39.8632544Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-10-27T23:48:08.0604866Z 
2019-10-27T23:48:08.0604909Z 
2019-10-27T23:48:08.1336557Z failed to run: D:\a\1\s\build\bootstrap\debug\bootstrap test --exclude src/test/ui --exclude src/test/compile-fail
2019-10-27T23:48:08.1336784Z Build completed unsuccessfully in 1:49:03
2019-10-27T23:48:08.1612763Z make: *** [Makefile:89: ci-mingw-subset-1] Error 1
2019-10-27T23:48:08.2382472Z   local time: Sun Oct 27 23:48:08 CUT 2019
2019-10-27T23:48:08.9043086Z   network time: Sun, 27 Oct 2019 23:48:08 GMT
2019-10-27T23:48:08.9059825Z == end clock drift check ==
2019-10-27T23:48:08.9710180Z 
2019-10-27T23:48:08.9710180Z 
2019-10-27T23:48:09.3290223Z ##[error]Bash exited with code '2'.
2019-10-27T23:48:09.3900266Z ##[section]Starting: Upload CPU usage statistics
2019-10-27T23:48:09.4838220Z ==============================================================================
2019-10-27T23:48:09.4839110Z Task         : Bash
2019-10-27T23:48:09.4839321Z Description  : Run a Bash script on macOS, Linux, or Windows

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Oct 27, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 27, 2019
@JohnCSimon
Copy link
Member

Ping from triage
@BatmanAoD can you please fix the test failures?
cc: @SimonSapin
Thanks

@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2019
@JohnCSimon
Copy link
Member

Ping again from triage
@BatmanAoD can you please fix the test failures?
cc: @SimonSapin @withoutboats
Thanks

@BatmanAoD
Copy link
Member Author

As far as I can tell, this is a spurious failure:

2019-10-27T23:48:07.1759600Z Compiling compiler_builtins v0.1.18
2019-10-27T23:48:07.1798193Z error: failed to remove file `D:\a\1\s\build\i686-pc-windows-gnu\stage1-std\i686-pc-windows-gnu\release\deps\libcompiler_builtins-4f0583857a7f6e60.rlib`
2019-10-27T23:48:07.1799014Z
2019-10-27T23:48:07.1799241Z Caused by:
2019-10-27T23:48:07.1799814Z Access is denied. (os error 5)

How do I request a retry?

@Dylan-DPC-zz
Copy link

@bors: retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 9, 2019
@bors
Copy link
Contributor

bors commented Nov 9, 2019

⌛ Testing commit 1aa5d0c with merge ac162c6...

bors added a commit that referenced this pull request Nov 9, 2019
Add #[must_use] to all functions 'fn(float) -> float'

These are pure functions.

```rust
impl f32/f64 {
    fn floor(self) -> Self;
    fn ceil(self) -> Self;
    fn round(self) -> Self;
    fn trunc(self) -> Self;
    fn fract(self) -> Self;
    fn abs(self) -> Self;
    fn signum(self) -> Self;
    fn mul_add(self, a: Self, b: Self) -> Self;
    fn div_euclid(self, rhs: Self) -> Self;
    fn rem_euclid(self, rhs: Self) -> Self;
    fn powi(self, n: i32) -> Self;
    fn powf(self, n: Self) -> Self;
    fn sqrt(self) -> Self;
    fn exp(self) -> Self;
    fn exp2(self) -> Self;
    fn ln(self) -> Self;
    fn log(self, base: Self) -> Self;
    fn log2(self) -> Self;
    fn log10(self) -> Self;
    fn abs_sub(self, other: Self) -> Self;
    fn cbrt(self) -> Self;
    fn hypot(self, other: Self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn tan(self) -> Self;
    fn asin(self) -> Self;
    fn acos(self) -> Self;
    fn atan(self) -> Self;
    fn atan2(self, other: Self) -> Self;
    fn exp_m1(self) -> Self;
    fn ln_1p(self) -> Self;
    fn sinh(self) -> Self;
    fn cosh(self) -> Self;
    fn tanh(self) -> Self;
    fn asinh(self) -> Self;
    fn acosh(self) -> Self;
    fn atanh(self) -> Self;
    fn clamp(self, min: Self, max: Self) -> Self;
}
```

Part of #48926
@bors
Copy link
Contributor

bors commented Nov 9, 2019

☀️ Test successful - checks-azure
Approved by: withoutboats
Pushing ac162c6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 9, 2019
@bors bors merged commit 1aa5d0c into rust-lang:master Nov 9, 2019
@bors bors mentioned this pull request Nov 9, 2019
@EdorianDark EdorianDark mentioned this pull request Apr 10, 2020
3 tasks
@BatmanAoD BatmanAoD deleted the FloatFnMustUse branch May 29, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet