You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and once I want to compile and run the test with cargo test I get the following error from the compiler:
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: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'assertion failed: (left == right) (left: 3, right: 1)', ../src/librustc/middle/check_match.rs:1051
note: Run with RUST_BACKTRACE=1 for a backtrace.
I guess that has to do with the destructuring here:
I would like to confirm that, after upgrading to the latest nightly (rustc 1.9.0-nightly (eabfc16 2016-03-08)), the compiler states:
src/main.rs:52:6: 52:34 error: refutable pattern in local binding: Integer(_) not covered [E0005]
src/main.rs:52 let DefinitionResult::String(v1) = super::read(&toml, "table1.key1", "String");
Hello,
I would like to report an issue, after the compiler prompted me to do so.
I am using toml-rs to get some configuration data, so I have a function like the following:
With
DefinitionResult
being an enum:I have created a Unit test like the following:
and once I want to compile and run the test with
cargo test
I get the following error from the compiler:I guess that has to do with the destructuring here:
DefinitionResult::String(v1) = super::read(&toml, "table1.key1", "String")
To be honest I am not sure if destructuring an enum like that using
let
is supported anyway.If I re-write the destructure like:
everything works great.
Thank you!
Meta
rustc --version --verbose:
rustc 1.8.0-nightly (c8fc481 2016-02-22)
binary: rustc
commit-hash: c8fc481
commit-date: 2016-02-22
host: x86_64-unknown-linux-gnu
release: 1.8.0-nightly
stack backtrace:
1: 0x7fea61f9f340 - sys::backtrace::tracing:: imp::write::h2bb24970c1600d4fNyu$u7b$ $u7b$closure$u7d$$u7d$::closure.28446
2: 0x7fea61fa86ab - panicking::default_handler::$u7b$$u7b$closure$u7d$$u7d$::closure.43727
3: 0x7fea61fa8203 - panicking::default_handler::hb760707c7feda3cdbez
4: 0x7fea61f70d7c - sys_common::unwind::begin_unwind_inner::h78583c314295e3926mt
5: 0x7fea61f71818 - sys_common::unwind::begin_unwind_fmt::h903be369b05a3ccccmt
6: 0x7fea5f2811d8 - middle::check_match::check_irrefutable::h8d1ba0bed3fbea2aQ4j
7: 0x7fea5f251f42 - middle::check_match::check_local::h2d216d4e5ead2573K2j
8: 0x7fea5f252197 - middle::check_match::check_fn::h082db3cfa9cb9bc8A3j
9: 0x7fea5f252901 - middle::check_match::check_crate::hc28c1fe732f94679kSi
10: 0x7fea624c142e - driver::phase_3_run_analysis_passes::
11: 0x7fea624be1e5 - middle::ty::context::ctxt<'tcx>::create_and_enter::h6911830796927350595
12: 0x7fea624bad3f - driver::phase_3_run_analysis_passes::h10607465921210735652
13: 0x7fea6248c5b5 - driver::compile_input::h9417f7071f41b0b1Bca
14: 0x7fea6247c907 - run_compiler::h1d04446f72d95b52HOc
15: 0x7fea6247a0b1 - sys_common::unwind::try::try_fn::h2224149726337910613
16: 0x7fea61f9cd9b - __rust_try
17: 0x7fea61f9534d - sys_common::unwind::inner_try::hdfdf33e7068c9cb28jt
18: 0x7fea6247a900 - boxed::F.FnBox::call_box::h8331008289514682961
19: 0x7fea61fa6c79 - sys::thread::Thread:: new::thread_start::h1272204999bddc95vby
20: 0x7fea5a735423 - start_thread
21: 0x7fea61c25cbc - clone
22: 0x0 -
The text was updated successfully, but these errors were encountered: