Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Dec 23, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fee1-dead and others added 12 commits December 22, 2025 21:37
It only tests the usage and formatting of `fmt::Pointer`.
Fixes time.rs by updating the MIN and MAX structs appropriately.

Signed-off-by: John Nunley <dev@notgull.net>
Start small. If it works well we can increase usage bit by bit as time
passes.

Note that we keep using "0" to represent "no specific line" because
changing to `Option<LineNumber>` everywhere is much bigger and noisier
change. That can be done later if wanted.
* No method named `allow_toggle()` exists on the type, but based on the
documentation of both `requires_nightly()` and `toggle_allowed()` it seems that
`toggle_allowed()` is the intended method to mention.

* Add `()` to the mention of `in_cfg()` to make it clear that a method is being
referred to, and to match the presence of `()` in the mention of
`toggle_allowed()`.
…t-impl, r=petrochenkov

Support syntax for one-line trait reuse

This PR adds support for reusing the whole trait with a one-line reuse syntax and is part of the delegation feature rust-lang#118212:
```rust
trait T {
  fn foo(&self);
}

struct S;
impl T for S { ... }

struct Wrapper(S);
reuse impl T for Wrapper { self.0 }
```

The core idea is that we already have support for glob reuse, so in this scenario we want to transform one-line reuse into a trait impl block with a glob reuse in the following way:
```rust
//Before
reuse impl T for Wrapper { self.0 }

//After
impl T for Wrapper {
  reuse T::* { self.0 }
}
```

It seems like this task can be solved during parsing stage, when we encountered a one-line trait reuse, we can expand into this impl block right away, and the code which was already written to expand glob delegations will take care about the rest. We will copy trait path into glob reuse path.

The implementation of the transformation reuses already existing methods for `impl` parsing, however, we do not parse inner `impl` items, instead we parse "inner items" as delegation body. Thus, we do not have to deal with generics, consts, unsafe and other `impl` related features.

Other syntax possibility is trying to shorten one-line reuse by replacing `impl` keyword with `reuse` keyword:
```rust
reuse T for Wrapper { self.0 }
```
In this case implementation may become more complicated, and the syntax more confusing, as keywords such as `const` or `unsafe` will precede `reuse`, and there are also generics:
```rust
unsafe reuse<T1, T2> T for Wrapper { self.0 }
```

In the first (currently implemented) version reuse is placed in the beginning of the item, and it is clear that we will reuse trait implementation, while in the second, shorter version, the `reuse` keyword may be lost in generics and keywords that may precede `impl`.

r? ``@petrochenkov``
compiletest: Add `LineNumber` newtype to avoid `+1` magic here and there

Start small. If it works well we can increase usage bit by bit as time passes.

My main motivation for doing this is to get rid of the `+ 1` I otherwise have to add in rust-lang#150201 on this line:
```rs
                crate::directives::line::line_directive(file, zero_based_line_no + 1, &line)
```
But I think this is a nice general improvement by itself.

Note that we keep using "0" to represent "no specific line" because changing to `Option<LineNumber>` everywhere is a very noisy and significant change. That _can_ be changed later if wanted, but let's not do it now.
…o, r=petrochenkov

move a ui test to coretests unit test

It only tests the usage and formatting of `fmt::Pointer`.
Fix compilation error in hermit-abi time.rs

Fixes time.rs by updating the MIN and MAX structs appropraitely.

Fixes rust-lang#150294
…boet

std: remove unsupported pipe module from VEXos pal

rust-lang#146794 moved `pipe` implementations out of PAL and into a toplevel `sys` module. While most targets supporting libstd were updated, the PR did not remove the old module from the `vexos` PAL, causing builds to fail on the `armv7a-vex-v5` target.

<img width="2258" height="322" alt="image" src="https://github.com/user-attachments/assets/3bdb83f9-e577-4795-9d20-0ae4ab5d505c" />

This PR removes the old module path in the PAL and allows `vexos` targets to fall back to the `unsupported` implementation in sys/pipe.
…lcnr

`target_features::Stability`: tweak docs of `requires_nightly()`

* No method named `allow_toggle()` exists on the type, but based on the documentation of both `requires_nightly()` and `toggle_allowed()` it seems that `toggle_allowed()` is the intended method to mention.

* Add `()` to the mention of `in_cfg()` to make it clear that a method is being referred to, and to match the presence of `()` in the mention of `toggle_allowed()`.
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit 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. labels Dec 23, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Dec 23, 2025
@bors
Copy link
Collaborator

bors commented Dec 23, 2025

📌 Commit d7eee19 has been approved by JonathanBrouwer

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 Dec 23, 2025
@bors
Copy link
Collaborator

bors commented Dec 23, 2025

⌛ Testing commit d7eee19 with merge 0bd13c3...

bors added a commit that referenced this pull request Dec 23, 2025
…uwer

Rollup of 6 pull requests

Successful merges:

 - #150130 (Support syntax for one-line trait reuse)
 - #150205 (compiletest: Add `LineNumber` newtype to avoid `+1` magic here and there)
 - #150282 (move a ui test to coretests unit test)
 - #150295 (Fix compilation error in hermit-abi time.rs)
 - #150301 (std: remove unsupported pipe module from VEXos pal)
 - #150303 (`target_features::Stability`: tweak docs of `requires_nightly()`)

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

#150304 (comment) was probably spurious but if this PR fails with the same error again it might not be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit 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. 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.

9 participants