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 #127954

Closed
wants to merge 28 commits into from
Closed

Conversation

tgross35
Copy link
Contributor

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Ayush1325 and others added 28 commits May 29, 2024 22:56
Signed-off-by: Ayush Singh <[email protected]>
Use a custom simple_text_output protocol to capture output.

Signed-off-by: Ayush Singh <[email protected]>
Implement stderr support in similar fashion.

Signed-off-by: Ayush Singh <[email protected]>
Only tested in 2 levels right now. Need args support for 3 levels

Signed-off-by: Ayush Singh <[email protected]>
Also fix stdio inherit

Signed-off-by: Ayush Singh <[email protected]>
- Update system table crc32
- Fix unsound use of Box
- Free exit data
- Code improvements
- Introduce OwnedTable
- Update r-efi to latest version
- Use extended_varargs_abi_support for
  install_multiple_protocol_interfaces and
  uninstall_multiple_protocol_interfaces
- Fix comments
- Stub out args implementation

Signed-off-by: Ayush Singh <[email protected]>
Previously we would only mention that the item was gated out, and opportunisitically mention the feature flag name when possible. We now point to the place where the item was gated, which can be behind layers of macro indirection, or in different modules.

```
error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
  --> $DIR/diagnostics-cross-crate.rs:18:23
   |
LL |     cfged_out::inner::doesnt_exist::hello();
   |                       ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner`
   |
note: found an item that was configured out
  --> $DIR/auxiliary/cfged_out.rs:6:13
   |
LL |     pub mod doesnt_exist {
   |             ^^^^^^^^^^^^
note: the item is gated here
  --> $DIR/auxiliary/cfged_out.rs:5:5
   |
LL |     #[cfg(FALSE)]
   |     ^^^^^^^^^^^^^
```
No need to collect tokens on this recovery path, because the parsed
statement isn't even looked at.
Use a parameter to decide whether to force collect, as is done for the
closely related `parse_local_mk` method.
Instead of a `bool`. Because `ForceCollect` is used in this way
everywhere else.
There are three places where we currently check `force_collect` and call
`collect_tokens_no_attrs` for `ForceCollect::Yes` and a vanilla parsing
function for `ForceCollect::No`.

But we can instead just pass in `force_collect` and let
`collect_tokens_trailing_token` do the appropriate thing.
Add Process support for UEFI

UEFI does not have an actual process. However, it does provide methods to launch and execute another UEFI image. Having process support is important since it is possible to run rust test suit using `Command::output` and is the first step towards being able to run it for UEFI.

Here is an overview of how the support is implemented.

- We create a copy of the SystemTable. This is required since at least OVMF seems to crash if the original system table is modified.
- Stdout and Stderr pipe works by registering a new `simple_text_output` Protocol and pointing the child system table to use those.
- `Stdio::Inherit` just points the console to the current running image console which seems to work with even 3 levels of process.
- `spawn` is left unimplemented since it does not make sense for UEFI architecture. Additionally, since rust-lang#105458 was merged, the `spawn` and `output` implementations are completely independent.
Parser: Suggest Placing the Return Type After Function Parameters

Fixes rust-lang#126311

This PR suggests placing the return type after the function parameters when it's misplaced after a `where` clause.

This also tangentially improves diagnostics for cases like [this](https://github.com/veera-sivarajan/rust/blob/86d6f1312a77997ef994240e716288d61a343a6d/tests/ui/parser/issues/misplaced-return-type-without-where-issue-126311.rs#L1C1-L1C28) and adds doc comments for `parser::AllowPlus`.
Migrate `dump-ice-to-disk` and `panic-abort-eh_frame` `run-make` tests to rmake

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try:

try-job: x86_64-msvc
When finding item gated behind a `cfg` flag, point at it

Previously we would only mention that the item was gated out, and opportunisitically mention the feature flag name when possible. We now point to the place where the item was gated, which can be behind layers of macro indirection, or in different modules.

```
error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
  --> $DIR/diagnostics-cross-crate.rs:18:23
   |
LL |     cfged_out::inner::doesnt_exist::hello();
   |                       ^^^^^^^^^^^^ could not find `doesnt_exist` in `inner`
   |
note: found an item that was configured out
  --> $DIR/auxiliary/cfged_out.rs:6:13
   |
LL |     pub mod doesnt_exist {
   |             ^^^^^^^^^^^^
note: the item is gated here
  --> $DIR/auxiliary/cfged_out.rs:5:5
   |
LL |     #[cfg(FALSE)]
   |     ^^^^^^^^^^^^^
```
…ents, r=petrochenkov

`force_collect` improvements

Yet more cleanups relating to `cfg_attr` processing.

r? ```@petrochenkov```
…orino

Don't allow unsafe statics outside of extern blocks

This PR fixes a regression where we allowed `unsafe static` items in top-level modules (i.e. outside of `unsafe extern` blocks).

It's harder IMO to integrate this into the `check_item_safety` function, so I opted to just put this check on the `static` item itself.

Beta version of this lives at rust-lang#127944.

r? ``@oli-obk`` or ``@spastorino``
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc labels Jul 19, 2024
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 19, 2024
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Jul 19, 2024

📌 Commit 35ec8ee has been approved by tgross35

It is now in the queue for this repository.

@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 Jul 19, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 19, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#123196 (Add Process support for UEFI)
 - rust-lang#127350 (Parser: Suggest Placing the Return Type After Function Parameters)
 - rust-lang#127523 (Migrate `dump-ice-to-disk` and `panic-abort-eh_frame` `run-make` tests to rmake)
 - rust-lang#127662 (When finding item gated behind a `cfg` flag, point at it)
 - rust-lang#127903 (`force_collect` improvements)
 - rust-lang#127932 (rustdoc: fix `current` class on sidebar modnav)
 - rust-lang#127943 (Don't allow unsafe statics outside of extern blocks)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 19, 2024

⌛ Testing commit 35ec8ee with merge 190ee4a...

@rust-log-analyzer
Copy link
Collaborator

The job dist-various-2 failed! Check out the build log: (web) (plain)

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

error[E0133]: call to unsafe function `alloc_crate::boxed::Box::<T>::from_raw` is unsafe and requires unsafe block
   --> library/std/src/sys/pal/uefi/helpers.rs:328:18
    |
328 |             drop(Box::from_raw(protocol));
    |
    = note: for more information, see issue #71668 <https://github.com/rust-lang/rust/issues/71668>
    = note: consult the function's documentation for information on how to avoid undefined behavior
note: an unsafe function restricts its caller, but its body is safe by default
note: an unsafe function restricts its caller, but its body is safe by default
   --> library/std/src/sys/pal/uefi/helpers.rs:308:5
    |
308 |     pub(crate) unsafe fn create(protocol: T, mut guid: r_efi::efi::Guid) -> io::Result<Self> {
note: the lint level is defined here
   --> library/std/src/sys/pal/uefi/mod.rs:14:11
    |
    |
14  | #![forbid(unsafe_op_in_unsafe_fn)]

For more information about this error, try `rustc --explain E0133`.
[RUSTC-TIMING] std test:false 2.412
warning: `std` (lib) generated 1 warning

@bors
Copy link
Contributor

bors commented Jul 19, 2024

💔 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 Jul 19, 2024
@tgross35 tgross35 closed this Jul 19, 2024
@tgross35 tgross35 deleted the rollup-uuq1w9x branch July 19, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.