Skip to content
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

[beta] backports #86225

Merged
merged 7 commits into from
Jun 12, 2021
Merged

[beta] backports #86225

merged 7 commits into from
Jun 12, 2021

Conversation

Mark-Simulacrum
Copy link
Member

r? @Mark-Simulacrum

nagisa and others added 7 commits June 11, 2021 12:00
This addresses a codegen-issue that needs to be fixed upstream in LLVM.
While we wait for the fix, we can disable it.

Verified manually that the outliner is no longer run when
`-Copt-level=z` is specified, and also that you can override this with
`-Cllvm-args=-enable-machine-outliner` if you need it anyway.

A regression test is not really feasible in this instance, given that we
do not have any minimal reproducers.

Fixes rust-lang#85351
Fixes rust-lang#85432

When processing a `#[derive]` or `#[cfg_eval]` attribute, we need to
re-parse our attribute target, which requires flattenting all
`Nonterminals`. However, this caused us to incorrectly gate on a
(flattented) nonterminal in a key-value attribute, which is supposed to
be allowed.

Since we already perform this gating during the initial parse, we
suppress it in `capture_cfg` mode.
Fixes rust-lang#85197

We already preserved the `SyntaxContext` for invalid/dummy spans in the
incremental cache, but we weren't doing the same for crate metadata.
If an invalid (lo/hi from different files) span is written to the
incremental cache, we will decode it with a 'dummy' location, but keep
the original `SyntaxContext`. Since the crate metadata encoder was only
checking for `DUMMY_SP` (dummy location + root `SyntaxContext`),
the metadata encoder would treat it as a normal span, encoding the
`SyntaxContext`. As a result, the final span encoded to the metadata
would change across sessions, even if the crate itself was unchanged.

This PR updates our encoding of spans in the crate metadata to mirror
the encoding of spans into the incremental cache. We now always encode a
`SyntaxContext`, and encode location information for spans with a
non-dummy location.
Removes the implementations that depend on the user-definable trait `Copy`.

Beta backport: Does not modify `vec::IntoIter`.
@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 11, 2021
@Mark-Simulacrum
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jun 11, 2021

📌 Commit 28ea358 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 11, 2021
@Mark-Simulacrum
Copy link
Member Author

@bors p=10

@bors
Copy link
Contributor

bors commented Jun 11, 2021

⌛ Testing commit 28ea358 with merge 0a0f816...

@bors
Copy link
Contributor

bors commented Jun 12, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 0a0f816 to beta...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 12, 2021
@bors bors merged commit 0a0f816 into rust-lang:beta Jun 12, 2021
@rustbot rustbot added this to the 1.53.0 milestone Jun 12, 2021
@Mark-Simulacrum Mark-Simulacrum deleted the beta-next branch June 12, 2021 16:06
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 22, 2021
…on_only_regression_fix, r=cuviper

Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations

Removes the implementations that depend on the user-definable trait `Copy`.

Only fix regressions to ensure merge in 1.55: Does not modify `vec::IntoIter`.

<hr>

This PR applies the beta-`1.53` backport rust-lang#86222 (merged as part of rust-lang#86225), a reduced version of rust-lang#85874 that only fixes regressions, to `master` in order to avoid the need for further backports from `1.55` onwards. Beta-`1.54` backport already happened with rust-lang#87136. In case that rust-lang#85874 gets merged quickly (within a week), this PR would be unnecessary.

r? `@cuviper`
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants