You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/appendix/glossary.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ Term | Meaning
72
72
<spanid="soundness">soundness</span> | A technical term in type theory. Roughly, if a type system is sound, then a program that type-checks is type-safe. That is, one can never (in safe rust) force a value into a variable of the wrong type. (see "completeness").
73
73
<spanid="span">span</span> | A location in the user's source code, used for error reporting primarily. These are like a file-name/line-number/column tuple on steroids: they carry a start/end point, and also track macro expansions and compiler desugaring. All while being packed into a few bytes (really, it's an index into a table). See the Span datatype for more.
74
74
<spanid="substs">substs</span> | The substitutions for a given generic type or item (e.g. the `i32`, `u32` in `HashMap<i32, u32>`).
75
+
<spanid="sysroot">sysroot</span> | The directory for build artifacts that are loaded by the compiler at runtime. ([see more](../building/bootstrapping.html#what-is-a-sysroot))
75
76
<spanid="tag">Tag</span> | The "tag" of an enum/generator encodes the [discriminant](#discriminant) of the active variant/state. Tags can either be "direct" (simply storing the discriminant in a field) or use a ["niche"](#niche).
76
77
<spanid="tcx">tcx</span> | The "typing context", main data structure of the compiler. ([see more](../ty.md))
77
78
<spanid="lifetime-tcx">`'tcx`</span> | The lifetime of the allocation arena. ([see more](../ty.md))
There are also runtime dependencies for the standard library! These are in
297
+
`lib/rustlib`, not `lib/` directly.
298
+
299
+
```
300
+
$ ls $(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/lib | head -n 5
301
+
libaddr2line-6c8e02b8fedc1e5f.rlib
302
+
libadler-9ef2480568df55af.rlib
303
+
liballoc-9c4002b5f79ba0e1.rlib
304
+
libcfg_if-512eb53291f6de7e.rlib
305
+
libcompiler_builtins-ef2408da76957905.rlib
306
+
```
307
+
308
+
`rustlib` includes libraries like `hashbrown` and `cfg_if`, which are not part
309
+
of the public API of the standard library, but are used to implement it.
310
+
`rustlib` is part of the search path for linkers, but `lib` will never be part
311
+
of the search path.
312
+
313
+
Since `rustlib` is part of the search path, it means we have to be careful
314
+
about which crates are included in it. In particular, all crates except for
315
+
the standard library are built with the flag `-Z force-unstable-if-unmarked`,
316
+
which means that you have to use `#![feature(rustc_private)]` in order to
317
+
load it (as opposed to the standard library, which is always available).
318
+
319
+
You can find more discussion about sysroots in:
320
+
- The [rustdoc PR] explaining why it uses `extern crate` for dependencies loaded from sysroot
321
+
-[Discussions about sysroot on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/deps.20in.20sysroot/)
322
+
-[Discussions about building rustdoc out of tree](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20to.20create.20an.20executable.20accessing.20.60rustc_private.60.3F)
0 commit comments