-
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 10 pull requests #90067
Rollup of 10 pull requests #90067
Conversation
* {:.PREC?} already had legitimately useful behavior (recursive formatting of structs using fixed precision for floats) and I suspect that changes to the output there would be unwelcome. (besides, precision introduces sinister edge cases where a number can be rounded up to one of the thresholds) Thus, the new behavior of Debug is, "dynamically switch to exponential, but only if there's no precision." * This could not be implemented in terms of float_to_decimal_common without repeating the branch on precision, so 'float_to_general_debug' is a new function. The name is '_debug' instead of '_common' because the considerations in the previous bullet make this logic pretty specific to Debug. * 'float_to_decimal_common' is now only used by Display, so I inlined the min_precision argument and renamed the function accordingly.
I originally added this bound in an attempt to make the specialization sound for owning iterators but it was never correct here and the correct and already implemented solution is is to place it on the IntoIter implementation.
…tation page * Rename "type-decl" into "item-decl" to reflect the change of usage
Headings in the top-doc docblock still get a border-bottom due to a rule that covers all h2, h3, and h4. Method docblocks are generally h5, and so don't get a border-bottom anymore. This fixes a problem where a sub-sub-heading within a method would have a line that went all the way across the page, creating a division that made that sub-sub-heading look much more important than it really is.
std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
Fix typo.
…, r=yaahc Automatic exponential formatting in Debug Context: See [this comment from the libs team](rust-lang/rfcs#2729 (comment)) --- Makes `"{:?}"` switch to exponential for floats based on magnitude. The libs team suggested exploring this idea in the discussion thread for RFC rust-lang/rfcs#2729. (**note:** this is **not** an implementation of the RFC; it is an implementation of one of the alternatives) Thresholds chosen were 1e-4 and 1e16. Justification described [here](rust-lang/rfcs#2729 (comment)). **This will require a crater run.** --- As mentioned in the commit message of 8731d4d, this behavior will not apply when a precision is supplied, because I wanted to preserve the following existing and useful behavior of `{:.PREC?}` (which recursively applies `{:.PREC}` to floats in a struct): ```rust assert_eq!( format!("{:.2?}", [100.0, 0.000004]), "[100.00, 0.00]", ) ``` I looked around and am not sure where there are any tests that actually use this in the test suite, though? All things considered, I'm surprised that this change did not seem to break even a single existing test in `x.py test --stage 2`. (even when I tried a smaller threshold of 1e6)
…sleywiser Add support for artifact size profiling This adds support for profiling artifact file sizes (incremental compilation artifacts and query cache to begin with). Eventually we want to track this in perf.rlo so we can ensure that file sizes do not change dramatically on each pull request. This relies on support in measureme: rust-lang/measureme#169. Once that lands we can update this PR to not point to a git dependency. This was worked on together with `@michaelwoerister.` r? `@wesleywiser`
…aahc,dtolnay Alloc features cleanup This sorts and categorizes the `#![features]` in `alloc` and removes unused ones. This is part of rust-lang#87766 The following feature attributes were unnecessary and are removed: ```diff // Library features: -#![feature(cow_is_borrowed)] -#![feature(maybe_uninit_uninit_array)] -#![feature(slice_partition_dedup)] // Language features: -#![feature(arbitrary_self_types)] -#![feature(auto_traits)] -#![feature(box_patterns)] -#![feature(decl_macro)] -#![feature(nll)] ```
remove unnecessary bound on Zip specialization impl I originally added this bound in an attempt to make the specialization sound for owning iterators but it was never correct here and the correct and [already implemented](https://github.com/rust-lang/rust/blob/497ee321af3b8496eaccd7af7b437f18bab81abf/library/alloc/src/vec/into_iter.rs#L220-L232) solution is is to place it on the IntoIter implementation.
Deduplicate panic_fmt std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
Make more `From` impls `const` (libcore) Adding `const` to `From` implementations in the core. `rustc_const_unstable` attribute is not added to unstable implementations. Tracking issue: rust-lang#88674 <details> <summary>Done</summary><div> - `T` from `T` - `T` from `!` - `Option<T>` from `T` - `Option<&T>` from `&Option<T>` - `Option<&mut T>` from `&mut Option<T>` - `Cell<T>` from `T` - `RefCell<T>` from `T` - `UnsafeCell<T>` from `T` - `OnceCell<T>` from `T` - `Poll<T>` from `T` - `u32` from `char` - `u64` from `char` - `u128` from `char` - `char` from `u8` - `AtomicBool` from `bool` - `AtomicPtr<T>` from `*mut T` - `AtomicI(bits)` from `i(bits)` - `AtomicU(bits)` from `u(bits)` - `i(bits)` from `NonZeroI(bits)` - `u(bits)` from `NonZeroU(bits)` - `NonNull<T>` from `Unique<T>` - `NonNull<T>` from `&T` - `NonNull<T>` from `&mut T` - `Unique<T>` from `&mut T` - `Infallible` from `!` - `TryIntError` from `!` - `TryIntError` from `Infallible` - `TryFromSliceError` from `Infallible` - `FromResidual for Option<T>` </div></details> <details> <summary>Remaining</summary><dev> - `NonZero` from `NonZero` These can't be made const at this time because these use Into::into. https://github.com/rust-lang/rust/blob/master/library/core/src/convert/num.rs#L393 - `std`, `alloc` There may still be many implementations that can be made `const`. </div></details>
… r=jsha Fix rustdoc UI for very long type names Fixes rust-lang#89972. While working on it, I also discovered that when the item name is too long, it also breaks the flow of the page. To make things right, I also renamed the `type-decl` CSS class into `item-decl` (because this PR also generates it for more than type declarations). So here are the before/after screenshots: ![Screenshot from 2021-10-18 16-58-03](https://user-images.githubusercontent.com/3050060/137757247-637fcf04-4406-49c6-8a8a-18c2074aacd9.png) ![Screenshot from 2021-10-18 16-58-26](https://user-images.githubusercontent.com/3050060/137757252-17935e63-53b3-449f-a535-7be91ff0e257.png) ![Screenshot from 2021-10-18 16-58-07](https://user-images.githubusercontent.com/3050060/137757278-8b12e348-2980-4fc4-8853-bef99d58981f.png) ![Screenshot from 2021-10-18 16-58-28](https://user-images.githubusercontent.com/3050060/137757282-534a0e1b-3016-49ba-b3ac-e45bdb9035cb.png) r? ``@jsha``
Revert rust-lang#86011 to fix an incorrect bound check This reverts commit 36a1076, reversing changes made to e1e9319. Fixes rust-lang#89935 r? ``@estebank``
Remove border-bottom from most docblocks. Headings in the top-doc docblock still get a border-bottom due to a rule that covers all h2, h3, and h4. Method docblocks are generally h5, and so don't get a border-bottom anymore. This fixes a problem where a sub-sub-heading within a method would have a line that went all the way across the page, creating a division that made that sub-sub-heading look much more important than it really is. Fixes rust-lang#90033 Demo at https://jacob.hoffman-andrews.com/rust/less-rule/std/string/struct.String.html r? ``@GuillaumeGomez``
…lacrum Update RELEASES.md Fix typo.
@bors r+ rollup=never p=10 |
📌 Commit e54ebe9 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (42983a2): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Finished benchmarking commit (42983a2): comparison url. Summary: This change led to moderate relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
Unclear cause for the regression here -- unfortunately, this is both a fairly big rollup and contains multiple PRs which could be perf-sensitive. These seem like the most likely candidates:
@JohnTitor Can you post reverts for each so we can evaluate the regression here? In the future, it would be good to limit rollups to smaller sizes, as that decreases the risk of pulling in multiple perf-changing PRs (as I suspect happened here). |
Successful merges:
From
implsconst
(libcore) #90009 (Make moreFrom
implsconst
(libcore))Sized
predicate to end of list #86011 to fix an incorrect bound check)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup