Skip to content
New issue

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

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

Already on GitHub? # to your account

ICE involving references to dyn* #102429

Closed
Tracked by #102425
eholk opened this issue Sep 28, 2022 · 2 comments · Fixed by #103386
Closed
Tracked by #102425

ICE involving references to dyn* #102429

eholk opened this issue Sep 28, 2022 · 2 comments · Fixed by #103386
Labels
C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eholk
Copy link
Contributor

eholk commented Sep 28, 2022

Example:

#![feature(dyn_star)]
#![allow(incomplete_features)]

trait AddOne {
    fn add1(&mut self) -> usize;
}

impl AddOne for usize {
    fn add1(&mut self) -> usize {
        *self += 1;
        *self
    }
}

fn add_one(i: &mut dyn* AddOne) -> usize {
    i.add1()
}

fn main() {
    let x = 42 as dyn* AddOne;

    println!("{}", add_one(&mut x));
    println!("{}", add_one(&mut x));
}

This fails with the following ICE:

error: internal compiler error: compiler/rustc_trait_selection/src/traits/select/confirmation.rs:1148:18: impossible case reached
@eholk eholk added the F-dyn_star `#![feature(dyn_star)]` label Sep 28, 2022
@eholk
Copy link
Contributor Author

eholk commented Sep 28, 2022

This is probably related to #102172 since they ICE in the same place.

@Rageking8
Copy link
Contributor

@rustbot label +C-bug +I-ICE +requires-nightly +T-compiler

@rustbot rustbot added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2022
@bors bors closed this as completed in 741f3cf Nov 18, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants