-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 18 pull requests #81578
Rollup of 18 pull requests #81578
Commits on Dec 15, 2020
-
Configuration menu - View commit details
-
Copy full SHA for fe2880a - Browse repository at this point
Copy the full SHA fe2880aView commit details
Commits on Dec 18, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a55039d - Browse repository at this point
Copy the full SHA a55039dView commit details
Commits on Dec 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 05af421 - Browse repository at this point
Copy the full SHA 05af421View commit details
Commits on Dec 29, 2020
-
Stabilize by-value
[T; N]
iteratorcore::array::IntoIter
Tracking issue: #65798 This is unblocked now that `min_const_generics` has been stabilized in #79135. This PR does *not* include the corresponding `IntoIterator` impl, which is #65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
Configuration menu - View commit details
-
Copy full SHA for 61c49d4 - Browse repository at this point
Copy the full SHA 61c49d4View commit details
Commits on Jan 12, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 12014d2 - Browse repository at this point
Copy the full SHA 12014d2View commit details
Commits on Jan 15, 2021
-
Configuration menu - View commit details
-
Copy full SHA for b50df6d - Browse repository at this point
Copy the full SHA b50df6dView commit details
Commits on Jan 19, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 8758083 - Browse repository at this point
Copy the full SHA 8758083View commit details
Commits on Jan 21, 2021
-
Add example to array::IntoIter::new’s doc-comment
Co-authored-by: Ashley Mannix <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 83d32b0 - Browse repository at this point
Copy the full SHA 83d32b0View commit details
Commits on Jan 27, 2021
-
Configuration menu - View commit details
-
Copy full SHA for a398994 - Browse repository at this point
Copy the full SHA a398994View commit details
Commits on Jan 28, 2021
-
Clone entire
TokenCursor
when collecting tokensReverts PR #80830 Fixes taiki-e/pin-project#312 We can have an arbitrary number of `None`-delimited group frames pushed on the stack due to proc-macro invocations, which can legally be exited. Attempting to account for this would add a lot of complexity for a tiny performance gain, so let's just use the original strategy.
Configuration menu - View commit details
-
Copy full SHA for 5d73918 - Browse repository at this point
Copy the full SHA 5d73918View commit details -
Configuration menu - View commit details
-
Copy full SHA for ada714d - Browse repository at this point
Copy the full SHA ada714dView commit details
Commits on Jan 30, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 81ed4cf - Browse repository at this point
Copy the full SHA 81ed4cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56c2736 - Browse repository at this point
Copy the full SHA 56c2736View commit details -
Balance sidebar
Deref
cycle check with main contentThe `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path.
Configuration menu - View commit details
-
Copy full SHA for 7e32178 - Browse repository at this point
Copy the full SHA 7e32178View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a2a5f0 - Browse repository at this point
Copy the full SHA 4a2a5f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 55d6247 - Browse repository at this point
Copy the full SHA 55d6247View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3048ee - Browse repository at this point
Copy the full SHA d3048eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d7ef10 - Browse repository at this point
Copy the full SHA 6d7ef10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 131ee07 - Browse repository at this point
Copy the full SHA 131ee07View commit details -
Edit rustc_typeck top-level docs
Edit punctuation and wording in note on type variables vs. type parameters. Also add missing punctuation and two inter-doc links.
Configuration menu - View commit details
-
Copy full SHA for adfb04f - Browse repository at this point
Copy the full SHA adfb04fView commit details -
Configuration menu - View commit details
-
Copy full SHA for fe4ac95 - Browse repository at this point
Copy the full SHA fe4ac95View commit details -
Configuration menu - View commit details
-
Copy full SHA for bef4ec2 - Browse repository at this point
Copy the full SHA bef4ec2View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1cd179 - Browse repository at this point
Copy the full SHA f1cd179View commit details
Commits on Jan 31, 2021
-
Rollup merge of #78044 - oberien:empty-seek, r=m-ou-se
Implement io::Seek for io::Empty Fix #78029
Configuration menu - View commit details
-
Copy full SHA for 1bf1305 - Browse repository at this point
Copy the full SHA 1bf1305View commit details -
Rollup merge of #79285 - yoshuawuyts:stabilize-arc_mutate_strong_coun…
…t, r=m-ou-se Stabilize Arc::{increment,decrement}_strong_count Tracking issue: #71983 Stabilizes `Arc::{incr,decr}_strong_count`, enabling unsafely incrementing an decrementing the Arc strong count directly with fewer gotchas. This API was first introduced on nightly six months ago, and has not seen any changes since. The initial PR showed two existing pieces of code that would benefit from this API, and included a change inside the stdlib to use this. Given the small surface area, predictable use, and no changes since introduction, I'd like to propose we stabilize this. closes #71983 r? `@Mark-Simulacrum` ## Links * [Initial implementation](#70733) * [Motivation from #68700](#68700 (comment)) * [Real world example in an executor](https://docs.rs/extreme/666.666.666666/src/extreme/lib.rs.html#13)
Configuration menu - View commit details
-
Copy full SHA for ac37c32 - Browse repository at this point
Copy the full SHA ac37c32View commit details -
Rollup merge of #80053 - gilescope:include-ignore, r=m-ou-se
stabilise `cargo test -- --include-ignored` stabilise `cargo test -- --include-ignored` On stable there's no way to run ignored tests as well as the normal tests. An example use case where stabilising this would help: Exercism has some initial tests and then some additional ignored tests that people run currently with --ignore but currently they can't run all the tests in one go without being on nightly. It would be a little more ergonomic if this flag was stablilised. ( Fixes #65770 ) I built with ./x.py build -i library/test - but as libtest is a dylib is there an easy way to invoke it manually to check it's working as expected? (I've updated the automated tests.)
Configuration menu - View commit details
-
Copy full SHA for b28a1b2 - Browse repository at this point
Copy the full SHA b28a1b2View commit details -
Rollup merge of #80279 - Yaulendil:str-as-mut, r=m-ou-se
Implement missing `AsMut<str>` for `str` Allows `&mut str` to be taken by a Generic which requires `T` such that `T: AsMut<str>`. Motivating example: ```rust impl<'i, T> From<T> for StructImmut<'i> where T: AsRef<str> + 'i, { fn from(asref: T) -> Self { let string: &str = asref.as_ref(); // ... } } impl<'i, T> From<T> for StructMut<'i> where T: AsMut<str> + 'i, { fn from(mut asmut: T) -> Self { let string: &mut str = asmut.as_mut(); // ... } } ``` The Immutable form of this structure can be constructed by `StructImmut::from(s)` where `s` may be a `&String` or a `&str`, because `AsRef<str>` is implemented for `str`. However, the mutable form of the structure can be constructed in the same way **only** with a `&mut String`, and **not** with a `&mut str`. This change does have some precedent, because as can be seen in [the Implementors](https://doc.rust-lang.org/std/convert/trait.AsMut.html#implementors), `AsMut<[T]>` is implemented for `[T]` as well as for `Vec<T>`, but `AsMut<str>` is implemented only for `String`. This would complete the symmetry. As a trait implementation, this should be immediately stable.
Configuration menu - View commit details
-
Copy full SHA for 054c29d - Browse repository at this point
Copy the full SHA 054c29dView commit details -
Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-se
Stabilize by-value `[T; N]` iterator `core::array::IntoIter` Tracking issue: #65798 This is unblocked now that `min_const_generics` has been stabilized in #79135. This PR does *not* include the corresponding `IntoIterator` impl, which is #65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
Configuration menu - View commit details
-
Copy full SHA for 1e99f26 - Browse repository at this point
Copy the full SHA 1e99f26View commit details -
Rollup merge of #80945 - sdroege:downcast-send-sync, r=m-ou-se
Add Box::downcast() for dyn Any + Send + Sync Looks like a plain omission, but unfortunately I just needed that in my code :)
Configuration menu - View commit details
-
Copy full SHA for caf2c06 - Browse repository at this point
Copy the full SHA caf2c06View commit details -
Rollup merge of #81048 - yoshuawuyts:stabilize-core-slice-fill-with, …
…r=m-ou-se Stabilize `core::slice::fill_with` _Tracking issue: https://github.com/rust-lang/rust/issues/79221_ This stabilizes the `slice_fill_with` feature for Rust 1.51, following the stabilization of `slice_fill` in 1.50. This was requested by libs team members in #79213. This PR also adds the "memset" alias for `slice::fill_with`, mirroring the alias set on the `slice::fill` sibling API. This will ensure someone looking for "memset" will find both variants. r? `@Amanieu`
Configuration menu - View commit details
-
Copy full SHA for 0793fab - Browse repository at this point
Copy the full SHA 0793fabView commit details -
Rollup merge of #81198 - dtolnay:partialeq, r=m-ou-se
Remove requirement that forces symmetric and transitive PartialEq impls to exist ### Counterexample of symmetry: If you [have](https://docs.rs/proc-macro2/1.0.24/proc_macro2/struct.Ident.html#impl-PartialEq%3CT%3E) an impl like: ```rust impl<T> PartialEq<T> for Ident where T: ?Sized + AsRef<str> ``` then Rust will not even allow the symmetric impl to exist. ```console error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Ident`) --> src/main.rs:9:6 | 9 | impl<T> PartialEq<Ident> for T where T: ?Sized + AsRef<str> { | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Ident`) | = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last ``` <br> ### Counterexample of transitivity: Consider these two existing impls from `regex` and `clap`: ```rust // regex /// An inline representation of `Option<char>`. pub struct Char(u32); impl PartialEq<char> for Char { fn eq(&self, other: &char) -> bool { self.0 == *other as u32 } } ``` ```rust // clap pub(crate) enum KeyType { Short(char), Long(OsString), Position(u64), } impl PartialEq<char> for KeyType { fn eq(&self, rhs: &char) -> bool { match self { KeyType::Short(c) => c == rhs, _ => false, } } } ``` It's nice to be able to add `PartialEq<proc_macro::Punct> for char` in libproc_macro (#80595), but it makes no sense to force an `impl PartialEq<Punct> for Char` and `impl PartialEq<Punct> for KeyType` in `regex` and `clap` in code that otherwise has nothing to do with proc macros. <br> `@rust-lang/libs`
Configuration menu - View commit details
-
Copy full SHA for 13b3294 - Browse repository at this point
Copy the full SHA 13b3294View commit details -
Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwco
Account for existing `_` field pattern when suggesting `..` Follow up to #80017.
Configuration menu - View commit details
-
Copy full SHA for 84b6f46 - Browse repository at this point
Copy the full SHA 84b6f46View commit details -
Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…
…enkov Clone entire `TokenCursor` when collecting tokens Reverts PR #80830 Fixes taiki-e/pin-project#312 We can have an arbitrary number of `None`-delimited group frames pushed on the stack due to proc-macro invocations, which can legally be exited. Attempting to account for this would add a lot of complexity for a tiny performance gain, so let's just use the original strategy.
Configuration menu - View commit details
-
Copy full SHA for 3e8ae5d - Browse repository at this point
Copy the full SHA 3e8ae5dView commit details -
Rollup merge of #81484 - Kogia-sima:perf/optimize-udiv_1e19, r=nagisa
Optimize decimal formatting of 128-bit integers ## Description This PR optimizes the `udivmod_1e19` function, which is used for formatting 128-bit integers, based on the algorithm provided in \[1\]. This optimization improves performance of formatting 128-bit integers, especially on 64-bit architectures. It also slightly reduces the output binary size. ## Assembler comparison https://godbolt.org/z/YrG5zY ## Performance #### previous results ``` test fmt::write_u128_max ... bench: 552 ns/iter (+/- 4) test fmt::write_u128_min ... bench: 125 ns/iter (+/- 2) ``` #### new results ``` test fmt::write_u128_max ... bench: 205 ns/iter (+/- 13) test fmt::write_u128_min ... bench: 129 ns/iter (+/- 5) ``` ## Reference \[1\] T. Granlund and P. Montgomery, “Division by Invariant Integers Using Multiplication” in Proc. of the SIGPLAN94 Conference on Programming Language Design and Implementation, 1994, pp. 61–72
Configuration menu - View commit details
-
Copy full SHA for fd868d0 - Browse repository at this point
Copy the full SHA fd868d0View commit details -
Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…
…omez Balance sidebar `Deref` cycle check with main content The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path. Fixes #81395 r? ```@GuillaumeGomez```
Configuration menu - View commit details
-
Copy full SHA for 4de3181 - Browse repository at this point
Copy the full SHA 4de3181View commit details -
Rollup merge of #81509 - 0yoyoyo:fix-issue-72685-ice-drop-in-place, r…
…=estebank Add a regression test for ICE of bad_placeholder_type Add a regression test for #72685. Check the error message is output instead of ICE.
Configuration menu - View commit details
-
Copy full SHA for c74f004 - Browse repository at this point
Copy the full SHA c74f004View commit details -
Rollup merge of #81547 - pierwill:edit-typeck-mod-docs, r=davidtwco
Edit rustc_typeck top-level docs Edit punctuation and wording in note on type variables vs. type parameters. Also add missing punctuation and two inter-doc links.
Configuration menu - View commit details
-
Copy full SHA for 33cd862 - Browse repository at this point
Copy the full SHA 33cd862View commit details -
Rollup merge of #81550 - xfix:replace-mention-of-predecessor, r=jonas…
…-schievink Replace predecessor with range in collections documentation Fixes #81548.
Configuration menu - View commit details
-
Copy full SHA for 635dbd6 - Browse repository at this point
Copy the full SHA 635dbd6View commit details -
Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomez
Fix ascii art text wrapping in mobile Fix #81377 Before ![image](https://user-images.githubusercontent.com/4687791/106362405-a1a53800-635d-11eb-87b9-2f40bbd023bf.png) ![image](https://user-images.githubusercontent.com/4687791/106362410-aa960980-635d-11eb-96ee-979251b213a3.png) ![image](https://user-images.githubusercontent.com/4687791/106362562-80911700-635e-11eb-97ee-b19a6ea2fc6d.png) After ![image](https://user-images.githubusercontent.com/4687791/106362428-b4b80800-635d-11eb-8d5b-e4f51f5501ee.png) ![image](https://user-images.githubusercontent.com/4687791/106362433-bbdf1600-635d-11eb-96af-7043c74b3a0a.png) ![image](https://user-images.githubusercontent.com/4687791/106362570-8f77c980-635e-11eb-928d-ef1d26c13136.png) Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.
Configuration menu - View commit details
-
Copy full SHA for 45d24c7 - Browse repository at this point
Copy the full SHA 45d24c7View commit details -
Rollup merge of #81562 - the8472:improve-inplaceiterable-docs, r=sfac…
…kler Clarify that InPlaceIterable guarantees extend to all advancing iterator methods. A documentation update that should answer a question that came up in [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Safety.20guarantees.20of.20InPlaceIterable/near/223743336) CC `@SkiFire13`
Configuration menu - View commit details
-
Copy full SHA for 7097105 - Browse repository at this point
Copy the full SHA 7097105View commit details -
Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomez
Improve docblock readability on small screen Before ![image](https://user-images.githubusercontent.com/4687791/106363174-f77bdf00-6361-11eb-898f-d480b8460ab3.png) After ![image](https://user-images.githubusercontent.com/4687791/106363259-6bb68280-6362-11eb-85a1-ef9262681dd7.png) Too much space is wasted on the left side. I wanted to make that 0 but it breaks some part with error symbols. 0 ![image](https://user-images.githubusercontent.com/4687791/106363287-90aaf580-6362-11eb-88c1-62a8313988a7.png) After ![image](https://user-images.githubusercontent.com/4687791/106363276-825cd980-6362-11eb-86eb-6f4611b4ab99.png)
Configuration menu - View commit details
-
Copy full SHA for 8b281d9 - Browse repository at this point
Copy the full SHA 8b281d9View commit details