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

Compiler error: can't dereference const of type [int, .. 5] (fails in ast_util.rs:776) #16815

Closed
mitchmindtree opened this issue Aug 28, 2014 · 6 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mitchmindtree
Copy link
Contributor

I came across this just now when updating a large personal project to the latest nightly - The project seems to begin compiling successfully (it starts showing warnings) and then this occurs towards the end of the build:

error: internal compiler error: can't dereference const of type [int, .. 5]                        
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>', /Users/Mitch/Programming/Rust/rust/src/libsyntax/ast_util.rs:776

(I just checked master as well and it gives the same error)

@alexcrichton
Copy link
Member

Can you provide the code to reproduce this as well?

@mitchmindtree
Copy link
Contributor Author

@alexcrichton I'd love to! The project is 100+ files though and I'm unsure how to debug this kind of error with rustc - is there a way to pass RUST_BACKTRACE=1 through cargo? Would that help?

@alexcrichton
Copy link
Member

Do you have a repository that can reproduce this that we could look at?

@mitchmindtree
Copy link
Contributor Author

Sorry I'm afraid I don't! Do you have any tips for diving into debugging myself?

@ebfe
Copy link
Contributor

ebfe commented Aug 30, 2014

This looks similar:

$ cat t.rs

pub static x : [&'static [u8], ..2] = [
    [ 0x00 ],
    [ 0x01, 0x02],
];

fn main() {
}

$ rustc t.rs

error: internal compiler error: can't dereference const of type [u8, .. 1]
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>', /build/rust-git/src/rust/src/libsyntax/ast_util.rs:784

stack backtrace:
   1:     0x7f9fe6a621c0 - rt::backtrace::imp::write::hc06a9af3428b6402OLq
   2:     0x7f9fe6a653b0 - <unknown>
   3:     0x7f9fe7234c60 - unwind::begin_unwind_inner::h52e356952ae73580rje
   4:     0x7f9fe2f24920 - <unknown>
   5:     0x7f9fe2f25290 - diagnostic::Handler::bug::h9a4b58260c6eb84bCdF
   6:     0x7f9fe7620b00 - driver::session::Session::bug::h38b87ec2c07879e1U5C
   7:     0x7f9fe7a59330 - <unknown>
   8:     0x7f9fe7a57c80 - middle::trans::consts::const_expr::hfc3059cbac1ab05aIh8
   9:     0x7f9fe7a5a020 - <unknown>
  10:     0x7f9fe7a57c80 - middle::trans::consts::const_expr::hfc3059cbac1ab05aIh8
  11:     0x7f9fe79c5d20 - middle::trans::base::get_item_val::hfac7a156b8d0ce26Fxf
  12:     0x7f9fe7a59d20 - middle::trans::consts::trans_const::h395a96c97daf2b75C38
  13:     0x7f9fe79c2e40 - middle::trans::base::trans_item::hcb03a26de1f1e4a1n4e
  14:     0x7f9fe7a97e60 - middle::trans::base::trans_crate::h2bfac95542704ddfOYf
  15:     0x7f9fe7ecc6f0 - driver::driver::phase_4_translate_to_llvm::h112e0d5721d56638XHB
  16:     0x7f9fe7ec3f10 - driver::driver::compile_input::hc29a8cb80fd73a2b5jB
  17:     0x7f9fe7f57bb0 - <unknown>
  18:     0x7f9fe7f57ac0 - <unknown>
  19:     0x7f9fe7f6c0e0 - <unknown>
  20:     0x7f9fe7f6bee0 - <unknown>
  21:     0x7f9fe89d3880 - <unknown>
  22:     0x7f9fe7286f10 - <unknown>
  23:     0x7f9fe7286f00 - rust_try
  24:     0x7f9fe7232210 - unwind::try::hd6d9d0484638c05fH7d
  25:     0x7f9fe7231fb0 - task::Task::run::hc0937059e11808beNdd
  26:     0x7f9fe89d35e0 - <unknown>
  27:     0x7f9fe7233e50 - <unknown>
  28:     0x7f9fe64f5060 - start_thread
  29:     0x7f9fe6f01489 - __clone
  30:                0x0 - <unknown>

@mitchmindtree
Copy link
Contributor Author

After updating to the latest master I no longer have this problem, closing.

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 17, 2024
…r=lnicola

fix: Don't auto-close block comments in strings

Fixes rust-lang#16815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants