Skip to content

Tracking Issue for const RangeBounds and const RangeX::contains #108082

Open

Description

@onestacked

Feature gate: #![feature(const_range_bounds)]

This is a tracking issue for making RangeBounds #[const_trait], implementing it for all Range types and allowing range.contains() and associated functions to be called form a const context.

Public API

// core::ops::RangeInclusive
impl<Idx> RangeInclusive<Idx> {
   pub const fn into_inner(self) -> (Idx, Idx)
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩

Activity

  1. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-libs-api[DEPRECATED; DO NOT USE]
    on Feb 15, 2023
  2. added a commit that references this issue on Feb 16, 2023
  3. added
    S-tracking-blockedStatus: This tracking issue is blocked on another tracking issue
    on Mar 7, 2024
  4. RalfJung commented on Sep 8, 2024

    @RalfJung
    Member

    This got mostly removed by #110393, there's just one method left... is that even worth keeping?

  5. RalfJung commented on Sep 8, 2024

    @RalfJung
    Member
  6. reopened this on Sep 8, 2024
  7. herabit commented on May 19, 2025

    @herabit

    I think it would be useful to at the very least expose the RangeBounds functionality through const inherent methods, particularly on RangeInclusive.

    Currently there is no way of checking whether the the end bound should be inclusive or exclusive in const, which makes for implementing accurate reimplementations of RangeBounds in stable, that work in const, difficult.

    Even if const traits aren't available, ever, for types that can expose similar functionality to the traits the implement, in const, I think they probably should, and just deprecate those inherent methods when, or if they become superseded by const traits, if they ever arrive.

  8. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-const_trait_impl`#![feature(const_trait_impl)]`S-tracking-blockedStatus: This tracking issue is blocked on another tracking issueT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions