Change:
I am new to rust so perhaps I am doing something wrong in the initialization of my struct. I am trying to initialize a winapi::tlhelp32::PROCESSENTRY32 struct the following way: let mut pe32 = tlhelp32::PROCESSENTRY32{ dwSize: mem::sizeof::&lt;tlhelp32::PROCESSENTRY32() as u32, cntUsage: -1, th32ProcessID: -1, th32DefaultHeapID: -1, th32ModuleID: -1, cntThreads: -1, th32ParentProcessID: -1, pcPriClassBase: -1, dwFlags: -1, szExeFile: [char; 260] }; However, I receive the following compilation error: error: internal compiler error: ../src/librustctypeck unexpected definition: PrimTy(TyChar) note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: note: run with for a backtrace thread 'rustc' panicked at 'Box&lt;Any', stack backtrace: 0: 0x7fffe44b02ea - std::panicking::Location::line::h9363ce800e842170 1: 0x7fffe44af774 - std::panicking::Location::line::h9363ce800e842170 2: 0x7fffe44b31cd - std::panicking::rustpanicwithhook::hc790e47d4ecc86cd 3: 0x7fffe2992670 - &lt;unknown4: 0x7fffe29ab09e - rustcerrors::Handler::bug::h620f7270292f0095 5: 0x7fffd7805e25 - rustc::session::bugfmt::he2d2f00a4afa9d1e 6: 0x7fffd7805c5a - rustc::session::bugfmt::he2d2f00a4afa9d1e 7: 0x7fffd78053cc - rustc::session::bugfmt::he2d2f00a4afa9d1e 8: 0x7fffd8af9d1a - rustctypeck::check::FnCtxt::instantiatevaluepath::h4229ac945aebfa55 9: 0x7fffd8ae4356 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 10: 0x7fffd8ae2d81 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 11: 0x7fffd8ae3204 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 12: 0x7fffd8ae2d81 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 13: 0x7fffd8ae0485 - rustctypeck::check::FnCtxt::implselfty::h097381977b228682 14: 0x7fffd8ae5dd2 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 15: 0x7fffd8ae2d81 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 16: 0x7fffd8af7cef - rustctypeck::check::FnCtxt::checkdeclinitializer::h43ea4d26b2a62ae8 17: 0x7fffd8af7e3b - rustctypeck::check::FnCtxt::checkdecllocal::h15d42ee7f4d79e8d 18: 0x7fffd8af8187 - rustctypeck::check::FnCtxt::checkstmt::h155d968e61fdfae6 19: 0x7fffd8af84be - rustctypeck::check::FnCtxt::checkblocknovalue::h3ac235dc3eaa76c3 20: 0x7fffd8ae326e - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 21: 0x7fffd8ae2d81 - rustctypeck::check::FnCtxt::checkstructpath::h1ff2872963f8985c 22: 0x7fffd8ac2c1d - &lt;rustctypeck::coherence::orphan::OrphanChecker&lt;'cx, 'tcxas rustc::hir::itemlikevisit::ItemLikeVisitor&lt;'v::visitimplitem::habbc901b4cfa4531 23: 0x7fffd8ac0f57 - rustctypeck::check::checkdropimpls::hb6e6926f4342f9e2 24: 0x7fffd8ac52e1 - rustctypeck::check::checkitembody::h1e039ede2f960fb9 25: 0x7fffd8abdbbd - rustctypeck::check::checkitembodies::hd22adb7703cc56d7 26: 0x7fffd8b4a500 - rustctypeck::checkcrate::h92f6bdfe03b6afba 27: 0x7fffe4b1c98e - rustcdriver::driver::countnodes::h84f03318ea2320a8 28: 0x7fffe4a75bcf - &lt;unknown29: 0x7fffe4af8932 - rustcdriver::driver::compileinput::h8e119234b60571d5 30: 0x7fffe4b49f27 - rustcdriver::runcompiler::h57c4f233cd1a0c04 31: 0x7fffe4a2da1e - &lt;unknown32: 0x7fffe44b5bf1 - rustmaybecatchpanic 33: 0x7fffe4a57794 - &lt;unknown34: 0x7fffe44ad86e - std::sys::imp::thread::Thread::new::hd990f5dcc0d4bad9 35: 0x7ff819858363 - BaseThreadInitThunk My rust compiler version is: rustc 1.15.0-nightly ( 2016-12-05) binary: rustc commit-hash: commit-date: 2016-12-05 host: x8664-pc-windows-msvc release: 1.15.0-nightly LLVM version: 3.9 Thank you.
This is a bug, it affects only 1.15 nightly, and it's already fixed in , but the fix is not merged yet. The error is here - , this code uses type as an initialization value for the array elements, it needs to use some value instead, e.g. . Duplicate of (It's an off-topic, but you should probably prefer to , Rust doesn't have good support for legacy encodings from the box and prefers Unicode when interacting with WinAPI. In this case will have type )
Closing as a duplicate, thanks!

Discussion:
} } <del> #[derive(Copy, Clone)] </del> <ins> #[derive(Copy, Clone, PartialEq)] </ins> enum PathScope { Global, Lexical,

// // Such behavior is required for backward compatibility. // The same fallback is used when `a` resolves to nothing. <del> _ if self.primitive_type_table.primitive_types.contains_key(&path[0].name) => { </del> <ins> PathResult::Module(..) | PathResult::Failed(..) if scope == PathScope::Lexical && (ns == TypeNS || path.len() > 1) && self.primitive_type_table.primitive_types.contains_key(&path[0].name) => { </ins> PathResolution { base_def: Def::PrimTy(self.primitive_type_table.primitive_types[&path[0].name]), depth: segments.len() - 1,

<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { // Make sure primitive type fallback doesn't work in value namespace std::mem::size_of(u16); //~^ ERROR unresolved name `u16` //~| ERROR this function takes 0 parameters but 1 parameter was supplied // Make sure primitive type fallback doesn't work with global paths let _: ::u8; //~^ ERROR type name `u8` is undefined or not in scope } </ins>