rust-lang / rust-lang/rust

Tracking Issue for `bound_copied`

Open
#145,966 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(bound_copied)]

This is a tracking issue to add a Bound::copied method.

Public API
impl<T: Copy> Bound<&T> {
    /// Map a `Bound<&T>` to a `Bound<T>` by copying the contents of the bound.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::ops::Bound::*;
    /// use std::ops::RangeBounds;
    ///
    /// assert_eq!((1..12).start_bound(), Included(&1));
    /// assert_eq!((1..12).start_bound().copied(), Included(1));
    /// ```
    #[must_use = "`self` will be dropped if the result is not used"]
    #[unstable(feature = "bound_copied", issue = ???)]
    pub fn copied(self) -> Bound<T> {
        match self {
            Bound::Unbounded => Bound::Unbounded,
            Bound::Included(x) => Bound::Included(*x),
            Bound::Excluded(x) => Bound::Excluded(*x),
        }
    }
}
Steps / History

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tracking checklist and review the ACP in rust-lang/libs-team#637 and the implementation linked in the issue. The feature is complete only after the final comment period and a stabilization PR are finished; no source file or test entry point is named here.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.