Uh oh!
There was an error while loading. Please reload this page.
Stabilize some Result methods as const - #76136
Conversation
Stabilize the following methods of `Result` as const: - `is_ok` - `is_err` - `as_ref` Possible because of stabilization of rust-lang#49146 (Allow if and match in constants).
rust-highfive
commented
Aug 31, 2020
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
CDirkx
commented
Aug 31, 2020
ecstatic-morse
commented
Aug 31, 2020
r? @KodrAus (Needs FCP) |
CDirkx
commented
Sep 1, 2020
Created an issue for similar stabilizations: #76225 |
KodrAus
commented
Sep 4, 2020
@rfcbot fcp merge |
Team member @KodrAus has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
commented
Sep 7, 2020
🔔 This is now entering its final comment period, as per the review above. 🔔 |
EDIT: Nevermind, these all require |
bors
commented
Sep 17, 2020
⌛ Testing commit 787b270 with merge a51855f645eb6b86d1c6eb5656ae3394c9949a05... |
bors
commented
Sep 17, 2020
💔 Test failed - checks-actions |
ecstatic-morse
commented
Sep 17, 2020
@CDirkx Test failures are legit. Clippy has a lint that suggests |
Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts. Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.
CDirkx
commented
Sep 20, 2020
I updated the testcases, when this get's merged I'll update the testcases using |
RalfJung
commented
Sep 20, 2020
How can it be enough to update the testcases, doesn't the clippy code emitting these lints also need to be updated? |
ebroto
commented
Sep 20, 2020
Clippy is checking if the suggested methods are But once the |
That's what I thought as well (#76135 (comment)), but the implementation of I removed the |
`is_ok` and `is_err` are stabilized as const and can thus always be suggested.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Ralf Jung <post@ralfj.de>
RalfJung
commented
Sep 20, 2020
@bors r=dtolnay |
bors
commented
Sep 20, 2020
📌 Commit bf70e21 has been approved by |
bors
commented
Sep 20, 2020
bors
commented
Sep 20, 2020
☀️ Test successful - checks-actions, checks-azure |
Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: rust-lang#67520). I believe these methods to be eligible for stabilization because of the stabilization of rust-lang#49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](rust-lang#75463) and [PR#76135](rust-lang#76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: rust-lang#76225
Stabilize the following methods of Result as const:
is_okis_erras_refA test is also included, analogous to the test for
const_option.These methods are currently const under the unstable feature
const_result(tracking issue: #67520).I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: PR#75463 and PR#76135.
Note: these methods are the only methods currently under the
const_resultfeature, thus this PR results in the removal of the feature.Related: #76225