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

internal error: entered unreachable code #474

Closed
nagisa opened this issue May 16, 2016 · 6 comments
Closed

internal error: entered unreachable code #474

nagisa opened this issue May 16, 2016 · 6 comments

Comments

@nagisa
Copy link
Member

nagisa commented May 16, 2016

▪~/.cargo/bin/rustup toolchain add nightly
thread '<main>' panicked at 'internal error: entered unreachable code', src/rustup-cli/rustup_mode.rs:42
stack backtrace:
   1:     0x55f7165d8ed0 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f
   2:     0x55f7165e116b - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac
   3:     0x55f7165e0df3 - std::panicking::default_hook::hc2c969e7453d080c
   4:     0x55f7165c72ef - std::sys_common::unwind::begin_unwind_inner::h30e12d15ce2b2e25
   5:     0x55f716210aff - std::sys_common::unwind::begin_unwind::h65390c63b501d6ed
   6:     0x55f7161f8513 - rustup_init::rustup_mode::main::h904c4ed7acbad99d
   7:     0x55f7161f0665 - rustup_init::run_multirust::h70cbf6663515e18b
   8:     0x55f7161efae1 - rustup_init::main::h81d74e5ca7cf36c2
   9:     0x55f7165e0a34 - std::sys_common::unwind::try::try_fn::h04c0c89e4add6cc4
  10:     0x55f7165d821b - __rust_try
  11:     0x55f7165e047b - std::rt::lang_start::h61f4934e780b4dfc
  12:     0x7f235f9cf740 - __libc_start_main
  13:     0x55f7161ef9d4 - <unknown>
@kbknapp
Copy link
Contributor

kbknapp commented May 16, 2016

I think it's as simple as adding a line directly after this one which contains:

("add", Some(m)) => try!(update(cfg, m)),

@nagisa
Copy link
Member Author

nagisa commented May 16, 2016

@kbknapp the problem here is that user input can trigger a unreachable. Every typo will become an internal error rather than a proper “unknown subcommand: banana.\nnote: did you mean install”

@Diggsey
Copy link
Contributor

Diggsey commented May 16, 2016

@nagisa clap handles command line parsing, so typos will normally be caught earlier. In this case the problem is just that the clap config doesn't match up with the handling code.

@brson
Copy link
Contributor

brson commented May 17, 2016

Ugh, that's like the third of these synonyms I've missed. Should have added tests...

@brson
Copy link
Contributor

brson commented May 17, 2016

#477

alexcrichton added a commit that referenced this issue May 17, 2016
Fix the toolchain command synonyms. Fixes #474
@kbknapp
Copy link
Contributor

kbknapp commented May 17, 2016

@brson or used aliases 😜

Full disclosure, that's a newly implemented feature, so they haven't seen a lot of use. Actually the nicest thing I'm find them for is aliasing tests with test or vice versa...I constantly forget whether or not something is plural and invariably get the message, "did you mean tests?" or which ever one I didn't type! ha!

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

4 participants