Skip to content
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

Incorrect use of unreachable!() #68

Closed
dtolnay opened this issue Feb 25, 2017 · 2 comments
Closed

Incorrect use of unreachable!() #68

dtolnay opened this issue Feb 25, 2017 · 2 comments

Comments

@dtolnay
Copy link

dtolnay commented Feb 25, 2017

extern crate byteorder;

fn main() {
    byteorder::LittleEndian::default();
}
thread 'main' panicked at 'internal error: entered unreachable code'

Unreachable doesn't mean "please don't call this," it means "you can't get here." I think it is okay for this method to panic but it should be something other than unreachable. A handwritten message explaining why this method exists would be nice.

cc @fitzgen

brson added a commit to brson/byteorder that referenced this issue Mar 4, 2017
@frewsxcv
Copy link

Why does this Default implementation need to exist?

@BurntSushi
Copy link
Owner

@frewsxcv So that it works with derive seamlessly. See #52.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants