-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Rollup of 6 pull requests #103472
Rollup of 6 pull requests #103472
Commits on Jul 21, 2022
-
Remove redundant lifetime bound from
impl Borrow for Cow
The lifetime bound `B::Owned: 'a` is redundant and doesn't make a difference, because `Cow<'a, B>` comes with an implicit `B: 'a`, and associated types will outlive lifetimes outlived by the `Self` type (and all the trait's generic parameters, of which there are none in this case), so the implicit `B: 'a` implies `B::Owned: 'a` anyway. The explicit lifetime bound here does however end up in documentation, and that's confusing in my opinion, so let's remove it ^^
Configuration menu - View commit details
-
Copy full SHA for c03d10c - Browse repository at this point
Copy the full SHA c03d10cView commit details
Commits on Sep 1, 2022
-
Sort tests at compile time, not at startup
Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately.
Configuration menu - View commit details
-
Copy full SHA for df6221a - Browse repository at this point
Copy the full SHA df6221aView commit details
Commits on Oct 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 95040a7 - Browse repository at this point
Copy the full SHA 95040a7View commit details
Commits on Oct 22, 2022
-
Truncate thread names on Linux and Apple targets
These targets have system limits on the thread names, 16 and 64 bytes respectively, and `pthread_setname_np` returns an error if the name is longer. However, we're not in a context that can propagate errors when we call this, and we used to implicitly truncate on Linux with `prctl`, so now we manually truncate these names ahead of time.
Configuration menu - View commit details
-
Copy full SHA for 7280f3d - Browse repository at this point
Copy the full SHA 7280f3dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12e4584 - Browse repository at this point
Copy the full SHA 12e4584View commit details -
Configuration menu - View commit details
-
Copy full SHA for 988e75b - Browse repository at this point
Copy the full SHA 988e75bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b614b0e - Browse repository at this point
Copy the full SHA b614b0eView commit details
Commits on Oct 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 15cfeb3 - Browse repository at this point
Copy the full SHA 15cfeb3View commit details
Commits on Oct 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f53b322 - Browse repository at this point
Copy the full SHA f53b322View commit details -
Rollup merge of rust-lang#95710 - fee1-dead-contrib:stabilize_arbitra…
…ry_enum_discriminant, r=joshtriplett Stabilize arbitrary_enum_discriminant, take 2 Documentation has been updated in rust-lang/reference#1055. cc rust-lang#86860 for previous stabilization report. Not yet marks rust-lang#60553 as done: need documentation in the rust reference.
Configuration menu - View commit details
-
Copy full SHA for 152a966 - Browse repository at this point
Copy the full SHA 152a966View commit details -
Rollup merge of rust-lang#99578 - steffahn:remove_redundant_bound, r=…
…thomcc Remove redundant lifetime bound from `impl Borrow for Cow` The lifetime bound `B::Owned: 'a` is redundant and doesn't make a difference, because `Cow<'a, B>` comes with an implicit `B: 'a`, and associated types will outlive lifetimes outlived by the `Self` type (and all the trait's generic parameters, of which there are none in this case), so the implicit `B: 'a` implies `B::Owned: 'a` anyway. The explicit lifetime bound here does however [end up in documentation](https://doc.rust-lang.org/std/borrow/enum.Cow.html#impl-Borrow%3CB%3E), and that's confusing in my opinion, so let's remove it ^^ _(Documentation right now, compare to `AsRef`, too:)_ ![Screenshot_20220722_014055](https://user-images.githubusercontent.com/3986214/180332665-424d0c05-afb3-40d8-a330-a57a2c9a494b.png)
Configuration menu - View commit details
-
Copy full SHA for 8b85815 - Browse repository at this point
Copy the full SHA 8b85815View commit details -
Rollup merge of rust-lang#99939 - saethlin:pre-sort-tests, r=thomcc,j…
…ackh726 Sort tests at compile time, not at startup Recently, another Miri user was trying to run `cargo miri test` on the crate `iced-x86` with `--features=code_asm,mvex`. This configuration has a startup time of ~18 minutes. That's ~18 minutes before any tests even start to run. The fact that this crate has over 26,000 tests and Miri is slow makes a lot of code which is otherwise a bit sloppy but fine into a huge runtime issue. Sorting the tests when the test harness is created instead of at startup time knocks just under 4 minutes out of those ~18 minutes. I have ways to remove most of the rest of the startup time, but this change requires coordinating changes of both the compiler and libtest, so I'm sending it separately. (except for doctests, because there is no compile-time harness)
Configuration menu - View commit details
-
Copy full SHA for 5b72ec8 - Browse repository at this point
Copy the full SHA 5b72ec8View commit details -
Rollup merge of rust-lang#102271 - lopopolo:lopopolo/stabilize-durati…
…on-try-from-secs-float, r=dtolnay Stabilize `duration_checked_float` ## Stabilization Report This stabilization report is for a stabilization of `duration_checked_float`, tracking issue: rust-lang#83400. ### Implementation History - rust-lang#82179 - rust-lang#90247 - rust-lang#96051 - Changed error type to `FromFloatSecsError` in rust-lang#90247 - rust-lang#96051 changes the rounding mode to round-to-nearest instead of truncate. ## API Summary This stabilization report proposes the following API to be stabilized in `core`, along with their re-exports in `std`: ```rust // core::time impl Duration { pub const fn try_from_secs_f32(secs: f32) -> Result<Duration, TryFromFloatSecsError>; pub const fn try_from_secs_f64(secs: f64) -> Result<Duration, TryFromFloatSecsError>; } #[derive(Debug, Clone, PartialEq, Eq)] pub struct TryFromFloatSecsError { ... } impl core::fmt::Display for TryFromFloatSecsError { ... } impl core::error::Error for TryFromFloatSecsError { ... } ``` These functions are made const unstable under `duration_consts_float`, tracking issue rust-lang#72440. There is an open question in the tracking issue around what the error type should be called which I was hoping to resolve in the context of an FCP. In this stabilization PR, I have altered the name of the error type to `TryFromFloatSecsError`. In my opinion, the error type shares the name of the method (adjusted to accommodate both types of floats), which is consistent with other error types in `core`, `alloc` and `std` like `TryReserveError` and `TryFromIntError`. ## Experience Report Code such as this is ready to be converted to a checked API to ensure it is panic free: ```rust impl Time { pub fn checked_add_f64(&self, seconds: f64) -> Result<Self, TimeError> { // Fail safely during `f64` conversion to duration if seconds.is_nan() || seconds.is_infinite() { return Err(TzOutOfRangeError::new().into()); } if seconds.is_sign_positive() { self.checked_add(Duration::from_secs_f64(seconds)) } else { self.checked_sub(Duration::from_secs_f64(-seconds)) } } } ``` See: artichoke/artichoke#2194. ``@rustbot`` label +T-libs-api -T-libs cc ``@mbartlett21``
Configuration menu - View commit details
-
Copy full SHA for 89d2387 - Browse repository at this point
Copy the full SHA 89d2387View commit details -
Rollup merge of rust-lang#103379 - cuviper:truncate-thread-name, r=th…
…omcc Truncate thread names on Linux and Apple targets These targets have system limits on the thread names, 16 and 64 bytes respectively, and `pthread_setname_np` returns an error if the name is longer. However, we're not in a context that can propagate errors when we call this, and we used to implicitly truncate on Linux with `prctl`, so now we manually truncate these names ahead of time. r? ``@thomcc``
Configuration menu - View commit details
-
Copy full SHA for a3618d4 - Browse repository at this point
Copy the full SHA a3618d4View commit details -
Rollup merge of rust-lang#103466 - jruderman:patch-2, r=Dylan-DPC
Fix grammar in docs for std::io::Read Two independent clauses were incorrectly joined by a bare comma. The simplest fix would be to switch to a semicolon, but I think it's slightly better to keep the comma and use the coordinating conjunction "so".
Configuration menu - View commit details
-
Copy full SHA for 9968ed8 - Browse repository at this point
Copy the full SHA 9968ed8View commit details