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

Rollup of 11 pull requests #81596

Merged
merged 31 commits into from
Feb 1, 2021
Merged

Rollup of 11 pull requests #81596

merged 31 commits into from
Feb 1, 2021

Conversation

jonas-schievink
Copy link
Contributor

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

sunfishcode and others added 30 commits January 21, 2021 16:13
Remove --export-dynamic from the link arguments on the wasm32-wasi
target, as it emits spurious exports and increases code size.

Leave it in place for wasm32-unknown-unknown and
wasm32-unknown-emscripten. Even though it isn't a great solution
there, users are likely depending on its behavior there.
- No Derefs in move closure, this will result in value behind a reference getting moved.
- No projections are applied to raw pointers, since these require unsafe blocks. We capture
  them completely.

Motivations for these are recorded here: https://hackmd.io/71qq-IOpTNqzMkPpAI1dVg?view
When `capture_disjoint_fields` is not enabled, checking if the root variable
binding is mutable would suffice.

However with the feature enabled, the captured place might be mutable
because it dereferences a mutable reference.

This PR computes the mutability of each capture after capture analysis
in rustc_typeck. We store this in `ty::CapturedPlace` and then use
`ty::CapturedPlace::mutability` in mir_build and borrow_check.
Referenced bug was fixed a while ago
Makes small edits to several error code files. Fixes some
missing punctuation. Changes some wording, grammar, and formatting
for clarity and readability.

Adds a link to the rustup book in E0658.
2229: Fix issues with move closures and mutability

This PR fixes two issues when feature `capture_disjoint_fields` is used.

1. Can't mutate using a mutable reference
2. Move closures try to move value out through a reference.

To do so, we
1. Compute the mutability of the capture and store it as part of the `CapturedPlace`  that is written in TypeckResults
2. Restrict capture precision. Note this is temporary for now, to allow the feature to be used with move closures and ByValue captures and might change depending on discussions with the lang team.
    - No Derefs are captured for ByValue captures, since that will result in value behind a reference getting moved.
    - No projections are applied to raw pointers since these require unsafe blocks. We capture
    them completely.

r? `````@nikomatsakis`````
Remove const_in_array_repeat

Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682.

I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
…ichton

Don't link with --export-dynamic on wasm32-wasi

Remove --export-dynamic from the link arguments on the wasm32-wasi
target, as it emits spurious exports and increases code size.

Leave it in place for wasm32-unknown-unknown and
wasm32-unknown-emscripten. Even though it isn't a great solution
there, users are likely depending on its behavior there.
Add suggestion for nested fields

Closes #81220

r? ```@estebank```
Add a test for #71202

Closes #71202

---

Note that the test normally generates this warning:

```
warning: cannot use constants which depend on generic parameters in types
  --> test.rs:10:5
   |
10 | /     const ITEM_IS_COPY: [(); 1 - {
11 | |         trait NotCopy {
12 | |             const VALUE: bool = false;
13 | |         }
...  |
26 | |         <IsCopy<T>>::VALUE
27 | |     } as usize] = [];
   | |_____________________^
   |
   = note: `#[warn(const_evaluatable_unchecked)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #76200 <#76200>
```

I added `allow(const_evaluatable_unchecked)`, but maybe we just don't want to add a test for this as the program is not really valid?
Fix an old FIXME in redundant paren lint

Referenced bug was fixed a while ago
Fix typo in E0759

Minor typo in E0759 error message.
Edit multiple error code Markdown files

Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability.

Adds a link to the rustup book in E0658.
Stabilize int_bits_const

Closes #76904

The FCP to stabilize the `int_bits_const` feature completed on the tracking issue.
@rustbot rustbot added the rollup A PR which is a rollup label Jan 31, 2021
@jonas-schievink
Copy link
Contributor Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Jan 31, 2021

📌 Commit 9165676 has been approved by jonas-schievink

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 31, 2021
@bors
Copy link
Contributor

bors commented Jan 31, 2021

⌛ Testing commit 9165676 with merge 7c8006b2e149eb5a1e049eb81cce4a271e6ebd54...

@bors
Copy link
Contributor

bors commented Jan 31, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 31, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jonas-schievink
Copy link
Contributor Author

@bors retry

@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 Jan 31, 2021
@bors
Copy link
Contributor

bors commented Jan 31, 2021

⌛ Testing commit 9165676 with merge 941343e...

@bors
Copy link
Contributor

bors commented Feb 1, 2021

☀️ Test successful - checks-actions
Approved by: jonas-schievink
Pushing 941343e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 1, 2021
@bors bors merged commit 941343e into rust-lang:master Feb 1, 2021
@rustbot rustbot added this to the 1.51.0 milestone Feb 1, 2021
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. rollup A PR which is a rollup 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.