- 21 10月, 2021 3 次提交
-
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
- 20 10月, 2021 12 次提交
-
-
由 bors 提交于
resolve: Use `NameBinding` for local variables and generic parameters `NameBinding` is a structure used for representing any name introduction (an item, or import, or even a built-in). Except that local variables and generic parameters weren't represented as `NameBinding`s, for this reason they requires separate paths in name resolution code in several places. This PR introduces `NameBinding`s for local variables as well and simplifies all the code working with them leaving only the `NameBinding` paths.
-
由 bors 提交于
Rollup of 10 pull requests Successful merges: - #86479 (Automatic exponential formatting in Debug) - #87404 (Add support for artifact size profiling) - #87769 (Alloc features cleanup) - #88789 (remove unnecessary bound on Zip specialization impl) - #88860 (Deduplicate panic_fmt) - #90009 (Make more `From` impls `const` (libcore)) - #90018 (Fix rustdoc UI for very long type names) - #90025 (Revert #86011 to fix an incorrect bound check) - #90036 (Remove border-bottom from most docblocks.) - #90060 (Update RELEASES.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Yuki Okushi 提交于
Update RELEASES.md Fix typo.
-
由 Yuki Okushi 提交于
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 #90033 Demo at https://jacob.hoffman-andrews.com/rust/less-rule/std/string/struct.String.html r? ``@GuillaumeGomez``
-
由 Yuki Okushi 提交于
Revert #86011 to fix an incorrect bound check This reverts commit 36a1076d, reversing changes made to e1e9319d. Fixes #89935 r? ``@estebank``
-
由 Yuki Okushi 提交于
Fix rustdoc UI for very long type names Fixes #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``
-
由 Yuki Okushi 提交于
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: #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>
-
由 Yuki Okushi 提交于
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.
-
由 Yuki Okushi 提交于
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.
-
由 Yuki Okushi 提交于
Alloc features cleanup This sorts and categorizes the `#![features]` in `alloc` and removes unused ones. This is part of #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)] ```
-
由 Yuki Okushi 提交于
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: https://github.com/rust-lang/measureme/pull/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`
-
由 Yuki Okushi 提交于
Automatic exponential formatting in Debug Context: See [this comment from the libs team](https://github.com/rust-lang/rfcs/pull/2729#issuecomment-853454204) --- 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](https://github.com/rust-lang/rfcs/pull/2729#issuecomment-864482954). **This will require a crater run.** --- As mentioned in the commit message of 8731d4df, 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)
-
- 19 10月, 2021 25 次提交
-
-
由 Vincent de Phily 提交于
Fix typo.
-
由 bors 提交于
Adopt let_else across the compiler This performs a substitution of code following the pattern: ``` let <id> = if let <pat> = ... { identity } else { ... : ! }; ``` To simplify it to: ``` let <pat> = ... { identity } else { ... : ! }; ``` By adopting the `let_else` feature (cc #87335). The PR also updates the syn crate because the currently used version of the crate doesn't support `let_else` syntax yet. Note: Generally I'm the person who *removes* usages of unstable features from the compiler, not adds more usages of them, but in this instance I think it hopefully helps the feature get stabilized sooner and in a better state. I have written a [comment](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205) on the tracking issue about my experience and what I feel could be improved before stabilization of `let_else`.
-
由 Gary Guo 提交于
-
由 Gary Guo 提交于
std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 bors 提交于
Update cargo 6 commits in c7957a74bdcf3b11e7154c1a9401735f23ebd484..7fbbf4e8f23e3c24b8afff541dcb17e53eb5ff88 2021-10-11 20:17:07 +0000 to 2021-10-19 02:16:48 +0000 - Make future-incompat-report output more user-friendly (rust-lang/cargo#9953) - Fix fetching git repos after a force push. (rust-lang/cargo#9979) - Add rustc-link-args to doctest build (rust-lang/cargo#9916) - Add the start of a basic benchmarking suite. (rust-lang/cargo#9955) - Use forms for issue templates. (rust-lang/cargo#9970) - Add rust_metadata to SerializedPackage (rust-lang/cargo#9967)
-
由 bors 提交于
Fix wrong niche calculation when 2+ niches are placed at the start When the niche is at the start, existing code incorrectly uses 1 instead of count for subtraction. Fix #90038 `@rustbot` label: T-compiler
-
由 Gary Guo 提交于
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #89766 (RustWrapper: adapt for an LLVM API change) - #89867 (Fix macro_rules! duplication when reexported in the same module) - #89941 (removing TLS support in x86_64-unknown-none-hermitkernel) - #89956 (Suggest a case insensitive match name regardless of levenshtein distance) - #89988 (Do not promote values with const drop that need to be dropped) - #89997 (Add test for issue #84957 - `str.as_bytes()` in a `const` expression) - #90002 (
⬆ rust-analyzer) - #90034 (Tiny tweak to Iterator::unzip() doc comment example.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup -
由 Eric Huss 提交于
-
由 Jacob Hoffman-Andrews 提交于
-
由 Matthias Krüger 提交于
Tiny tweak to Iterator::unzip() doc comment example. It's easier to figure out what it's doing and which output elements map to which input ones if the matrix we are dealing with is rectangular 2x3 rather than square 2x2.
-
由 Matthias Krüger 提交于
⬆ rust-analyzer r? ``@ghost`` -
由 Matthias Krüger 提交于
Add test for issue #84957 - `str.as_bytes()` in a `const` expression Hi, this PR adds a test for issue #84957 . I'm quite new to rustc so let me know if there's anything else that needs doing
😄 Closes #84957 -
由 Matthias Krüger 提交于
Do not promote values with const drop that need to be dropped Changes from #88558 allowed using `~const Drop` in constants by introducing a new `NeedsNonConstDrop` qualif. The new qualif was also used for promotion purposes, and allowed promotion to happen for values that needs to be dropped but which do have a const drop impl. Since for promoted the drop implementation is never executed, this lead to observable change in behaviour. For example: ```rust struct Panic(); impl const Drop for Panic { fn drop(&mut self) { panic!(); } } fn main() { let _ = &Panic(); } ``` Restore the use of `NeedsDrop` qualif during promotion to avoid the issue.
-
由 Matthias Krüger 提交于
Suggest a case insensitive match name regardless of levenshtein distance Fixes #86170 Currently, `find_best_match_for_name` only returns a case insensitive match name depending on a Levenshtein distance. It's a bit unfortunate that that hides some suggestions for typos like `Bar` -> `BAR`. That idea is from https://github.com/rust-lang/rust/pull/46347#discussion_r153701834, but I think it still makes some sense to show a candidate when we find a case insensitive match name as it's more like a typo. Skipped the `candidate != lookup` check because the current (i.e, `levenshtein_match`) returns the exact same `Symbol` anyway but it doesn't seem to confuse anything on UI tests. r? ``@estebank``
-
由 Matthias Krüger 提交于
removing TLS support in x86_64-unknown-none-hermitkernel HermitCore's kernel itself doesn't support TLS. Consequently, the entries in x86_64-unknown-none-hermitkernel should be removed. This commit should help to finalize #89062.
-
由 Matthias Krüger 提交于
Fix macro_rules! duplication when reexported in the same module This can append if within the same module a `#[macro_export] macro_rules!` is declared but also a reexport of itself producing two export of the same macro in the same module. In that case we only want to document it once. Before: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro Id("0:3"), // duplicate, same as above ], } ``` After: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro ], } ``` Fixes https://github.com/rust-lang/rust/issues/89852
-
由 Matthias Krüger 提交于
RustWrapper: adapt for an LLVM API change No functional changes intended. The LLVM commit https://github.com/llvm/llvm-project/commit/89b57061f7b769e9ea9bf6ed686e284f3e55affe moved TargetRegistry.(h|cpp) from Support to MC. This adapts RustWrapper accordingly.
-
由 Jacob Hoffman-Andrews 提交于
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.
-
由 moxian 提交于
It's easier to figure out what it's doing and which output elements map to which input ones if the matrix we are dealing with is rectangular 2x3 rather than square 2x2.
-