Add as_ref and as_mut methods for Bound by glittershark · Pull Request #80444 · rust-lang/rust (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation9 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

glittershark

Add as_ref and as_mut method for std::ops::range::Bound, patterned off
of the methods of the same name on Option.

I'm not quite sure what the process is for introducing new feature gates (this is my first contribution) so I've left these ungated, but happy to do whatever is necessary to gate them.

@rust-highfive

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dtolnay (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-log-analyzer

The job mingw-check failed! Check out the build log: (web) (plain)

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

   Compiling unwind v0.0.0 (/checkout/library/unwind)
error: associated function has missing stability attribute
   --> library/core/src/ops/range.rs:684:5
    |
684 | /     pub fn as_ref(&self) -> Bound<&T> {
685 | |         match *self {
686 | |             Included(ref x) => Included(x),
687 | |             Excluded(ref x) => Excluded(x),
688 | |             Unbounded => Unbounded,
690 | |     }
    | |_____^

error: associated function has missing stability attribute
error: associated function has missing stability attribute
   --> library/core/src/ops/range.rs:694:5
    |
694 | /     pub fn as_mut(&mut self) -> Bound<&mut T> {
695 | |         match *self {
696 | |             Included(ref mut x) => Included(x),
697 | |             Excluded(ref mut x) => Excluded(x),
698 | |             Unbounded => Unbounded,
700 | |     }
    | |_____^

error: aborting due to 2 previous errors
error: aborting due to 2 previous errors

error: could not compile `core`

To learn more, run the command again with --verbose.
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/library/test/Cargo.toml" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:01:18

dtolnay

Choose a reason for hiding this comment

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

@glittershark

Add as_ref and as_mut method for std::ops::range::Bound, patterned off of the methods of the same name on Option.

@glittershark

@dtolnay done, I think. Let me know if I did it right

dtolnay

Choose a reason for hiding this comment

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

Thanks!

@dtolnay

@bors

📌 Commit eb72dc5 has been approved by dtolnay

@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

Jan 14, 2021

JohnTitor added a commit to JohnTitor/rust that referenced this pull request

Jan 14, 2021

@JohnTitor

Add as_ref and as_mut methods for Bound

Add as_ref and as_mut method for std::ops::range::Bound, patterned off of the methods of the same name on Option.

I'm not quite sure what the process is for introducing new feature gates (this is my first contribution) so I've left these ungated, but happy to do whatever is necessary to gate them.

JohnTitor added a commit to JohnTitor/rust that referenced this pull request

Jan 14, 2021

@JohnTitor

Add as_ref and as_mut methods for Bound

Add as_ref and as_mut method for std::ops::range::Bound, patterned off of the methods of the same name on Option.

I'm not quite sure what the process is for introducing new feature gates (this is my first contribution) so I've left these ungated, but happy to do whatever is necessary to gate them.

m-ou-se added a commit to m-ou-se/rust that referenced this pull request

Jan 14, 2021

@m-ou-se

Add as_ref and as_mut methods for Bound

Add as_ref and as_mut method for std::ops::range::Bound, patterned off of the methods of the same name on Option.

I'm not quite sure what the process is for introducing new feature gates (this is my first contribution) so I've left these ungated, but happy to do whatever is necessary to gate them.

This was referenced

Jan 14, 2021

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 14, 2021

@bors

drmason13

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.