Closed dcrewi closed 9 years ago
That's strange. And the file that it talks about, src/librustc/front/map/mod.rs
doesn't even exist.
Although I can understand the second error (non-constant path in constant expr).
The file does exist: http://mxr.mozilla.org/rust/source/src/librustc/front/map/mod.rs
It's not just with ::SIZE
, using pub fn cause_compiler_to_panic<T: Trait>() -> [u8; T::FOO] {
ICE's just as hard, and I never even defined FOO
.
I think we have to fix <DefId as Debug>
globally to stop crashing like that.
Anyway, paths with type parameters (e.g. T::SIZE
, <T as Trait>::SIZE
) are not supported in array lengths.
rustc encountered an ICE while trying to display an ICE
the inner ICE is:
thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTyParam(FnSpace, 0, DefId { krate: 0, node: 12 => cause_compiler_to_panic::T }, T(66)), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:81
This looks like a dupe of something.
Closing as a dupe of https://github.com/rust-lang/rust/issues/25145
code
compiler output
verbose compiler info
other thoughts
I would have expected the accepted way to write the array size would be
<T as Trait>::SIZE
, but that fails to compile with this error message: