Skip to content
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

&dyn* causes an ICE #102172

Closed
Tracked by #102425
DutchGhost opened this issue Sep 23, 2022 · 3 comments · Fixed by #103386
Closed
Tracked by #102425

&dyn* causes an ICE #102172

DutchGhost opened this issue Sep 23, 2022 · 3 comments · Fixed by #103386
Labels
C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` glacier ICE tracked in rust-lang/glacier. 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

@DutchGhost
Copy link
Contributor

Code

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

use core::fmt::Debug;

fn main() {
    let i = 42 as &dyn* Debug;
}

Meta

rustc --version --verbose:

rustc 1.66.0-nightly (e7119a030 2022-09-22)

Error output

[<output>](error: internal compiler error: compiler/rustc_trait_selection/src/traits/select/confirmation.rs:1147:18: impossible case reached)
Backtrace

@DutchGhost DutchGhost added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 23, 2022
@crlf0710 crlf0710 added F-dyn_star `#![feature(dyn_star)]` requires-nightly This issue requires a nightly compiler in some way. labels Sep 23, 2022
@eholk
Copy link
Contributor

eholk commented Sep 28, 2022

This looks like it should be a type error. The versions that should work are let i = 42 as dyn* Debug; and let i = &(42 as dyn* Debug);, and possibly let i = &42 as &dyn* Debug;. But, we definitely need a more helpful message than an ICE.

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 1, 2022
@dwrensha
Copy link
Contributor

including the (unsurprising) output of cargo-bisect-rustc for completness...


searched nightlies: from nightly-2021-02-10 to nightly-2022-10-05
regressed nightly: nightly-2022-09-15
searched commit range: 17cbdfd...750bd1a
regressed commit: 6153d3c

bisected with cargo-bisect-rustc v0.6.4

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --end=2022-10-05 --regress ice 

@Rageking8
Copy link
Contributor

Another example to produce the same ICE

trait Trait {}

fn main() {
    let i = Box::new(1) as Box<dyn* Trait>;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-dyn_star `#![feature(dyn_star)]` glacier ICE tracked in rust-lang/glacier. 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.

6 participants