-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 9 pull requests #73563
Merged
Merged
Rollup of 9 pull requests #73563
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called auto-fallible), allowing us to gate on the auto job without failing due to macOS spurious failures.
…trait_selection`.
This commit normalizes projections which contain opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this commit fail). Signed-off-by: David Wood <[email protected]>
We now require that projection candidates are applicable with the idenitity substs of the trait, rather than allowing predicates that are only applicable for certain substs.
This was currently only happening due to eager normalization, which isn't possible if there's specialization or bound variables.
Given `trait X { type U; }` the bound `<Self as X>::U` now lives on the type, rather than the trait. This is feature gated on `feature(generic_associated_types)` for now until more testing can be done. The also enabled type-generic associated types since we no longer need "implies bounds".
This patch adds two methods to `Duration`. The first, `Duration::zero`, provides a `const` constructor for getting an zero-length duration. This is also what `Default` provides (this was clarified in the docs), though `default` is not `const`. The second, `Duration::is_zero`, returns true if a `Duration` spans no time (i.e., because its components are all zero). Previously, the way to do this was either to compare both `as_secs` and `subsec_nanos` to 0, to compare against `Duration::new(0, 0)`, or to use the `u128` method `as_nanos`, none of which were particularly elegant.
For some reason, the help message is now in a separate message, which adds a lot of noise. I would like to try to get it back to one message.
The UI isn't glitching anymore.
Try to suggest dereferences on trait selection failed Fixes rust-lang#39029 Fixes rust-lang#62530 This PR consists of two parts: 1. Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_trait_selection`. 2. Try to suggest dereferences when trait selection failed. The first is needed because: 1. For suggesting dereferences, the struct `Autoderef` should be used. But before this PR, it is placed in `librustc_typeck`, which depends on `librustc_trait_selection`. But trait selection error emitting happens in `librustc_trait_selection`, if we want to use `Autoderef` in it, dependency loop is inevitable. So I moved the `Autoderef` to `librustc_trait_selection`. 2. Before this PR, `FnCtxt` is coupled to `Autoderef`, and `FnCtxt` only exists in `librustc_typeck`. So decoupling is needed. After this PR, we can get suggestion like this: ``` error[E0277]: the trait bound `&Baz: Happy` is not satisfied --> $DIR/trait-suggest-deferences-multiple.rs:34:9 | LL | fn foo<T>(_: T) where T: Happy {} | ----- required by this bound in `foo` ... LL | foo(&baz); | ^^^^ | | | the trait `Happy` is not implemented for `&Baz` | help: consider adding dereference here: `&***baz` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. ``` r? @estebank
…dation, r=nikomatsakis Projection bound validation During selection we use bounds declared on associated types (e.g. `type X: Copy`) to satisfy trait/projection bounds. This would be fine so long as those bounds are checked on any impls/trait objects. For simple cases they are because the bound `Self::X: Copy` gets normalized when we check the impl. However, for default values with specialization and higher-ranked bounds from GATs or otherwise, we can't normalize when checking the impl, and so we use the bound from the trait to prove that the bound applies to the impl, which is clearly unsound. This PR makes 2 fixes for this: 1. Requiring that the bounds on the trait apply to a projection type with the corresponding substs, so a bound `for<'a> <Self as X<'a>>::U: Copy` on the trait cannot be used to prove `<T as X<'_>>::U: Copy`. 2. Actually checking that the bounds that we still allow apply to generic/default associated types. Opening for a crater run. Closes rust-lang#68641 Closes rust-lang#68642 Closes rust-lang#68643 Closes rust-lang#68644 Closes rust-lang#68645 Closes rust-lang#68656 r? @ghost
…bertodt core/time: Add Duration methods for zero This patch adds two methods to `Duration`. The first, `Duration::zero`, provides a `const` constructor for getting an zero-length duration. This is also what `Default` provides (this was clarified in the docs), though `default` is not `const`. The second, `Duration::is_zero`, returns true if a `Duration` spans no time (i.e., because its components are all zero). Previously, the way to do this was either to compare both `as_secs` and `subsec_nanos` to 0, to compare against `Duration::new(0, 0)`, or to use the `u128` method `as_nanos`, none of which were particularly elegant.
…nieu Allow multiple `asm!` options groups and report an error on duplicate options Fixes rust-lang#73193 Cc @joshtriplett @Amanieu - [x] Allow multiple options - [x] Update existing test - [x] Add new tests - [x] Check for duplicate options - [x] Add duplicate options tests - [x] Finalize suggestion format for duplicate options error
…in-projections, r=estebank lint: normalize projections using opaque types Fixes rust-lang#73251. This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).
…=petrochenkov Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs cc rust-lang#50928 I don't know who is exactly the best person to review this. r? @petrochenkov
…oli-obk Remove use of specialization from librustc_arena This reworks the macro so that specialization, `transmute` and `#[marker]` are not used. r? @oli-obk
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15) Pulls in changes from rust-lang#73326. Closes rust-lang#73286
…ark-Simulacrum ci: allow gating GHA on everything but macOS In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures. cc rust-lang/rust-central-station#848 r? @Mark-Simulacrum
📌 Commit 929f032 has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Jun 20, 2020
☀️ Test successful - checks-azure |
This was referenced Jun 21, 2020
Something in this rollup is a perf win 😉 |
Presumably #73291 cc @marmeladema |
Hu great! I did not anticipate that! Would it be valuable to do a fake revert and run the perf tests to confirm? |
#72788 looks like it was a lot of the perf gains here from local testing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
asm!
options groups and report an error on duplicate options #73227 (Allow multipleasm!
options groups and report an error on duplicate options)LocalDefId
<->HirId
mappings and removeNodeId
<->HirId
conversion APIs #73291 (Pre-computeLocalDefId
<->HirId
mappings and removeNodeId
<->HirId
conversion APIs)Failed merges:
r? @ghost