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

Capture precise paths in THIR and MIR #33

Closed
wants to merge 164 commits into from
Closed

Conversation

arora-aman
Copy link
Member

@arora-aman arora-aman commented Nov 26, 2020

This PR allows THIR and MIR to use the result of the new capture analysis to actually capture precise paths

Following test cases fail and have been disabled.

    [ui] ui/closures/2229_closure_analysis/run_pass/capture-enums.rs
    [ui] ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs
    [ui] ui/closures/2229_closure_analysis/run_pass/wild_patterns.rs

Work that remains (not in this PR):


This change is Reviewable

…criptors

Add the functions `recv_vectored_fds` and `send_vectored_fds` to send and receive file descriptors, by using `recvmsg` and `sendmsg` system call.
SNCPlay42 and others added 18 commits December 4, 2020 16:37
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
In particular, IntoIneerError only currently provides .error() which
returns a reference, not an owned value.  This is not helpful and
means that a caller of BufWriter::into_inner cannot acquire an owned
io::Error which seems quite wrong.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
…or,Wodann,m-ou-se

Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`

Calling `Box::alloc_ref` and `Vec::alloc_ref` sounds like allocating a reference. To solve this ambiguity, this renames `AllocRef` to `Allocator` and `alloc` to `allocate`. For a more detailed explaination see rust-lang/wg-allocators#76.

closes rust-lang/wg-allocators#76

r? `@KodrAus`
`@rustbot` modify labels: +A-allocators +T-libs
`@rustbot` ping wg-allocators
…-ou-se

Provide IntoInnerError::into_parts

Hi.  This is an updated version of the IntoInnerError bits of my previous portmanteau MR rust-lang#78689.  Thanks to `@jyn514` and `@m-ou-se` for helpful comments there.

I have made this insta-stable since it seems like it will probably be uncontroversial, but that is definitely something that someone from the libs API team should be aware of and explicitly consider.

I included a tangentially-related commit providing documentation of the buffer full behaviiour of `&mut [u8] as Write`; the behaviour I am documenting is relied on by the doctest for `into_parts`.
Cleanup: move format! ui tests to where they belong
update Miri

Fixes rust-lang#79709
Cc `@rust-lang/miri` r? `@ghost`
…, r=oli-obk

check the recursion limit when finding a struct's tail

fixes rust-lang#79437

This does a `delay_span_bug` (via `ty_error_with_message`) rather than emit a new error message, under the assumption that there will be an error elsewhere (even if the type isn't infinitely recursive, just deeper than the recursion limit, this appears to be the case).
Ping me when nomicon's toolstate is broken

So that I can notice the breakage easily.
- Derive TypeFoldable on `hir::place::Place` and associated
  structs, to them to be written into typeck results.

Co-authored-by: Jennifer Wills <wills.jenniferg@gmail.com>
Co-authored-by: Logan Mosier <logmosier@gmail.com>
- final_upvar_tys now reads types from places instead of using `node_ty`

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
@arora-aman arora-aman force-pushed the mir_min_cap_writeback branch from 097e490 to 487352b Compare December 6, 2020 22:25
- This allows us to delay figuring out the index of a capture
  in the closure structure when all projections to atleast form
  a capture have been applied to the builder

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
@arora-aman arora-aman force-pushed the mir_min_cap_writeback branch 2 times, most recently from ef71437 to ad36cd2 Compare December 9, 2020 07:22
arora-aman and others added 3 commits December 9, 2020 22:33
- Use closure_min_capture maps to capture precise paths
- PlaceBuilder now searches for ancestors in min_capture list
- Add API to `Ty` to allow access to the n-th element in a
  tuple in O(1) time.

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
- Closures now use closure_min_captures to figure out captured paths
- Build upvar_mutbls using closure_min_captures
- Change logic in limit_capture_mutability to differentiate b/w
  capturing parent's local variable or capturing a variable that is
  captured by the parent (in case of nested closure) using PlaceBase.

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
- Use closure_min_captures to generate the Upvar structure that
  stores information for diagnostics and information about
  mutability of captures.
@arora-aman arora-aman force-pushed the mir_min_cap_writeback branch from ad36cd2 to 0f60e68 Compare December 11, 2020 09:00
@arora-aman arora-aman force-pushed the mir_min_cap_writeback branch from 0f60e68 to 01df563 Compare December 11, 2020 10:19
@arora-aman arora-aman closed this Dec 12, 2020
@arora-aman arora-aman deleted the mir_min_cap_writeback branch December 12, 2020 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.