docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0095: type too large

A value type is larger than the compiler handles. Hold the large part through a reference type such as List.

nabi
struct W<T> { a: T; b: T; }

let x: W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<i64>>>>>>>>>>>>>>>>>>>>>>>>>>> = panic("unreachable");
error[E0095]: value type `W<..>` is too large (131071 scalar slots, ~1048568 bytes; the limit is 65536 slots / 4294967296 bytes)
  --> main.nabi:3:30
   |
 3 | let x: W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<W<i64>>>>>>>>>>>>>>>>>>>>>>>>>>> = panic("unreachable");
   |                              ^

Hold the large part through a reference type, such as a List of the inner values or a struct of your own that holds one.

Related: E0080 definition depends on itself, E0093 generic instantiation too deep

Found a mistake? Edit this page on GitHub. Last updated