-
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 7 pull requests #108600
Rollup of 7 pull requests #108600
Commits on Feb 17, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4de9c6d - Browse repository at this point
Copy the full SHA 4de9c6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d963318 - Browse repository at this point
Copy the full SHA d963318View commit details
Commits on Feb 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 07cf219 - Browse repository at this point
Copy the full SHA 07cf219View commit details -
use span of semicolon for eager recovery in expression
instead of the span of the token after the semicolon
Lukas Markeffsky committedFeb 22, 2023 Configuration menu - View commit details
-
Copy full SHA for 611ab68 - Browse repository at this point
Copy the full SHA 611ab68View commit details
Commits on Feb 23, 2023
-
Lazily compute crate name for consider_optimizing
The extra query is unnecessary in the common case of not having fuel.
Configuration menu - View commit details
-
Copy full SHA for 7ee01b4 - Browse repository at this point
Copy the full SHA 7ee01b4View commit details
Commits on Feb 24, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8574085 - Browse repository at this point
Copy the full SHA 8574085View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8820631 - Browse repository at this point
Copy the full SHA 8820631View commit details -
Configuration menu - View commit details
-
Copy full SHA for 152a029 - Browse repository at this point
Copy the full SHA 152a029View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13b8497 - Browse repository at this point
Copy the full SHA 13b8497View commit details
Commits on Feb 25, 2023
-
Update search eBNF with
!
movedCo-Authored-By: GuillaumeGomez <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96e6fb6 - Browse repository at this point
Copy the full SHA 96e6fb6View commit details -
Add
CastKind::Transmute
to MIRNothing actually produces it in this commit.
Configuration menu - View commit details
-
Copy full SHA for 0905bad - Browse repository at this point
Copy the full SHA 0905badView commit details
Commits on Feb 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2405ac4 - Browse repository at this point
Copy the full SHA 2405ac4View commit details
Commits on Feb 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3fbdbcc - Browse repository at this point
Copy the full SHA 3fbdbccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f49f85 - Browse repository at this point
Copy the full SHA 6f49f85View commit details -
rustc_middle: Remove trait
DefIdTree
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
Configuration menu - View commit details
-
Copy full SHA for 6afe9e3 - Browse repository at this point
Copy the full SHA 6afe9e3View commit details
Commits on Feb 28, 2023
-
This adds the following functions: * `Option<T>::as_slice(&self) -> &[T]` * `Option<T>::as_slice_mut(&mut self) -> &[T]` The `as_slice` and `as_slice_mut` functions benefit from an optimization that makes them completely branch-free. Note that the optimization's soundness hinges on the fact that either the niche optimization makes the offset of the `Some(_)` contents zero or the mempory layout of `Option<T>` is equal to that of `Option<MaybeUninit<T>>`.
Configuration menu - View commit details
-
Copy full SHA for 41da875 - Browse repository at this point
Copy the full SHA 41da875View commit details
Commits on Mar 1, 2023
-
Rollup merge of rust-lang#105871 - llogiq:option-as-slice, r=scottmcm
Add `Option::as_`(`mut_`)`slice` This adds the following functions: * `Option<T>::as_slice(&self) -> &[T]` * `Option<T>::as_mut_slice(&mut self) -> &[T]` The `as_slice` and `as_mut_slice_mut` functions benefit from an optimization that makes them completely branch-free. ~~Unfortunately, this optimization is not available on by-value Options, therefore the `into_slice` implementations use the plain `match` + `slice::from_ref` approach.~~ Note that the optimization's soundness hinges on the fact that either the niche optimization makes the offset of the `Some(_)` contents zero or the mempory layout of `Option<T>` is equal to that of `Option<MaybeUninit<T>>`. The idea has been discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Option.3A.3Aas_slice). Notably the idea for the `as_slice_mut` and `into_slice´ methods came from `@cuviper` and `@Sp00ph` hardened the optimization against niche-optimized Options. The [rust playground](https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=74f8e4239a19f454c183aaf7b4a969e0) shows that the generated assembly of the optimized method is basically only a copy while the naive method generates code containing a `test dx, dx` on x86_64. --- EDIT from reviewer: ACP is rust-lang/libs-team#150
Configuration menu - View commit details
-
Copy full SHA for f70045c - Browse repository at this point
Copy the full SHA f70045cView commit details -
Rollup merge of rust-lang#108143 - notriddle:notriddle/filter-exclama…
…tion-macro, r=GuillaumeGomez rustdoc: search by macro when query ends with `!` Related to rust-lang#96399 Note: the `never` type alias is tested in [`/tests/rustdoc-js-std/alias-3.js`](https://github.com/notriddle/rust/blob/08ad401633037cc226b3806a3c5f48c2f34703bf/tests/rustdoc-js-std/alias-3.js) ## Before ![image](https://user-images.githubusercontent.com/1593513/219504192-54cc0753-ff97-4a37-ad4a-8ae915181325.png) ## After ![image](https://user-images.githubusercontent.com/1593513/219504251-589a7e11-1e7b-4b7b-879d-1b564080017c.png)
Configuration menu - View commit details
-
Copy full SHA for 19ff1f2 - Browse repository at this point
Copy the full SHA 19ff1f2View commit details -
Rollup merge of rust-lang#108244 - lukas-code:semicolon-recovery-span…
…, r=compiler-errors Use span of semicolon for eager recovery in expression Instead of the span of the token after the semicolon. This will hopefully cause fewer errors from overlapping spans. fixes rust-lang#108242 based on rust-lang#108239
Configuration menu - View commit details
-
Copy full SHA for 5b64847 - Browse repository at this point
Copy the full SHA 5b64847View commit details -
Rollup merge of rust-lang#108351 - petrochenkov:rmdit, r=cjgillot
rustc_middle: Remove trait `DefIdTree` This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
Configuration menu - View commit details
-
Copy full SHA for 5368f78 - Browse repository at this point
Copy the full SHA 5368f78View commit details -
Rollup merge of rust-lang#108405 - Nilstrieb:lazy-crate-name-optimiza…
…tion-fuel, r=WaffleLapkin Lazily compute crate name for consider_optimizing The extra query is unnecessary in the common case of not having fuel.
Configuration menu - View commit details
-
Copy full SHA for 4ebf78a - Browse repository at this point
Copy the full SHA 4ebf78aView commit details -
Rollup merge of rust-lang#108427 - y21:for-else-diagnostic, r=compile…
…r-errors Recover from for-else and while-else This recovers from attempts at writing for-else or while-else loops, which might help users coming from e.g. Python. ```rs for _ in 0..0 { // ... } else { // ... } ``` Combined with trying to store it in a let binding, the current diagnostic can be a bit confusing. It mentions let-else and suggests wrapping the loop in parentheses, which the user probably doesn't want. let-else doesn't make sense for `for` and `while` loops, as they are of type `()` (which already is an irrefutable pattern and doesn't need let-else). <details> <summary>Current diagnostic</summary> ```rs error: right curly brace `}` before `else` in a `let...else` statement not allowed --> src/main.rs:4:5 | 4 | } else { | ^ | help: wrap the expression in parentheses | 2 ~ let _x = (for _ in 0..0 { 3 | 4 ~ }) else { | ``` </details> Some questions: - Can the wording for the error message be improved? Would "for...else loops are not allowed" fit better? - Should we be more "conservative" in case we want to support this in the future (i.e. say "for...else loops are **currently** not allowed/supported")? - Is there a better way than storing a `&'static str` for the loop type? It is used for substituting the placeholder in the locale file (since it can emit either `for...else` or `while...else`). Maybe there is an enum I could use that I couldn't find
Configuration menu - View commit details
-
Copy full SHA for 75bd7cc - Browse repository at this point
Copy the full SHA 75bd7ccView commit details -
Rollup merge of rust-lang#108442 - scottmcm:mir-transmute, r=oli-obk
Add `CastKind::Transmute` to MIR ~~Nothing actually produces it in this commit, so I don't know how to test it, but it also means it shouldn't be possible for it to break anything.~~ Includes lowering `transmute` calls to it, so it's used. Zulip Conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Good.20first.20isssue/near/321849610>
Configuration menu - View commit details
-
Copy full SHA for b0e4d56 - Browse repository at this point
Copy the full SHA b0e4d56View commit details