Skip to content

error: mismatched type -> internal compiler error: unexpected failure #13466

Closed
@ghost

Description

rustc 0.11-pre-nightly
host: i686-pc-mingw32

(04/11/2014)

note: only caused by wrong code, using url::from_str instead of url::Url::from_str trying to match Result

extern crate url;

use url::Url;

static URL_STR : &'static str = "rtmp://rtmp.jim.stream.vmmacdn.be/vmma-jim-rtmplive-live/jim";

pub fn main() {
  let url : Url = match from_str(URL_STR) {
    Ok(u) => { u },
    Err(e) => { fail!(e) }
  };
}

C:\Workspace\Rust\rtmp>rustc rtmp.rs
rtmp.rs:14:3: 14:8 error: mismatched types: expected `std::option::Option<<gener
ic #9>>` but found `std::result::Result<<generic #10>,<generic #11>>` (expected
enum std::option::Option but found enum std::result::Result)
rtmp.rs:14              Ok(u) => { u },
                        ^~~~~
rtmp.rs:15:3: 15:9 error: mismatched types: expected `std::option::Option<<gener
ic #9>>` but found `std::result::Result<<generic #12>,<generic #13>>` (expected
enum std::option::Option but found enum std::result::Result)
rtmp.rs:15              Err(e) => { fail!(e) }
                        ^~~~~~
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/c
omplement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 1', C
:\bot\slave\nightly-win\build\src\librustc\lib.rs:1

(gdb) backtrace
#0  0x01a5eda0 in rust_fail ()
#1  0x01a5ed86 in rt::unwind::Unwinder::begin_unwind::hb99b9930de05a957o89::v0.11.pre ()
#2  0x019cd67c in rt::unwind::begin_unwind_inner::hb85dcf0cebc737adBja::v0.11.pre ()
#3  0x019cc81b in rt::unwind::begin_unwind::h188e758c53cd36c0bja::v0.11.pre ()
#4  0x01a5ef5d in rt::unwind::begin_unwind_raw::h360336aeed85ca76Kga::v0.11.pre ()
#5  0x019cbae8 in rt::unwind::fail_::h18214f1fb3961c4aoea::v0.11.pre ()
#6  0x01a5ef9e in rt::unwind::fail_bounds_check::closure.40110 ()
#7  0x019cdb48 in rt::unwind::fail_bounds_check::h9caa8f8cd6799ebfLea::v0.11.pre ()
#8  0x0065e9bd in middle::typeck::check::vtable::lookup_vtables_for_param::closure.65591 ()
#9  0x005a5b5e in middle::ty::each_bound_trait_and_supertraits::hce56f0e9060079a2p9P::v0.11.pre ()
#10 0x0065daa2 in middle::typeck::check::vtable::lookup_vtables_for_param::h9615e1ef447a395aIW0::v0.11.pre ()
#11 0x0065c85a in middle::typeck::check::vtable::lookup_vtables::hf61f6da2c2cbb5564L0::v0.11.pre ()
#12 0x00668878 in middle::typeck::check::vtable::early_resolve_expr::closure.65740 ()
#13 0x006682a8 in middle::typeck::check::FnCtxt$LT$$x27a$GT$::opt_node_ty_substs::h74ecc5ed8975d730gR8::v0.11.pre ()
#14 0x006668a2 in middle::typeck::check::vtable::early_resolve_expr::h1f5d125d2b0415daJC1::v0.11.pre ()
#15 0x006e9776 in middle::typeck::check::check_expr_with_unifier::check_argument_types::hd08d5daaac11b9a1uz9::v0.11.pre ()
#16 0x006e4376 in middle::typeck::check::check_expr_with_unifier::h7b2b775cbc9c3690sv9::v0.11.pre ()
#17 0x006c25ae in middle::typeck::check::check_block_with_expected::hb65c5825c311effdxQb::v0.11.pre ()
#18 0x006e0ef6 in middle::typeck::check::check_expr_with_unifier::h7b2b775cbc9c3690sv9::v0.11.pre ()
#19 0x0064f1bc in middle::typeck::check::_match::check_match::hfe66e5f41fa7611aFHZ::v0.11.pre ()
#20 0x006e0d6f in middle::typeck::check::check_expr_with_unifier::h7b2b775cbc9c3690sv9::v0.11.pre ()
#21 0x006fad26 in middle::typeck::check::check_decl_local::h264e53a44c6d8128EKb::v0.11.pre ()
#22 0x006fafe4 in middle::typeck::check::check_stmt::h1d228fe011010403AMb::v0.11.pre ()
#23 0x006c2387 in middle::typeck::check::check_block_with_expected::hb65c5825c311effdxQb::v0.11.pre ()
#24 0x006be4fd in middle::typeck::check::check_fn::hbcd7f63560b4275d3y7::v0.11.pre ()
#25 0x006bdd52 in middle::typeck::check::check_bare_fn::h8e63a3f4b4b63bfeVo7::v0.11.pre ()
#26 0x006b9a11 in middle::typeck::check::check_item::h3a16ad723ea326d53G7::v0.11.pre ()
#27 0x006bdbcd in middle::typeck::check::check_item_types::h5e90e02b5a637cdavo7::v0.11.pre ()
#28 0x007ea1f4 in middle::typeck::check_crate::closure.70991 ()
#29 0x007e9c3d in util::common::time::h4eece2a91c4048898Pg::v0.11.pre ()
#30 0x007e8aff in middle::typeck::check_crate::hf238aaa1a94571ef0bu::v0.11.pre
    ()
#31 0x00bb8f45 in driver::driver::phase_3_run_analysis_passes::h83472ccecfdcc978GCe::v0.11.pre ()
#32 0x00bbfc12 in driver::driver::compile_input::hda7d83b4f81d42b9D1e::v0.11.pre ()
#33 0x00be34c4 in run_compiler::hcafaeca05b1b783eIxm::v0.11.pre ()
#34 0x00bf5267 in main_args::closure.92185 ()
#35 0x00bf3c69 in monitor::closure.92070 ()
#36 0x00befefe in task::TaskBuilder::try::closure.91842 ()
#37 0x004274b3 in task::spawn_opts::closure.7691 ()
#38 0x01a5acac in rt::task::Task::run::closure.40013 ()
#39 0x01a5ed05 in rt::unwind::Unwinder::try::try_fn::he27cd916ec604645k79::v0.11.pre ()
#40 0x01a66016 in rust_try ()
#41 0x01a5ab84 in rt::task::Task::run::hd417a7b2504dfe98eA8::v0.11.pre ()
#42 0x00427360 in task::spawn_opts::closure.7664 ()
#43 0x01a5e0ed in rt::thread::thread_start::h63560cc2549b235dWe9::v0.11.pre ()
#44 0x77601793 in KERNEL32!BaseThreadInitThunk ()
   from C:\Windows\system32\kernel32.dll
#45 0x77dfc206 in ?? ()
#46 0x77dfc1df in ?? ()
#47 0x00000000 in ?? ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions