docs

你正在阅读 v0.1.0 的文档。Nabi 0.1.0 已不再提供支持。 最新版本:v0.1.3 →

本页尚未翻译,以下为英文原文。

#0. Standard library meta

本页内容

This chapter collects in one place the policies and tables that apply across the standard library specification.

#Contents

#Role of this chapter

This chapter does not directly define individual traits or types. Instead, it gathers the rules and policies that the library as a whole must follow consistently.

The 3-tier model prescribes the direction of dependencies: std may use core and bare, and core may use bare, but dependencies in the opposite direction are not allowed. The import policy specifies the prelude, core::prelude, that every user file imports implicitly, and lists its names. The intrinsic entry that follows covers how standard library methods are connected to the compiler backend (PrimOp, etc.), and finally the lang slot entry shows how the 100 slots the compiler looks up through the #[lang(...)] attribute map to standard library items.

Only once these policies are defined can the trait definitions of 200-core/ follow.

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