-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Don't nudge people towards toilet closures when producing owl results #4313
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@bors delegate=yaahallo |
✌️ @yaahallo can now approve this pull request |
tests/ui/drop_forget_ref.rs
Outdated
@@ -55,3 +55,18 @@ fn test_similarly_named_function() { | |||
forget(&SomeStruct); //OK; call to unrelated function which happens to have the same name | |||
std::mem::forget(&SomeStruct); | |||
} | |||
|
|||
#[allow(dead_code)] | |||
fn test_owl_closure() -> Result<(), ()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this should be restricted only to owl results instead of all result types with either their ok or err types equal to ()
9e96299
to
b2bdff4
Compare
@bors r+ |
📌 Commit b2bdff4 has been approved by |
tests/ui/drop_forget_ref.rs
Outdated
fn test_owl_result_2() -> Result<u8, ()> { | ||
#[derive(Copy, Clone)] | ||
pub struct Error; | ||
fn produce_result() -> Result<(), Error> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is never used. Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some last minute refactorings that left this behind
@bors r=yaahallo |
📌 Commit 38e7bd2 has been approved by |
Don't nudge people towards toilet closures when producing owl results `.map_err(drop)` should never be linted since sometimes you want to produce `Result<(), ()>` and the alternative is `.map_err(|_| ())`, which can be ugly. We don't seem to, but it's good to specifically test for this. r? @yaahallo
💔 Test failed - checks-travis |
@bors r=yaahallo forgot changelog |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 38e7bd2 has been approved by |
Don't nudge people towards toilet closures when producing owl results `.map_err(drop)` should never be linted since sometimes you want to produce `Result<(), ()>` and the alternative is `.map_err(|_| ())`, which can be ugly. We don't seem to, but it's good to specifically test for this. changelog: none r? @yaahallo
☀️ Test successful - checks-travis, status-appveyor |
.map_err(drop)
should never be linted since sometimes you want to produceResult<(), ()>
and the alternative is.map_err(|_| ())
, which can be ugly. We don't seem to, but it's good to specifically test for this.changelog: none
r? @yaahallo