Support FRU pattern with [feature(capture_disjoint_fields)]#81291
Merged
bors merged 2 commits intorust-lang:masterfrom Jan 30, 2021
Merged
Conversation
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
…res when feature capture_disjoint_fields is enabled
42cf990 to
e94cf57
Compare
nikomatsakis
approved these changes
Jan 25, 2021
Contributor
nikomatsakis
left a comment
There was a problem hiding this comment.
This looks good. Approved but I think maybe we want one more test.
| let c = || { | ||
| let s2 = S { | ||
| a: format!("New a"), | ||
| ..s |
Contributor
There was a problem hiding this comment.
Should we add a test for something like ..s.a?
Contributor
|
@bors delegate+ You can feel free to r=nikomatsakis once the test is added. |
Collaborator
|
✌️ @null-sleep can now approve this pull request |
e6e342d to
5e983d7
Compare
Contributor
Author
|
@bors r=nikomatsakis |
Collaborator
|
📌 Commit 5e983d7 has been approved by |
henryboisdequin
added a commit
to henryboisdequin/rust
that referenced
this pull request
Jan 29, 2021
…ional-record-update-syntax-error, r=nikomatsakis Support FRU pattern with `[feature(capture_disjoint_fields)]` In case of a functional record update syntax for creating a structure, `ExprUseVisitor` to only detect the precise use of some of the field in the `..x` part of the syntax. However, when we start building MIR, we 1. First, build the place for `x` 2. and then, add precise field projections so that only some parts of `x` end up getting read. When `capture_disjoint_fields` is enabled, and FRU is used within a closure `x` won't be completely captured, and therefore the first step will fail. This PR updates `mir_build` to create a place builder in the first step and then create place from the builder only after applying the field projection. Closes rust-lang/project-rfc-2229#32 r? `@nikomatsakis`
This was referenced Jan 29, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 30, 2021
Rollup of 16 pull requests Successful merges: - rust-lang#79023 (Add `core::stream::Stream`) - rust-lang#80562 (Consider Scalar to be a bool only if its unsigned) - rust-lang#80886 (Stabilize raw ref macros) - rust-lang#80959 (Stabilize `unsigned_abs`) - rust-lang#81291 (Support FRU pattern with `[feature(capture_disjoint_fields)]`) - rust-lang#81409 (Slight simplification of chars().count()) - rust-lang#81468 (cfg(version): treat nightlies as complete) - rust-lang#81473 (Warn write-only fields) - rust-lang#81495 (rustdoc: Remove unnecessary optional) - rust-lang#81499 (Updated Vec::splice documentation) - rust-lang#81501 (update rustfmt to v1.4.34) - rust-lang#81505 (`fn cold_path` doesn't need to be pub) - rust-lang#81512 (Add missing variants in match binding) - rust-lang#81515 (Fix typo in pat.rs) - rust-lang#81519 (Don't print error output from rustup when detecting default build triple) - rust-lang#81520 (Don't clone LLVM submodule when download-ci-llvm is set) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In case of a functional record update syntax for creating a structure,
ExprUseVisitorto only detect the precise use of some of the field in the..xpart of the syntax. However, when we start building MIR, wexxend up getting read.When
capture_disjoint_fieldsis enabled, and FRU is used within a closurexwon't be completely captured, and therefore the first step will fail. This PR updatesmir_buildto create a place builder in the first step and then create place from the builder only after applying the field projection.Closes rust-lang/project-rfc-2229#32
r? @nikomatsakis