Skip to content

Commit 032fdef

Browse files
committed
define span
1 parent f130e7d commit 032fdef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ pointers for understanding them better.
187187
- sess -- the **compiler session**, which stores global data used throughout compilation
188188
- side tables -- because the AST and HIR are immutable once created, we often carry extra
189189
information about them in the form of hashtables, indexed by the id of a particular node.
190+
- span -- a location in the user's source code, used for error
191+
reporting primarily. These are like a file-name/line-number/column
192+
tuple on steroids: they carry a start/end point, and also track
193+
macro expansions and compiler desugaring. All while being packed
194+
into a few bytes (really, it's an index into a table). See the
195+
`Span` datatype for more.
190196
- substs -- the **substitutions** for a given generic type or item
191197
(e.g., the `i32, u32` in `HashMap<i32, u32>`)
192198
- tcx -- the "typing context", main data structure of the compiler (see `librustc/ty`).

0 commit comments

Comments
 (0)