Skip to content

Unexpected borrow checker ICE #57989

Closed
Closed
@smikims

Description

@smikims

Error message

Function it was working on when it crashed (apologies, this is in the middle of a refactor so it's a mess; I can provide more context or try to boil it down if needed):

    unsafe fn draw(&self) {
        let color_alg: &Fn(Complex, usize) -> usize = if (self.power - 2.0).abs() < 0.01 {
            &|c, i| self.get_color(c, i)
        } else {
            &|c, i| self.get_color_generic(c, i)
        };
        self.height = if !stdscr.is_null() {
            i32::from((*stdscr)._maxy) + 1i32
        } else {
            -1i32
        };
        self.width = if !stdscr.is_null() {
            i32::from((*stdscr)._maxx) + 1i32
        } else {
            -1i32
        };
        let mut i: i32 = 0i32;
        loop {
            if i >= self.height {
                break;
            }
            let mut j: i32 = 0i32;
            loop {
                if j >= self.width {
                    break;
                }
                if wmove(stdscr, i, j) != -1i32 {
                    waddch(
                        stdscr,
                        usize::from(self.colors[usize::from(color_alg(self.complex_value(i, j), self.iter))]),
                    );
                }
                j += 1;
            }
            i += 1;
        }
        wrefresh(stdscr);
    }

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)A-borrow-checkerArea: The borrow checkerC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️NLL-soundWorking towards the "invalid code does not compile" goalP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions