Incorrect use of unreachable!() #68

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

Comments

Projects
None yet
3 participants
@dtolnay

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 brson referenced this issue Mar 4, 2017

Closed

Library evaluation tracking issue #76

7 of 7 tasks complete

brson added a commit to brson/byteorder that referenced this issue Mar 4, 2017

@frewsxcv

This comment has been minimized.

Show comment
Hide comment
@frewsxcv

frewsxcv Mar 10, 2017

Why does this Default implementation need to exist?

Why does this Default implementation need to exist?

@BurntSushi

This comment has been minimized.

Show comment
Hide comment
@BurntSushi

BurntSushi Mar 10, 2017

Owner

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

Owner

BurntSushi commented Mar 10, 2017

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

@clarcharr clarcharr referenced this issue in rust-lang-nursery/rust-clippy Mar 20, 2017

Open

Lint for unconditional unreachable!() #1632

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