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 3 pull requests #127749

Closed
wants to merge 13 commits into from

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

harmou01 and others added 13 commits July 3, 2024 10:13
Complete the metadata fields for all targets. Cargo will depend on this
for checking whether a given target supports building the standard
library.
This provides a list of locations to hunt down issues in.
These constifications were blocked on classification functions being
added. Now that those methods are available, constify them.

This brings things more in line with `f32` and `f64`.
…ingjubilee

 Add classify and related methods for f16 and f128

Also constify some functions where that was blocked on classify being available.

r? libs
…metadata, r=Nilstrieb

Fill out target-spec metadata for all targets

**What does this PR try to resolve?**

This PR completes the target-spec metadata fields for all targets. This is required for a corresponding Cargo PR which adds a check for whether a target supports building the standard library when the `-Zbuild-std=std` flag is passed ([see this issue](rust-lang/wg-cargo-std-aware#87). This functionality in Cargo is reliant on the output of `--print=target-spec-json`.

**How should we test and review this PR?**

Check that a given target-spec metadata has been updated with:
```
$ ./x.py build library/std
$ build/host/stage1/bin/rustc --print=target-spec-json --target <target_name> -Zunstable-options
```

**Additional Information**

A few things to note:
* Where a targets 'std' or 'host tools' support is listed as '?' in the rust docs, these are left as 'None' with this PR. The corresponding changes in cargo will only reject an attempt to build std if the 'std' field is 'Some(false)'. In the case it is 'None', cargo will continue trying to build
* There's no rush for this to be merged. I understand that the format for this is not finalised yet.
* Related: rust-lang#120745
…td, r=jhpratt

std: `#![deny(unsafe_op_in_unsafe_fn)]` in platform-independent code

This applies the `unsafe_op_in_unsafe_fn` lint in all places in std that _do not have platform-specific cfg in their code_. For all such places, the lint remains allowed, because they need further work to address the relevant concerns. This list includes:

- `std::backtrace_rs` (internal-only)
- `std::sys` (internal-only)
- `std::os`

Notably this eliminates all "unwrapped" unsafe operations in `std::io` and `std::sync`, which will make them much more auditable in the future. Such has *also* been left for future work. While I made a few safety comments along the way on interfaces I have grown sufficiently familiar with, in most cases I had no context, nor particular confidence the unsafety was correct.

In the cases where I was able to determine the unsafety was correct without having prior context, it was obviously redundant. For example, an unsafe function calling another unsafe function that has the exact same contract, forwarding its caller's requirements just as it forwards its actual call.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. rollup A PR which is a rollup labels Jul 15, 2024
@workingjubilee
Copy link
Member Author

somewhat optimistic and slightly pointless rollup.

@bors r+ rollup=never p=3

@bors
Copy link
Contributor

bors commented Jul 15, 2024

📌 Commit a6b4ff6 has been approved by workingjubilee

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 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 15, 2024
…kingjubilee

Rollup of 3 pull requests

Successful merges:

 - rust-lang#127020 ( Add classify and related methods for f16 and f128 )
 - rust-lang#127265 (Fill out target-spec metadata for all targets)
 - rust-lang#127744 (std: `#![deny(unsafe_op_in_unsafe_fn)]` in platform-independent code)

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

bors commented Jul 15, 2024

⌛ Testing commit a6b4ff6 with merge 3f6b2fa...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc-demangle v0.1.24
[RUSTC-TIMING] compiler_builtins test:false 2.602
[RUSTC-TIMING] profiler_builtins test:false 0.031
[RUSTC-TIMING] rustc_demangle test:false 1.166
rustc-LLVM ERROR: Cannot select: 0x7f8150577940: f32 = fp16_to_fp 0x7f81504496d0, library/core/src/num/f16.rs:920:30
  0x7f81504496d0: i64,ch = CopyFromReg 0x7f8150d4b120, Register:i64 %2, library/core/src/num/f16.rs:920:30
    0x7f8150578510: i64 = Register %2
In function: _ZN4core3f1621_$LT$impl$u20$f16$GT$9from_bits13ct_u16_to_f1617h1fdb7864bff0377eE
error: could not compile `core` (lib)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] alloc test:false 4.168
Build completed unsuccessfully in 0:15:26

@bors
Copy link
Contributor

bors commented Jul 15, 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 15, 2024
@workingjubilee workingjubilee deleted the rollup-5vcs1jx branch July 15, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants