Skip to content

Rollup of 8 pull requests #139117

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 16 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

RalfJung and others added 16 commits March 3, 2025 10:53
`uclibc` is not an environment understood by LLVM, it is only a concept
in Clang that can be selected with `-muclibc` (it affects which dynamic
linker is passed to the static linker's `-dynamic-linker` flag).

In fact, using `uclibcgnueabi`/`uclibc` is actively harmful, as it
prevents LLVM from seeing that the target is gnu-like; we should use
`gnueabi`/`gnu` directly instead.
By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
stabilize const_cell

`@rust-lang/libs-api` `@rust-lang/wg-const-eval` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn`  -- specifically the APIs listed here:
```rust
// core::cell

impl<T> Cell<T> {
    pub const fn replace(&self, val: T) -> T;
}

impl<T: Copy> Cell<T> {
    pub const fn get(&self) -> T;
}

impl<T: ?Sized> Cell<T> {
    pub const fn get_mut(&mut self) -> &mut T;
    pub const fn from_mut(t: &mut T) -> &Cell<T>;
}

impl<T> Cell<[T]> {
    pub const fn as_slice_of_cells(&self) -> &[Cell<T>];
}
```
Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents.

Fixes rust-lang#131283
…ouxu

Fix `uclibc` LLVM target triples

`uclibc` is not an environment understood by LLVM, it is only a concept in Clang that can be selected with `-muclibc` (it affects which dynamic linker is passed to the static linker's `-dynamic-linker` flag).

In fact, using `uclibcgnueabi`/`uclibc` is actively harmful, as it prevents LLVM from seeing that the target is gnu-like; we should use `gnueabi`/`gnu` directly instead.

Motivation: To make it easier to verify that [`cc-rs`' conversion from `rustc` to Clang/LLVM triples](rust-lang/cc-rs#1431) is correct.

**There are no target maintainers for these targets.** So I'll CC `@lancethepants` and `@skrap` who maintain the related `armv7-unknown-linux-uclibceabi` and `armv7-unknown-linux-uclibceabihf` (both of which already pass `-gnu` instead of `-uclibc`) in case they have any insights.

r? jieyouxu
…boet

Start using `with_native_path` in `std::sys::fs`

Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string.

However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around.

r? joboet
…it-with-actual-value, r=onur-ozkan

replace commit placeholder in vendor status with actual commit

closes: rust-lang#120499
std: deduplicate `errno` accesses

By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
compiletest: Support matching diagnostics on lines below

Using `//~vvv ERROR`.

This is not needed often, but it's easy to support, and it allows to eliminate a class of `error-pattern`s that cannot be eliminated in any other way.

See the diff for the examples of such patterns coming from parser.
Some of them can be matched by `//~ ERROR` or `//~^ ERROR` as well (when the final newline is allowed), but it changes the shape of reported spans, so I chose to keep the spans by using `//~v ERROR`.
…mpiler-errors

`BackendRepr::is_signed`: comment why this may panics

Was wondering why this method could panics while the others couldn't, so quote PR rust-lang#70189.
…-errors

Mark .pp files as Rust

Pretty-printing tests generate `.pp` files, but GitHub classify and highlight them as Pascal:
[https://github.com/search?q=repo:rust-lang/rust+path:*.pp&type=code](https://github.com/search?q=repo%3Arust-lang%2Frust+path%3A*.pp&type=code)

`@rustbot` label +A-meta +A-testsuite
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like 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. rollup A PR which is a rollup labels Mar 29, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Mar 29, 2025

📌 Commit 28ca8dc 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 Mar 29, 2025
@bors
Copy link
Collaborator

bors commented Mar 29, 2025

⌛ Testing commit 28ca8dc with merge a1ef6c7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 29, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#137928 (stabilize const_cell)
 - rust-lang#138431 (Fix `uclibc` LLVM target triples)
 - rust-lang#138832 (Start using `with_native_path` in `std::sys::fs`)
 - rust-lang#139060 (replace commit placeholder in vendor status with actual commit)
 - rust-lang#139081 (std: deduplicate `errno` accesses)
 - rust-lang#139100 (compiletest: Support matching diagnostics on lines below)
 - rust-lang#139105 (`BackendRepr::is_signed`: comment why this may panics)
 - rust-lang#139106 (Mark .pp files as Rust)

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

bors commented Mar 29, 2025

💔 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 Mar 29, 2025
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
Attempting with retry: make prepare
Traceback (most recent call last):
  File "/checkout/src/bootstrap/bootstrap.py", line 1401, in <module>
    main()
  File "/checkout/src/bootstrap/bootstrap.py", line 1381, in main
    bootstrap(args)
  File "/checkout/src/bootstrap/bootstrap.py", line 1340, in bootstrap
    build.check_vendored_status()
  File "/checkout/src/bootstrap/bootstrap.py", line 1210, in check_vendored_status
    commit = self.get_latest_commit(repo_path, git_merge_commit_email)
  File "/checkout/src/bootstrap/bootstrap.py", line 1182, in get_latest_commit
    commit = subprocess.check_output(cmd, text=True).strip()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
make: *** [prepare] Error 1
Makefile:100: recipe for target 'prepare' failed
Command failed. Attempt 2/5:
Traceback (most recent call last):
  File "/checkout/src/bootstrap/bootstrap.py", line 1401, in <module>
    main()
  File "/checkout/src/bootstrap/bootstrap.py", line 1381, in main
    bootstrap(args)
  File "/checkout/src/bootstrap/bootstrap.py", line 1340, in bootstrap
    build.check_vendored_status()
  File "/checkout/src/bootstrap/bootstrap.py", line 1210, in check_vendored_status
    commit = self.get_latest_commit(repo_path, git_merge_commit_email)
  File "/checkout/src/bootstrap/bootstrap.py", line 1182, in get_latest_commit
    commit = subprocess.check_output(cmd, text=True).strip()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
Makefile:100: recipe for target 'prepare' failed
make: *** [prepare] Error 1
Command failed. Attempt 3/5:
Traceback (most recent call last):
  File "/checkout/src/bootstrap/bootstrap.py", line 1401, in <module>
    main()
  File "/checkout/src/bootstrap/bootstrap.py", line 1381, in main
    bootstrap(args)
  File "/checkout/src/bootstrap/bootstrap.py", line 1340, in bootstrap
    build.check_vendored_status()
  File "/checkout/src/bootstrap/bootstrap.py", line 1210, in check_vendored_status
    commit = self.get_latest_commit(repo_path, git_merge_commit_email)
  File "/checkout/src/bootstrap/bootstrap.py", line 1182, in get_latest_commit
    commit = subprocess.check_output(cmd, text=True).strip()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
make: *** [prepare] Error 1
Makefile:100: recipe for target 'prepare' failed
Command failed. Attempt 4/5:
Traceback (most recent call last):
  File "/checkout/src/bootstrap/bootstrap.py", line 1401, in <module>
    main()
  File "/checkout/src/bootstrap/bootstrap.py", line 1381, in main
    bootstrap(args)
  File "/checkout/src/bootstrap/bootstrap.py", line 1340, in bootstrap
    build.check_vendored_status()
  File "/checkout/src/bootstrap/bootstrap.py", line 1210, in check_vendored_status
    commit = self.get_latest_commit(repo_path, git_merge_commit_email)
  File "/checkout/src/bootstrap/bootstrap.py", line 1182, in get_latest_commit
    commit = subprocess.check_output(cmd, text=True).strip()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
make: *** [prepare] Error 1
Makefile:100: recipe for target 'prepare' failed
Command failed. Attempt 5/5:
Traceback (most recent call last):
  File "/checkout/src/bootstrap/bootstrap.py", line 1401, in <module>
    main()
  File "/checkout/src/bootstrap/bootstrap.py", line 1381, in main
    bootstrap(args)
  File "/checkout/src/bootstrap/bootstrap.py", line 1340, in bootstrap
    build.check_vendored_status()
  File "/checkout/src/bootstrap/bootstrap.py", line 1210, in check_vendored_status
    commit = self.get_latest_commit(repo_path, git_merge_commit_email)
  File "/checkout/src/bootstrap/bootstrap.py", line 1182, in get_latest_commit
    commit = subprocess.check_output(cmd, text=True).strip()
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
Makefile:100: recipe for target 'prepare' failed
make: *** [prepare] Error 1
The command has failed after 5 attempts.
  local time: Sat Mar 29 20:03:14 UTC 2025
  network time: Sat, 29 Mar 2025 20:03:14 GMT

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.