foo.unwrap_or(panic!(…)) #19

Open
P1start opened this Issue Dec 1, 2014 · 2 comments

Comments

Projects
None yet
4 participants
@P1start

P1start commented Dec 1, 2014

This should either be .expect() or .unwrap_or_else(|| panic!()) (if they want the formatting panic provides). Ideally this would be generalised to any diverging function (fn(…) -> !) as well.

@lfairy

This comment has been minimized.

Show comment
Hide comment
@lfairy

lfairy May 3, 2015

Note that macro expansion runs before type checking runs before lints, so we'll need to match against std::rt::begin_unwind and friends instead.

lfairy commented May 3, 2015

Note that macro expansion runs before type checking runs before lints, so we'll need to match against std::rt::begin_unwind and friends instead.

@llogiq

This comment has been minimized.

Show comment
Hide comment
@llogiq

llogiq May 3, 2015

Collaborator

Similarly, one can implement a lot of Option's API in terms of itself. A number of hints to use the right one will certainly be helpful for a number of people.

Collaborator

llogiq commented May 3, 2015

Similarly, one can implement a lot of Option's API in terms of itself. A number of hints to use the right one will certainly be helpful for a number of people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment