Skip to content

ICE related to pointer comparisons #26495

Closed

Description

@whitequark

Repro:

pub trait Widget {}

pub trait Container {
    fn remove(&mut self, widget: &Widget) -> Box<Widget>;
}

pub struct BoxLayout {
    children: Vec<Box<Widget>>,
}

impl Container for BoxLayout {
    fn remove(&mut self, widget: &Widget) -> Box<Widget> {
        let index = self.children.iter().position(|elem| {
            (&**elem as *const _) == (widget as *const _)
        });
        panic!();
    }
}

fn main(){}

Backtrace: unable to acquire; rustc dies with SIGILL inside the unwinder.

Assertion:

thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', src/librustc_trans/trans/datum.rs:634

Activity

  1. mitaa commented on Jun 22, 2015

    @mitaa
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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