Skip to content

internal compiler error with a unknown value in a slice #28670

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
adjivas opened this issue Sep 26, 2015 · 0 comments
Closed

internal compiler error with a unknown value in a slice #28670

adjivas opened this issue Sep 26, 2015 · 0 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@adjivas
Copy link

adjivas commented Sep 26, 2015

struct with unknow value from enum in slice variable

I tried this code:

#[repr(C)]
#[derive(Copy, Clone)]
pub enum Ipc {
  CREAT = 0o0001000, // POSIX
  NOWAIT = 2048, // POSIX
}

pub struct MsgBuf {
  pub mtype: u32,
  pub mtext: [u8; Ipc::MSG_BUFF as usize], // <- The error is Ipc::MSG_BUFF, this variable not exist.
}

fn main() {
}

I expected to see this happen:

error: unresolved name `MSG_BUFF`

Instead, this happened:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }Ipc, true), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:80


playpen: application terminated with error code 101
@adjivas adjivas changed the title internal compiler error with a unknow value inside a slice internal compiler error with a unknown value in a slice Sep 26, 2015
@sfackler sfackler added A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Sep 26, 2015
eefriedman added a commit to eefriedman/rust that referenced this issue Sep 30, 2015
The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

Fixes rust-lang#28670, and probably a bunch of duplicates.
steveklabnik added a commit to steveklabnik/rust that referenced this issue Oct 1, 2015
…=nikomatsakis

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes rust-lang#28670, and probably a bunch of duplicates.
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 2, 2015
…=nikomatsakis

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes rust-lang#28670, and probably a bunch of duplicates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants