Skip to content

ICE when deriving cmp::Eq of struct with ~str #3935

Closed
@burg

Description

@burg

(Note: it seems that deriving cmp::Eq for an enum with symbolic variants seems to work)

Test

struct Bike {
    name: ~str,
}

pub impl Bike : cmp::Eq;

pub fn main() {
    let town_bike = Bike { name: ~"schwinn" };
    let my_bike = Bike { name: ~"surly" };

    assert town_bike != my_bike;
}

Backtrace 1 (from this test)

(gdb) bt
#0  upcall_fail (expr=0x105b787e0 "Key not found in table: 38736", file=0x100db2d40 "/Users/burg/repos/rust/src/rustc/rustc.rc", line=0x1) at rust_upcall.cpp:94
#1  0x00000001008534e8 in map::chained::__extensions__::get_27747::_20e28ebb31b7de::_05 ()
#2  0x0000000100761e82 in middle::trans::base::get_item_val::_8391fa755d7b731d::_05 ()
#3  0x0000000100d21a00 in __morestack ()
Previous frame inner to this frame (gdb could not unwind past this frame)

Backtrace 2 (from more complicated example)

#0  upcall_fail (expr=0x10ae2e860 "Key not found in table: 30260", file=0x100db2d40 "/Users/burg/repos/rust/src/rustc/rustc.rc", line=0x1) at rust_upcall.cpp:94
#1  0x00000001008534e8 in map::chained::__extensions__::get_27747::_20e28ebb31b7de::_05 ()
#2  0x0000000100761e82 in middle::trans::base::get_item_val::_8391fa755d7b731d::_05 ()
#3  0x00000001008ff801 in middle::trans::deriving::call_substructure_method::_ff7dfc864717a7e::_05 ()
#4  0x00000001008fd6f8 in middle::trans::deriving::trans_deriving_impl::anon::expr_fn_35402 ()
#5  0x0000000100d21a00 in __morestack ()
#6  0x00000001008fce5c in middle::trans::deriving::trans_deriving_impl::anon::expr_fn_35402 ()
#7  0x00000001007606e3 in middle::trans::base::trans_item::_fb129732743cd352::_05 ()
#8  0x000000010087839f in middle::trans::base::trans_mod::_c857e65e1f67e20::_05 ()
#9  0x0000000100760528 in middle::trans::base::trans_item::_fb129732743cd352::_05 ()
#10 0x000000010087839f in middle::trans::base::trans_mod::_c857e65e1f67e20::_05 ()
#11 0x0000000100760528 in middle::trans::base::trans_item::_fb129732743cd352::_05 ()
#12 0x000000010087839f in middle::trans::base::trans_mod::_c857e65e1f67e20::_05 ()
#13 0x000000010089230f in middle::trans::base::trans_crate::_198c69be1a4c551::_05 ()
#14 0x0000000100cf52cc in driver::driver::compile_upto::_91c8e6e3e6c75b99::_05 ()
#15 0x0000000100d21a00 in __morestack ()
Previous frame inner to this frame (gdb could not unwind past this frame)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions