Closed
Description
My source file contains just this:
pub fn has_digit(s: &str) -> bool {
s.contains(char::is_digit)
}
Running rustc lib.rs
results in this error:
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.25.0-nightly (3d292b793 2018-02-03) running on x86_64-apple-darwin
My Rust version is:
rustc 1.25.0-nightly (3d292b793 2018-02-03)
binary: rustc
commit-hash: 3d292b793ade0c1c9098fb32586033d79f6e9969
commit-date: 2018-02-03
host: x86_64-apple-darwin
release: 1.25.0-nightly
LLVM version: 4.0
Backtrace:
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic
6: std::panicking::begin_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::panicking::panic
10: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_selection_error
11: rustc::traits::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_fulfillment_errors
12: rustc_typeck::check::FnCtxt::select_obligations_where_possible
13: rustc_typeck::check::FnCtxt::check_argument_types
14: rustc_typeck::check::FnCtxt::check_method_argument_types
15: rustc_typeck::check::FnCtxt::check_expr_kind
16: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
17: rustc_typeck::check::FnCtxt::check_block_with_expected
18: rustc_typeck::check::FnCtxt::check_expr_kind
19: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
20: rustc_typeck::check::FnCtxt::check_return_expr
21: rustc_typeck::check::check_fn
22: <std::thread::local::LocalKey<T>>::with
23: rustc::ty::context::GlobalCtxt::enter_local
24: rustc_typeck::check::typeck_tables_of
25: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::compute_result
26: rustc::dep_graph::graph::DepGraph::with_task_impl
27: rustc_errors::Handler::track_diagnostics
28: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
29: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::force
30: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
31: rustc::ty::maps::TyCtxtAt::typeck_tables_of
32: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::ensure
33: rustc::session::Session::track_errors
34: rustc_typeck::check::typeck_item_bodies
35: rustc::dep_graph::graph::DepGraph::with_task_impl
36: rustc_errors::Handler::track_diagnostics
37: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
38: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::force
39: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
40: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
41: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
42: rustc_typeck::check_crate
43: <std::thread::local::LocalKey<T>>::with
44: <std::thread::local::LocalKey<T>>::with
45: rustc::ty::context::TyCtxt::create_and_enter
46: rustc_driver::driver::compile_input
47: rustc_driver::run_compiler