#spans #compiler #source-map #rustc-auto-publish #interning #automatic #symbols

nightly rustc-ap-rustc_span

Automatically published version of the package rustc_span in the rust-lang/rust repository from commit 9a27044f42ace9eb652781b53f598e25d4e7e918 The publishing script for this crate lives at: https://github.com/alexcrichton/rustc-auto-publish

92 major breaking releases

727.0.0 Jul 6, 2021
726.0.0 Jun 29, 2021
725.0.0 Jun 22, 2021
724.0.0 Jun 15, 2021
635.0.0 Dec 31, 2019

#1213 in Rust patterns

Download history 100/week @ 2024-06-14 94/week @ 2024-06-21 119/week @ 2024-06-28 172/week @ 2024-07-05 128/week @ 2024-07-12 88/week @ 2024-07-19 570/week @ 2024-07-26 135/week @ 2024-08-02 73/week @ 2024-08-09 63/week @ 2024-08-16 66/week @ 2024-08-23 74/week @ 2024-08-30 79/week @ 2024-09-06 110/week @ 2024-09-13 263/week @ 2024-09-20 158/week @ 2024-09-27

613 downloads per month
Used in 26 crates (14 directly)

MIT/Apache

1MB
22K SLoC

Source positions and related helper functions.

Important concepts in this module include:

  • the span, represented by SpanData and related types;
  • source code as represented by a SourceMap; and
  • interned strings, represented by Symbols, with some common symbols available statically in the [sym] module.

Unlike most compilers, the span contains not only the position in the source code, but also various other metadata, such as the edition and macro hygiene. This metadata is stored in SyntaxContext and ExpnData.

Note

This API is completely unstable and subject to change.

Dependencies

~8–17MB
~258K SLoC