Skip to content

Update path separators to be available in const context - #153196

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
MikkelPaulson:const-path-separators
Mar 5, 2026
Merged

Update path separators to be available in const context#153196
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
MikkelPaulson:const-path-separators

Conversation

@MikkelPaulson

@MikkelPaulsonMikkelPaulson commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Tracking issue: #153106

This makes platform-dependent secondary path separators available in const context (ie. at compile time). The platform definitions have also been consolidated behind a common macro to prevent transcription errors, whereas previously they were defined 3-4 times per platform.

Questions

I've manually verified that this compiles against each platform. It seems like no unit tests should be required for this change; is that correct?

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 27, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

@joboetjoboet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the FIXME is necessary, but everything else looks very good!

View changes since this review

Comment threadlibrary/std/src/sys/path/mod.rs Outdated

@joboetjoboet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one more thing I noticed.

View changes since this review

Comment threadlibrary/std/src/sys/path/mod.rs Outdated
@rustbotrustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbotrustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 4, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbotrustbot added the has-merge-commits PR has merge commits, merge with caution. label Mar 4, 2026
Change reference to imported MAIN_SEP_STR to local MAIN_SEPARATOR_STR,
removing an unnecessary import.
@rustbotrustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2026
@MikkelPaulson

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2026
@joboet

Copy link
Copy Markdown
Member

Great, thanks! Could you please squash your last three commits together? After that, r=me

@bors delegate+

@rust-bors

rust-borsBot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

✌️ @MikkelPaulson, you can now approve this pull request!

If @joboet told you to "r=me" after making some further change, then please make that change and post @bors r=joboet.

* consolidate various representations of separators in std::sys::path
into a single macro_rules invocation per platform to save
transcription errors
* make `std::path::is_separator()` const
* new constants `std::path::{SEPARATORS, SEPARATORS_STR}`
@joboet

Copy link
Copy Markdown
Member

👍
@bors r+

@rust-bors

rust-borsBot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 098b1b9 has been approved by joboet

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 4, 2026
rust-borsBot pushed a commit that referenced this pull request Mar 4, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- #153402 (miri subtree update)
- #152164 (Lint unused features)
- #152801 (Refactor WriteBackendMethods a bit)
- #153196 (Update path separators to be available in const context)
- #153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- #153317 (Abort after `representability` errors)
- #153276 (Remove `cycle_fatal` query modifier)
- #153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- #153396 (use `minicore` in some `run-make` tests)
- #153401 (Migrationg of `LintDiagnostic` - part 7)
- #153406 (Remove a ping for myself)
- #153414 (Rename translation -> formatting)
rust-borsBot pushed a commit that referenced this pull request Mar 4, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- #153402 (miri subtree update)
- #152164 (Lint unused features)
- #152801 (Refactor WriteBackendMethods a bit)
- #153196 (Update path separators to be available in const context)
- #153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- #153317 (Abort after `representability` errors)
- #153276 (Remove `cycle_fatal` query modifier)
- #153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- #153396 (use `minicore` in some `run-make` tests)
- #153401 (Migrationg of `LintDiagnostic` - part 7)
- #153406 (Remove a ping for myself)
- #153414 (Rename translation -> formatting)
rust-borsBot pushed a commit that referenced this pull request Mar 4, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- #153402 (miri subtree update)
- #152164 (Lint unused features)
- #152801 (Refactor WriteBackendMethods a bit)
- #153196 (Update path separators to be available in const context)
- #153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- #153317 (Abort after `representability` errors)
- #153276 (Remove `cycle_fatal` query modifier)
- #153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- #153396 (use `minicore` in some `run-make` tests)
- #153401 (Migrationg of `LintDiagnostic` - part 7)
- #153406 (Remove a ping for myself)
- #153414 (Rename translation -> formatting)
rust-borsBot pushed a commit that referenced this pull request Mar 5, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- #153402 (miri subtree update)
- #152164 (Lint unused features)
- #152801 (Refactor WriteBackendMethods a bit)
- #153196 (Update path separators to be available in const context)
- #153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- #153317 (Abort after `representability` errors)
- #153276 (Remove `cycle_fatal` query modifier)
- #153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- #153396 (use `minicore` in some `run-make` tests)
- #153401 (Migrationg of `LintDiagnostic` - part 7)
- #153406 (Remove a ping for myself)
- #153414 (Rename translation -> formatting)
@rust-bors
rust-borsBot merged commit 5ff104c into rust-lang:mainMar 5, 2026
11 checks passed
@rustbotrustbot added this to the 1.96.0 milestone Mar 5, 2026
rust-timer added a commit that referenced this pull request Mar 5, 2026
Rollup merge of #153196 - MikkelPaulson:const-path-separators, r=joboet
Update path separators to be available in const context
Tracking issue: #153106
This makes platform-dependent secondary path separators available in const context (ie. at compile time). The platform definitions have also been consolidated behind a common macro to prevent transcription errors, whereas previously they were defined 3-4 times per platform.
### Questions
I've manually verified that this compiles against each platform. It seems like no unit tests should be required for this change; is that correct?
github-actionsBot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Mar 5, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#153402 (miri subtree update)
- rust-lang/rust#152164 (Lint unused features)
- rust-lang/rust#152801 (Refactor WriteBackendMethods a bit)
- rust-lang/rust#153196 (Update path separators to be available in const context)
- rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- rust-lang/rust#153317 (Abort after `representability` errors)
- rust-lang/rust#153276 (Remove `cycle_fatal` query modifier)
- rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- rust-lang/rust#153396 (use `minicore` in some `run-make` tests)
- rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7)
- rust-lang/rust#153406 (Remove a ping for myself)
- rust-lang/rust#153414 (Rename translation -> formatting)
github-actionsBot pushed a commit to rust-lang/miri that referenced this pull request Mar 5, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#153402 (miri subtree update)
- rust-lang/rust#152164 (Lint unused features)
- rust-lang/rust#152801 (Refactor WriteBackendMethods a bit)
- rust-lang/rust#153196 (Update path separators to be available in const context)
- rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- rust-lang/rust#153317 (Abort after `representability` errors)
- rust-lang/rust#153276 (Remove `cycle_fatal` query modifier)
- rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- rust-lang/rust#153396 (use `minicore` in some `run-make` tests)
- rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7)
- rust-lang/rust#153406 (Remove a ping for myself)
- rust-lang/rust#153414 (Rename translation -> formatting)
@MikkelPaulson
MikkelPaulson deleted the const-path-separators branch March 6, 2026 02:11
github-actionsBot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Mar 9, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#153402 (miri subtree update)
- rust-lang/rust#152164 (Lint unused features)
- rust-lang/rust#152801 (Refactor WriteBackendMethods a bit)
- rust-lang/rust#153196 (Update path separators to be available in const context)
- rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- rust-lang/rust#153317 (Abort after `representability` errors)
- rust-lang/rust#153276 (Remove `cycle_fatal` query modifier)
- rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- rust-lang/rust#153396 (use `minicore` in some `run-make` tests)
- rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7)
- rust-lang/rust#153406 (Remove a ping for myself)
- rust-lang/rust#153414 (Rename translation -> formatting)
ghaaj pushed a commit to ghaaj/polygrammar that referenced this pull request Aug 7, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#153402 (miri subtree update)
- rust-lang/rust#152164 (Lint unused features)
- rust-lang/rust#152801 (Refactor WriteBackendMethods a bit)
- rust-lang/rust#153196 (Update path separators to be available in const context)
- rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
- rust-lang/rust#153317 (Abort after `representability` errors)
- rust-lang/rust#153276 (Remove `cycle_fatal` query modifier)
- rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
- rust-lang/rust#153396 (use `minicore` in some `run-make` tests)
- rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7)
- rust-lang/rust#153406 (Remove a ping for myself)
- rust-lang/rust#153414 (Rename translation -> formatting)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant 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.

3 participants

@MikkelPaulson@rustbot@joboet