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 7 pull requests #83790

Merged
merged 28 commits into from
Apr 2, 2021
Merged

Rollup of 7 pull requests #83790

merged 28 commits into from
Apr 2, 2021

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jyn514 and others added 28 commits March 25, 2021 11:40
This cleans up the code quite a bit, and also makes the next commit much
easier.
The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: rust-lang/docs.rs#1312 (comment)

The end goal is to fix rust-lang/docs.rs#1327
by reverting rust-lang/docs.rs#1324.

This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.
Add documentation to the system functions and `SAFETY` comments.
Refactored helper functions, fixing the correctness of `get_header`.
This also changes custom themes from Toolchain to Crate files.
Beginning with FreeBSD 10.4 and 11.1, there is one guard page by
default.  And the stack autoresizes, so if Rust allocates its own guard
page, then FreeBSD's will simply move up one page.  The best solution is
to just use the OS's guard page.
This change reduces the risk of impacting coverage tests on unrelated
changes (such as MIR and Span changes), and reduces the burden when
blessing coverage changes in case it is necessary.

* Remove all spanview tests. The spanview tests were useful during
  development, but they can be generated as needed, via compiler command
  line flags. They aren't critical to confirming coverage results. (The
  coverage report tests are sufficient.)

  When spanview regeneration was necessary, the diffs were way too hard
  to read to be useful anyway. So I'm removing them to reduce friction
  from a feature that is no longer useful.

* Remove the requirement for `llvm-cov show --debug` when blessing
  tests. The `--debug` flag is, unfortunately, only available if LLVM is
  built with `optimize = false` (in Rust's config.toml). This adds
  significant time and resource burdens to the contributor's build. As
  it turns out, for other reasons in the past, I wasn't actually using
  the debug output (counter info) to validate coverage anymore either,
  so it was required for no reason, I now realize.
Rework `std::sys::windows::alloc`

I came across rust-lang#76676 (comment), which points out that there was unsound code in the Windows alloc code, creating a &mut to possibly uninitialized memory. I reworked the code so that that particular issue does not occur anymore, and started adding more documentation and safety comments.

Full list of changes:
 - moved and documented the relevant Windows Heap API functions
 - refactor `allocate_with_flags` to `allocate` (and remove the other helper functions), which now takes just a `bool` if the memory should be zeroed
 - add checks for if `GetProcessHeap` returned null
 - add a test that checks if the size and alignment of a `Header` are indeed <= `MIN_ALIGN`
 - add `#![deny(unsafe_op_in_unsafe_fn)]` and the necessary unsafe blocks with safety comments

I feel like I may have overdone the documenting, the unsoundness fix is the most important part; I could spit this PR up in separate parts.
…imulacrum

rustdoc: Add unstable option to only emit shared/crate-specific files

The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: rust-lang/docs.rs#1312 (comment)

The end goal is to fix rust-lang/docs.rs#1327 by reverting rust-lang/docs.rs#1324.

This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.

I recommend reviewing this one commit at a time.

r? ``@GuillaumeGomez`` cc ``@Nemo157`` ``@pietroalbini``
…r=m-ou-se

Fix double-drop in `Vec::from_iter(vec.into_iter())` specialization when items drop during panic

This fixes the double-drop but it leaves a behavioral difference compared to the default implementation intact: In the default implementation the source and the destination vec are separate objects, so they get dropped separately. Here they share an allocation and the latter only exists as a pointer into the former. So if dropping the former panics then this fix will leak more items than the default implementation would. Is this acceptable or should the specialization also mimic the default implementation's drops-during-panic behavior?

Fixes rust-lang#83618

`@rustbot` label T-libs-impl
…r=estebank

give full path of constraint in suggest_constraining_type_param

close rust-lang#83513
Simplify coverage tests

This change reduces the risk of impacting coverage tests on unrelated
changes (such as MIR and Span changes), and reduces the burden when
blessing coverage changes in case it is necessary.

* Remove all spanview tests. The spanview tests were useful during
  development, but they can be generated as needed, via compiler command
  line flags. They aren't critical to confirming coverage results. (The
  coverage report tests are sufficient.)

  When spanview regeneration was necessary, the diffs were way too hard
  to read to be useful anyway. So I'm removing them to reduce friction
  from a feature that is no longer useful.

* Remove the requirement for `llvm-cov show --debug` when blessing
  tests. The `--debug` flag is, unfortunately, only available if LLVM is
  built with `optimize = false` (in Rust's config.toml). This adds
  significant time and resource burdens to the contributor's build. As
  it turns out, for other reasons in the past, I wasn't actually using
  the debug output (counter info) to validate coverage anymore either,
  so it was required for no reason, I now realize.
…atsakis

2229: Support migration via rustfix

- Adds support of machine applicable suggestions for `disjoint_capture_drop_reorder`.
- Doesn't migrate in the case of pre-existing bugs in user code

r? ``@nikomatsakis``
…tolnay

Fix stack overflow detection on FreeBSD 11.1+

Beginning with FreeBSD 10.4 and 11.1, there is one guard page by
default.  And the stack autoresizes, so if Rust allocates its own guard
page, then FreeBSD's will simply move up one page.  The best solution is
to just use the OS's guard page.
@rustbot rustbot added the rollup A PR which is a rollup label Apr 2, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Apr 2, 2021

📌 Commit cb7133f has been approved by Dylan-DPC

@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 Apr 2, 2021
@bors
Copy link
Contributor

bors commented Apr 2, 2021

⌛ Testing commit cb7133f with merge 138fd56...

@bors
Copy link
Contributor

bors commented Apr 2, 2021

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 138fd56 to master...

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.