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

Closed
wants to merge 38 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

slanterns and others added 30 commits April 16, 2024 20:58
Rayon's `try_for_each` makes the `CombinedEncoder` a lot simpler.
Previously, we were running bare commands for `ToolBuild` step and
were unable to utilize some of the flags which  are already handled by
`compile::stream_cargo`.

This change makes `ToolBuild` to use `compile::stream_cargo`, allowing us
to benefit from the flags supported by the bootstrap cargo.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: rongfu.leng <lenronfu@gmail.com>
Stabilise `c_unwind`

Fix rust-lang#74990
Fix rust-lang#115285 (that's also where FCP is happening)

Marking as draft PR for now due to `compiler_builtins` issues

r? `@Amanieu`
…rntSushi

Stabilize `binary_heap_as_slice`

This PR stabilizes `binary_heap_as_slice`:

```rust
// std::collections::BinaryHeap

impl BinaryHeap<T> {
    pub fn as_slice(&self) -> &[T]
}
```

<br>

Tracking issue: rust-lang#83659.
Implementation PR: rust-lang#82331.

FCPs already completed in the tracking issue.

Closes rust-lang#83659.

r? libs-api
…r=michaelwoerister

Parse unsafe attributes

Initial parse implementation for rust-lang#123757

This is the initial work to parse unsafe attributes, which is represented as an extra `unsafety` field in `MetaItem` and `AttrItem`. There's two areas in the code where it appears that parsing is done manually and not using the parser stuff, and I'm not sure how I'm supposed to thread the change there.
…nkfelix

Detect pub structs never constructed and unused associated constants

<!--
If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.

This PR will get automatically assigned to a reviewer. In case you would like
a specific user to review your work, you can assign it to them by using

    r​? <reviewer name>
-->

Lints never constructed public structs.

If we don't provide public methods to construct public structs with private fields, and don't construct them in the local crate. They would be never constructed. So that we can detect such public structs.

---
Update:

Also lints unused associated constants in traits.
…=albertlarsan68

prefer `compile::stream_cargo` for building tools

Previously, we were running bare commands for `ToolBuild` step and were unable to utilize some of the flags which  are already handled by `compile::stream_cargo`.

This change makes `ToolBuild` to use `compile::stream_cargo`, allowing us to benefit from the flags supported by the bootstrap cargo.

Resolves rust-lang#125666
…r=Mark-Simulacrum

Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md

`./x fmt` no longer accepts paths so the command in the readme won't work.
…albertlarsan68

Simplify the rayon calls in the installer

Rayon's `try_for_each` makes the `CombinedEncoder` a lot simpler.
Enable f16 in assembly on aarch64 platforms that support it

Issue: rust-lang#125398
…ouxu

Clean up source root in run-make tests

The name `S` isn't exactly the most descriptive, and we also shouldn't need to pass it when building (actually I think that most of the env. vars that we pass to `cargo` here are probably not really needed).

Related issue: rust-lang#126071

r? `@jieyouxu`
Improve docs for using custom paths with `--emit`

Recently I found myself concluding that this feature didn't exist (rust-lang#126111 (comment)), despite having read the documentation, because it was hidden away in the middle of a paragraph full of other information.

Giving this documentation more space of its own should make it easier to find.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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 Jun 7, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Jun 7, 2024

📌 Commit 391c636 has been approved by matthiaskrgr

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 Jun 7, 2024
@bors
Copy link
Contributor

bors commented Jun 7, 2024

⌛ Testing commit 391c636 with merge 6caf9d3...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#116088 (Stabilise `c_unwind`)
 - rust-lang#124012 (Stabilize `binary_heap_as_slice`)
 - rust-lang#124214 (Parse unsafe attributes)
 - rust-lang#125572 (Detect pub structs never constructed and unused associated constants)
 - rust-lang#125781 (prefer `compile::stream_cargo` for building tools)
 - rust-lang#126030 (Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md)
 - rust-lang#126047 (Simplify the rayon calls in the installer)
 - rust-lang#126070 (Enable f16 in assembly on aarch64 platforms that support it)
 - rust-lang#126089 (Stabilize Option::take_if)
 - rust-lang#126112 (Clean up source root in run-make tests)
 - rust-lang#126119 (Improve docs for using custom paths with `--emit`)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error[E0601]: `main` function not found in crate `type_f16`
##[error]  --> $DIR/type-f16.rs:17:2
   |
LL | }
   |  ^ consider adding a `main` function to `$DIR/type-f16.rs`
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0601`.




The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-f16/type-f16.stderr
To only update this specific test, also pass `--test-args asm/aarch64/type-f16.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/aarch64/type-f16.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-f16" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-f16/auxiliary"
--- stderr -------------------------------
error[E0601]: `main` function not found in crate `type_f16`
##[error]  --> /checkout/tests/ui/asm/aarch64/type-f16.rs:17:2
   |
   |
LL | }
   |  ^ consider adding a `main` function to `/checkout/tests/ui/asm/aarch64/type-f16.rs`
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0601`.
------------------------------------------
------------------------------------------


---- [ui] tests/ui/asm/aarch64/type-check-3.rs stdout ----
diff of stderr:

111 LL |         asm!("{}", in(vreg) f64x4);
113    |
113    |
-    = note: register class `vreg` supports these types: i8, i16, i32, i64, f32, f64, i8x8, i16x4, i32x2, i64x1, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2
+    = note: register class `vreg` supports these types: i8, i16, i32, i64, f16, f32, f64, i8x8, i16x4, i32x2, i64x1, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2
116 error: incompatible types for asm inout argument
117   --> $DIR/type-check-3.rs:88:33



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-check-3/type-check-3.stderr
To only update this specific test, also pass `--test-args asm/aarch64/type-check-3.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/asm/aarch64/type-check-3.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-check-3" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/type-check-3/auxiliary" "-C" "target-feature=+neon"
--- stderr -------------------------------
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:48:15
   |
   |
LL |         asm!("{}", in(reg) 0u8);
   |               ^^           --- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
   = note: `#[warn(asm_sub_register)]` on by default
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:50:15
   |
   |
LL |         asm!("{}", in(reg) 0u16);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:52:15
   |
   |
LL |         asm!("{}", in(reg) 0i32);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:54:15
   |
   |
LL |         asm!("{}", in(reg) 0f32);
   |               ^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:57:15
   |
   |
LL |         asm!("{}", in(vreg) 0i16);
   |               ^^            ---- for this argument
   |
   = help: use `{0:h}` to have the register formatted as `h0` (for 16-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:59:15
   |
   |
LL |         asm!("{}", in(vreg) 0f32);
   |               ^^            ---- for this argument
   |
   = help: use `{0:s}` to have the register formatted as `s0` (for 32-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:61:15
   |
   |
LL |         asm!("{}", in(vreg) 0f64);
   |               ^^            ---- for this argument
   |
   = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:63:15
   |
   |
LL |         asm!("{}", in(vreg_low16) 0f64);
   |               ^^                  ---- for this argument
   |
   = help: use `{0:d}` to have the register formatted as `d0` (for 64-bit values)
   = help: or use `{0:v}` to keep the default formatting of `v0` (for 128-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:66:15
   |
   |
LL |         asm!("{0} {0}", in(reg) 0i16);
   |               ^^^ ^^^           ---- for this argument
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
warning: formatting may not be suitable for sub-register argument
##[warning]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:68:15
   |
   |
LL |         asm!("{0} {0:x}", in(reg) 0i16);
   |
   |
   = help: use `{0:w}` to have the register formatted as `w0` (for 32-bit values)
   = help: or use `{0:x}` to keep the default formatting of `x0` (for 64-bit values)
error: type `i128` cannot be used with this register class
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:73:28
   |
   |
LL |         asm!("{}", in(reg) 0i128);
   |
   |
   = note: register class `reg` supports these types: i8, i16, i32, i64, f32, f64

error: type `float64x2_t` cannot be used with this register class
   |
   |
LL |         asm!("{}", in(reg) f64x2);
   |
   |
   = note: register class `reg` supports these types: i8, i16, i32, i64, f32, f64
error: type `Simd256bit` cannot be used with this register class
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:77:29
   |
   |
LL |         asm!("{}", in(vreg) f64x4);
   |
   |
   = note: register class `vreg` supports these types: i8, i16, i32, i64, f16, f32, f64, i8x8, i16x4, i32x2, i64x1, f32x2, f64x1, i8x16, i16x8, i32x4, i64x2, f32x4, f64x2
error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:88:33
   |
   |
LL |         asm!("{:x}", inout(reg) 0u32 => val_f32);
   |                                 ^^^^    ^^^^^^^ type `f32`
   |                                 type `u32`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size


error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:90:33
   |
LL |         asm!("{:x}", inout(reg) 0u32 => val_ptr);
   |                                 ^^^^    ^^^^^^^ type `*mut u8`
   |                                 type `u32`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size


error: incompatible types for asm inout argument
##[error]  --> /checkout/tests/ui/asm/aarch64/type-check-3.rs:92:33
   |
LL |         asm!("{:x}", inout(reg) main => val_u32);
   |                                 |
   |                                 type `fn()`
   |
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size
   = note: asm inout arguments must have the same type, unless they are both pointers or integers of the same size

error: aborting due to 6 previous errors; 10 warnings emitted
------------------------------------------


---- [ui] tests/ui/asm/aarch64/may_unwind.rs stdout ----

error: test run failed!
status: signal: 6 (SIGABRT) (core dumped)
command: cd "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/may_unwind" && RUST_TEST_THREADS="14" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/asm/aarch64/may_unwind/a"
--- stderr -------------------------------
thread 'main' panicked at library/core/src/panicking.rs:219:5:
panic in a function that cannot unwind
stack backtrace:
---
   6:     0xffff8828ce44 - std::panicking::rust_panic_with_hook::hff0650265344728b
   7:     0xffff8828cbe4 - std::panicking::begin_panic_handler::{{closure}}::h21cef16881993bfb
   8:     0xffff8828a310 - std::sys_common::backtrace::__rust_end_short_backtrace::h90430c09fd5c01a9
   9:     0xffff8828c9c0 - rust_begin_unwind
  10:     0xffff8824ba6c - core::panicking::panic_nounwind_fmt::hb1c44013ccdbc9a4
  11:     0xffff8824bae4 - core::panicking::panic_nounwind::h6888952951ab35c1
  12:     0xffff8824bc5c - core::panicking::panic_cannot_unwind::hdf99682457a16a16
  13:     0xaaaace194e30 - may_unwind::panicky::hcedceefb0cdc6048
  14:     0xaaaace194e50 - may_unwind::main::h9523bf7475f3e396
  16:     0xaaaace194dd4 - std::rt::lang_start::{{closure}}::hce0362b6803f5057
  17:     0xffff8826f050 - std::rt::lang_start_internal::h913d8bec73488788
  18:     0xaaaace194f30 - main
  19:     0xffff880473fc - <unknown>

@bors
Copy link
Contributor

bors commented Jun 7, 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 Jun 7, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-deswks3 branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows 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.