Skip to content

ICE when transmuting into a static #15801

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
expipiplus1 opened this issue Jul 19, 2014 · 3 comments
Closed

ICE when transmuting into a static #15801

expipiplus1 opened this issue Jul 19, 2014 · 3 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@expipiplus1
Copy link

#![no_main]
extern crate core;
use core::intrinsics::transmute;
static screen: &'static [u16, ..1] = unsafe{transmute(0x6000000 as *mut [u16, ..1])};
$ rustc --version
rustc 0.11.0-nightly (b57d272e9908e164a72bd1a688141031705e1208 2014-07-11 01:11:36 +0000)
$ rustc a.rs
error: internal compiler error: node_id_to_type: no type for node `expr 1 (id=23)`
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', C:\bot\slave\nightly-win\build\src\libsyntax\diagnostic.rs:168

stack backtrace:
   1: 0x6a181c14
   2: 0x61f889ec
   3:   0x63aeca
   4:   0x63b885
   5: 0x70f18426
   6: 0x70f81133
   7: 0x7139e1b2
   8: 0x7139d9fa
   9: 0x7139dc2b
  10: 0x7139fe25
  11: 0x7139e2d1
  12: 0x7139fcfb
  13: 0x7139e2d1
  14: 0x7139f3da
  15: 0x7139e2d1
  16: 0x7139e4df
  17: 0x7139d629
  18: 0x7178d694
  19: 0x71710ace
  20: 0x7170c07f
  21: 0x717b2467
  22: 0x717af84d
  23: 0x717c1e7e
  24: 0x717c1d9c
  25: 0x70c301e8
  26: 0x61f88295
  27: 0x61f85d6a
  28: 0x70c30087
  29: 0x61f87def
  30: 0x76f9a22b
@emberian emberian added I-crash and removed I-crash labels Jul 19, 2014
@luqmana
Copy link
Member

luqmana commented Jul 19, 2014

While this shouldn't ICE, calling transmute and other such intrinsics in statics is a separate issue. (#6320 is somewhat relevant).

@mahkoh
Copy link
Contributor

mahkoh commented Sep 23, 2014

This has been fixed by disallowing function calls in constant expressions.

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 21, 2014
@ghost
Copy link

ghost commented Oct 25, 2014

@mahkoh You're right, closing.

@ghost ghost closed this as completed Oct 25, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants