Skip to content

Clarify that core::range ranges do not have special syntax#155002

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
shepmaster:clarify-new-range
Apr 9, 2026
Merged

Clarify that core::range ranges do not have special syntax#155002
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
shepmaster:clarify-new-range

Conversation

@shepmaster
Copy link
Copy Markdown
Member

I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
… have special syntax

I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
@rustbot rustbot 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 Apr 8, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

tgross35 is currently at their maximum review capacity.
They may take a while to respond.

@shepmaster
Copy link
Copy Markdown
Member Author

It's probably worth calling out a few things that seemed suspicious but that I didn't change...

These doctests seem to be testing the legacy syntax, unless I misunderstand how the standalone_crate modifier works:

  • /// for i in ..=5 {
    /// // ...
    /// }
  • /// let arr = [0, 1, 2, 3, 4];
    /// assert_eq!(arr[ .. ], [0, 1, 2, 3, 4]);
    /// assert_eq!(arr[ .. 3], [0, 1, 2 ]);
    /// assert_eq!(arr[ ..=3], [0, 1, 2, 3 ]); // This is a `RangeToInclusive`
    /// assert_eq!(arr[1.. ], [ 1, 2, 3, 4]);
    /// assert_eq!(arr[1.. 3], [ 1, 2 ]);
    /// assert_eq!(arr[1..=3], [ 1, 2, 3 ]);

I didn't change any of the mentions about "2-tuple of Bound<&T>" as these are a bit more nuanced and I just wanted to clear up the high-level confusion.

There's one usage of doc(alias. I don't know why it's only applied to one type in this file, but it should probably be consistent (and I'd vote for "consistently not present in this file, yet").

@shepmaster shepmaster added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 8, 2026
@shepmaster
Copy link
Copy Markdown
Member Author

/cc @pitaj @Mark-Simulacrum

Copy link
Copy Markdown
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

📌 Commit eef4363 has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Apr 8, 2026
@tgross35
Copy link
Copy Markdown
Contributor

tgross35 commented Apr 8, 2026

It's probably worth calling out a few things that seemed suspicious but that I didn't change...

Agreed with everything you mention here, I assume the original docs were likely copied from core::ops, possibly with the thought that these types would stabilize at the same time as the new syntax rather than before. Seems like there is room for further improvement, but also agreed that you got the most pressing thing here.

rust-bors bot pushed a commit that referenced this pull request Apr 8, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #154912 (Remove `BuiltinLintDiag`)
 - #154598 (test `#[naked]` with `#[link_section = "..."]` on windows)
 - #154719 (Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes)
 - #154057 (Parenthesize block-like expressions in index base of pretty printer)
 - #154893 (make `expected_literal` positive)
 - #155002 (Clarify that `core::range` ranges do not have special syntax)
rust-timer added a commit that referenced this pull request Apr 9, 2026
Rollup merge of #155002 - shepmaster:clarify-new-range, r=tgross35

Clarify that `core::range` ranges do not have special syntax

r? @tgross35
@rust-bors rust-bors bot merged commit efa9224 into rust-lang:main Apr 9, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them.

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 9, 2026
@cuviper cuviper modified the milestones: 1.96.0, 1.95.0 Apr 9, 2026
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 9, 2026
@shepmaster shepmaster deleted the clarify-new-range branch April 9, 2026 16:03
rust-bors bot pushed a commit that referenced this pull request Apr 9, 2026
[beta] reverts and backports

This reverts two `dbg!` changes to avoid regressions[^1][^2] in the upcoming 1.95 release:

- std: avoid tearing `dbg!` prints #149869
- don't drop arguments' temporaries in `dbg!` #154074
  - ... which was previously backported in #154725

This also reverts a stabilization over a late issue[^3] of semantics:

- Stabilize `assert_matches` #137487

And a few other backport/reverts from `main`:

- Revert performing basic const checks in typeck on stable #154930 / #155033
- Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph" #154712
- Clarify that core::range ranges do not have special syntax #155002
  
[^1]: #153850
[^2]: #154988
[^3]: #154406
rust-bors bot pushed a commit that referenced this pull request Apr 9, 2026
[beta] reverts and backports

This reverts two `dbg!` changes to avoid regressions[^1][^2] in the upcoming 1.95 release:

- std: avoid tearing `dbg!` prints #149869
- don't drop arguments' temporaries in `dbg!` #154074
  - ... which was previously backported in #154725

This also reverts a stabilization over a late issue[^3] of semantics:

- Stabilize `assert_matches` #137487

And a few other backport/reverts from `main`:

- Revert performing basic const checks in typeck on stable #154930 / #155033
- Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph" #154712
- Clarify that core::range ranges do not have special syntax #155002

Clippy is backporting 2 ICE fixes and 1 perf regression (via #155051):

- rust-lang/rust-clippy#16685 already backported in #154211 to stable. This makes sure that it doesn't regress again in beta/next stable
- rust-lang/rust-clippy#16659 The ICE that is being fixed here was introduced in the 1.95 release cycle
- rust-lang/rust-clippy#16652 Perf regression introduced in the 1.95 release cycle.
  
[^1]: #153850
[^2]: #154988
[^3]: #154406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants