#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

#1644 in Rust patterns

Download history 55/week @ 2024-07-22 646/week @ 2024-07-29 78/week @ 2024-08-05 65/week @ 2024-08-12 53/week @ 2024-08-19 87/week @ 2024-08-26 66/week @ 2024-09-02 118/week @ 2024-09-09 86/week @ 2024-09-16 192/week @ 2024-09-23 190/week @ 2024-09-30 107/week @ 2024-10-07 92/week @ 2024-10-14 91/week @ 2024-10-21 100/week @ 2024-10-28 103/week @ 2024-11-04

392 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–18MB
~263K SLoC