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* ICE primitive read not possible for type: [i32; 4] #102173

Closed
Tracked by #102425
DutchGhost opened this issue Sep 23, 2022 · 1 comment · Fixed by #104338
Closed
Tracked by #102425

dyn* ICE primitive read not possible for type: [i32; 4] #102173

DutchGhost opened this issue Sep 23, 2022 · 1 comment · Fixed by #104338
Assignees
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 = [1, 2, 3, 4] as dyn* Debug;
    
    dbg!(i);
}

Meta

rustc --version --verbose:

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

Error output

[<output>](error: internal compiler error: /rustc/e7119a0300b87a3d670408ee8e847c6821b3ae80/compiler/rustc_const_eval/src/interpret/operand.rs:390:13: primitive read not possible for type: [i32; 4])
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
@DutchGhost DutchGhost changed the title dyn* ICE dyn* ICE primitive read not possible for type: [i32; 4] Sep 23, 2022
@crlf0710 crlf0710 added the F-dyn_star `#![feature(dyn_star)]` label Sep 23, 2022
@inquisitivecrystal inquisitivecrystal added the requires-nightly This issue requires a nightly compiler in some way. label Sep 24, 2022
@eholk
Copy link
Contributor

eholk commented Sep 28, 2022

Thanks for the report!

This test case should not compile because only things that are pointer sized can be converted to dyn*. But, we definitely need a proper error message rather than an ICE.

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 1, 2022
@TaKO8Ki TaKO8Ki self-assigned this Oct 2, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2022
…holk

Enforce that `dyn*` coercions are actually pointer-sized

Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.

This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.

r? `@eholk` cc `@tmandry` (though feel free to claim/reassign)

Fixes rust-lang#102141
Fixes rust-lang#102173
Manishearth added a commit to Manishearth/rust that referenced this issue Nov 18, 2022
…holk

Enforce that `dyn*` coercions are actually pointer-sized

Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.

This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.

r? `@eholk` cc `@tmandry` (though feel free to claim/reassign)

Fixes rust-lang#102141
Fixes rust-lang#102173
Manishearth added a commit to Manishearth/rust that referenced this issue Nov 18, 2022
…holk

Enforce that `dyn*` coercions are actually pointer-sized

Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.

This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.

r? ``@eholk`` cc ``@tmandry`` (though feel free to claim/reassign)

Fixes rust-lang#102141
Fixes rust-lang#102173
@bors bors closed this as completed in 24ee599 Nov 19, 2022
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