Skip to content

ICE with compound assignment and Drop::finalize #5959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
euphoris opened this issue Apr 19, 2013 · 1 comment
Closed

ICE with compound assignment and Drop::finalize #5959

euphoris opened this issue Apr 19, 2013 · 1 comment
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@euphoris
Copy link

struct matrix;

impl Drop for matrix {
    fn finalize(&self) {}
}

impl Add<matrix, matrix> for matrix {
    fn add(&self, _rhs: &matrix) -> matrix{
        matrix
    }
}

fn main(){
    let mut m = matrix;
    m += matrix; // an ICE is occured
    //m = m + matrix; // not occured
    info!(m);
}

rustc shows the following error messages:

$ RUST_LOG=rustc=1,::rt::backtrace rustc ice.rs
rust: task failed at 'assertion failed: !bcx.ccx().maps.moves_map.contains(&arg_expr.id)', *****/rust-0.6/src/librustc/middle/trans/callee.rs:705
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', *****/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7fc2a0818e10 root task failed
@Aatch
Copy link
Contributor

Aatch commented Jun 20, 2013

Dupe of #6609

@Aatch Aatch closed this as completed Jun 20, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 10, 2020
Avoid firing the lint when `transmute` in const contexts
as dereferencing raw pointers in consts is unstable. cc rust-lang#5959
flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 10, 2020
…in_consts, r=ebroto

Fix a fp in `transmute_ptr_to_ptr`

fixes rust-lang#5959

changelog: Fix a false positive in `transmute_ptr_to_ptr` that the lint fires when `transmute` is used to cast a reference in const contexts although dereferencing raw pointers in consts is unstable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-destructors Area: Destructors (`Drop`, …) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants