Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Dec 11, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

cyrgani and others added 26 commits September 27, 2025 12:29
This is useful for changing the *default* for whether doctests are
merged or not. Currently, that default is solely controlled by
`edition = 2024`, which adds a high switching cost to get doctest
merging. This flag allows opt-ing in even on earlier additions.

Unlike the `edition = 2024` default, `--merge-doctests=yes` gives a hard
error if merging fails instead of falling back to running standalone
tests. The user has explicitly said they want merging, so we shouldn't
silently do something else.

`--merge-doctests=auto` is equivalent to the current 2024 edition
behavior, but available on earlier editions.
This allows viewing failed merged doctests.
…xternal macro

```
error[E0308]: mismatched types
  --> $DIR/macro-span-caller-replacement.rs:5:17
   |
LL |             s = format!("{arg}");
   |                 ^^^^^^^^^^^^^^^^ expected `&str`, found `String`
...
LL |     macro_with_format!();
   |     -------------------- in this macro invocation
   |
   = note: this error originates in the macro `format` which comes from the expansion of the macro `macro_with_format` (in Nightly builds, run with -Z macro-backtrace for more info)
```
This commit introduces two new constants to SystemTime: `MIN` and `MAX`,
whose value represent the maximum values for the respective data type,
depending upon the platform.

Technically, this value is already obtainable during runtime with the
following algorithm: Use `SystemTime::UNIX_EPOCH` and call `checked_add`
(or `checked_sub`) repeatedly with `Duration::new(0, 1)` on it, until it
returns None.  Mathematically speaking, this algorithm will terminate
after a finite amount of steps, yet it is impractical to run it, as it
takes practically forever.

Besides, this commit also adds a unit test.  Concrete implementation
depending upon the platform is done in later commits.

In the future, the hope of the authors lies within the creation of a
`SystemTime::saturating_add` and `SystemTime::saturating_sub`, similar
to the functions already present in `std::time::Duration`.  However, for
those, these constants are crucially required, thereby this should be
seen as the initial step towards this direction.

Below are platform specifc notes:

# Hermit

The HermitOS implementation is more or less identitcal to the Unix one.

# sgx

The implementation uses a `Duration` to store the Unix time, thereby
implying `Duration::ZERO` and `Duration::MAX` as the limits.

# solid

The implementation uses a `time_t` to store the system time within a
single value (i.e. no dual secs/nanosecs handling), thereby implying its
`::MIN` and `::MAX` values as the respective boundaries.

# UEFI

UEFI has a weird way to store times, i.e. a very complicated struct.
The standard proclaims "1900-01-01T00:00:00+0000" to be the lowest
possible value and `MAX_UEFI_TIME` is already present for the upper
limit.

# Windows

Windows is weird.  The Win32 documentation makes no statement on a
maximum value here.  Next to this, there are two conflicting types:
`SYSTEMTIME` and `FILETIME`.  Rust's Standard Library uses `FILETIME`,
whose limit will (probably) be `i64::MAX` packed into two integers.
However, `SYSTEMTIME` has a lower-limit.

# xous

It is similar to sgx in the sense of using a `Duration`.

# unsupported

Unsupported platforms store a `SystemTime` in a `Duration`, just like
sgx, thereby implying `Duration::ZERO` and `Duration::MAX` as the
respective limits.
…=yotamofek

Put negative implementors first and apply same ordering logic to foreign implementors

Fixes rust-lang#51129.

This PR changeda surprisingly small amount of things to put negative trait impls before the others: basically just adding a new information in the generated JS file for foreign implementors and a "negative marker" DOM element to know where to insert negative impls.

I also used this occasion to make the foreign implementors sort the same as the local ones by using `compare_names`.

You can test it [here](https://rustdoc.crud.net/imperio/neg-implementors/core/marker/trait.Sync.html#implementors).

r? ``@notriddle``
…aumeGomez

remove duplicated columns from `rustc_error_code::error_codes!`

Possible because of rust-lang#146308 ~~, but currently still blocked on the next stage0 bump~~.
…nkov

Point at span within local macros even when error happens in nested external macro

Address issue noticed at https://users.rust-lang.org/t/error-message-does-not-specify-where-in-macro/135157/1. On errors occurring within a macro expansion, point at the innermost local macro expansion point.

```
error[E0308]: mismatched types
  --> $DIR/macro-span-caller-replacement.rs:5:17
   |
LL |             s = format!("{arg}");
   |                 ^^^^^^^^^^^^^^^^ expected `&str`, found `String`
...
LL |     macro_with_format!();
   |     -------------------- in this macro invocation
   |
   = note: this error originates in the macro `format` which comes from the expansion of the macro `macro_with_format` (in Nightly builds, run with -Z macro-backtrace for more info)
```
…=ChrisDenton

Add SystemTime::{MIN, MAX}

Accepted ACP: <rust-lang/libs-team#692>
Tracking Issue: <rust-lang#149067>

---

This merge request introduces two new constants to `SystemTime`: `MIN` and `MAX`, whose values represent the maximum values for the respective data type, depending upon the platform.

Technically, this value is already obtainable during runtime with the following algorithm:
Use `SystemTime::UNIX_EPOCH` and call `checked_add` (or `checked_sub`) repeatedly with `Duration::new(0, 1)` on it, until it returns None.
Mathematically speaking, this algorithm will terminate after a finite amount of steps, yet it is impractical to run it, as it takes practically forever.

Besides, this commit also adds a unit test to verify those values represent the respective minimum and maximum, by letting a `checked_add` and `checked_sub` on it fail.

In the future, the hope of the authors lies within the creation of a `SystemTime::saturating_add` and `SystemTime::saturating_sub`, similar to the functions already present in `std::time::Duration`.
However, for those, these constants are crucially required, thereby this should be seen as the initial step towards this direction.
With this change, implementing these functions oneself outside the standard library becomes feasible in a portable manner for the first time.

This feature (and a related saturating version of `checked_{add, sub}` has been requested multiple times over the course of the past few years, most notably:
* rust-lang#100141
* rust-lang#133525
* rust-lang#105762
* rust-lang#71224
* rust-lang#45448
* rust-lang#52555
…iddle

rustdoc: Add unstable `--merge-doctests=yes/no/auto` flag

This is useful for changing the *default* for whether doctests are merged or not. Currently, that default is solely controlled by `edition = 2024`, which adds a high switching cost to get doctest merging. This flag allows opting in even on earlier editions.

Unlike the `edition = 2024` default, `--merge-doctests=yes` gives a hard error if merging fails instead of falling back to running standalone tests. The user has explicitly said they want merging, so we shouldn't silently do something else.

`--merge-doctests=auto` is equivalent to the current 2024 edition behavior, but available on earlier editions.

Helps with rust-lang#141240. `@epage` said in that issue he would like a per-doctest opt-in, and that seems useful to me in addition to this flag, but I think it's a separate use case from changing the default.
…eLapkin

Rename some issue-* tests

Also fixes one incorrect issue number: rust-lang#100168 (comment)
…yotamofek

Remove "tidy" tool for `tests/rustdoc` testsuite

As discussed in the [last rustdoc meeting](https://rust-lang.zulipchat.com/#narrow/channel/393423-t-rustdoc.2Fmeetings/topic/2025-12-08/near/562554410), it seems like the current `tidy` tool is not used much for the `rustdoc` testsuite by the rustdoc contributors as it doesn't fit nicely our needs.

Until we find something better, we decided to remove it.

r? ``@yotamofek``
Do not suggest moving expression out of for loop when hitting `break` from desugaring

Fix rust-lang#149861.
@rustbot rustbot added A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc labels Dec 11, 2025
@rustbot rustbot added A-tidy Area: The tidy tool O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like 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-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Dec 11, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Dec 11, 2025

📌 Commit 6ed8e68 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 11, 2025
@bors
Copy link
Collaborator

bors commented Dec 11, 2025

⌛ Testing commit 6ed8e68 with merge cc67bcf...

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

Rollup of 10 pull requests

Successful merges:

 - #142380 (Put negative implementors first and apply same ordering logic to foreign implementors)
 - #146584 (remove duplicated columns from `rustc_error_code::error_codes!`)
 - #148717 (Point at span within local macros even when error happens in nested external macro)
 - #148825 (Add SystemTime::{MIN, MAX})
 - #149565 (rustdoc: Add unstable `--merge-doctests=yes/no/auto` flag)
 - #149770 (Rename some issue-* tests)
 - #149807 (Use ubuntu:24.04 for the `x86_64-gnu-miri` job)
 - #149850 (Remove "tidy" tool for `tests/rustdoc` testsuite)
 - #149863 (Do not suggest moving expression out of for loop when hitting `break` from desugaring)
 - #149867 (only resolve main in bin crates)

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

This is my first time making a rollup, seems pretty easy but let me know if I fucked anything up 🤞

@bors
Copy link
Collaborator

bors commented Dec 11, 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 Dec 11, 2025
@rust-log-analyzer
Copy link
Collaborator

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

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

error[E0308]: mismatched types
  --> library/std/src/sys/pal/wasm/../unsupported/time.rs:30:33
   |
30 |     pub const MAX: SystemTime = Duration::MAX;
   |                                 ^^^^^^^^^^^^^ expected `SystemTime`, found `Duration`
   |
help: try wrapping the expression in `sys::pal::wasm::time::SystemTime`
   |
30 |     pub const MAX: SystemTime = sys::pal::wasm::time::SystemTime(Duration::MAX);
   |                                 +++++++++++++++++++++++++++++++++             +

error[E0308]: mismatched types
  --> library/std/src/sys/pal/wasm/../unsupported/time.rs:32:33
   |
32 |     pub const MIN: SystemTime = Duration::ZERO;
   |                                 ^^^^^^^^^^^^^^ expected `SystemTime`, found `Duration`
   |
help: try wrapping the expression in `sys::pal::wasm::time::SystemTime`
   |
32 |     pub const MIN: SystemTime = sys::pal::wasm::time::SystemTime(Duration::ZERO);
   |                                 +++++++++++++++++++++++++++++++++              +

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

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-windows Operating system: Windows rollup A PR which is a rollup 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-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.