Edit rustc_span documentation
Various changes to the `rustc_span` docs, including the following: - Additions to top-level docs - Edits to the source_map module docs - Edits to documentation for `Span` and `SpanData` - Added intra-docs links - Documentation for Levenshtein distances - Fixed missing punctuation
This commit is contained in:
parent
3d10d3e49d
commit
a8775d44e9
5 changed files with 71 additions and 46 deletions
|
@ -4,24 +4,25 @@ use std::str::FromStr;
|
|||
|
||||
use rustc_macros::HashStable_Generic;
|
||||
|
||||
/// The edition of the compiler (RFC 2052)
|
||||
/// The edition of the compiler. (See [RFC 2052](https://github.com/rust-lang/rfcs/blob/master/text/2052-epochs.md).)
|
||||
#[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, Encodable, Decodable, Eq)]
|
||||
#[derive(HashStable_Generic)]
|
||||
pub enum Edition {
|
||||
// editions must be kept in order, oldest to newest
|
||||
// When adding new editions, be sure to do the following:
|
||||
//
|
||||
// - update the `ALL_EDITIONS` const
|
||||
// - update the `EDITION_NAME_LIST` const
|
||||
// - add a `rust_####()` function to the session
|
||||
// - update the enum in Cargo's sources as well
|
||||
//
|
||||
// Editions *must* be kept in order, oldest to newest.
|
||||
/// The 2015 edition
|
||||
Edition2015,
|
||||
/// The 2018 edition
|
||||
Edition2018,
|
||||
// when adding new editions, be sure to update:
|
||||
//
|
||||
// - Update the `ALL_EDITIONS` const
|
||||
// - Update the EDITION_NAME_LIST const
|
||||
// - add a `rust_####()` function to the session
|
||||
// - update the enum in Cargo's sources as well
|
||||
}
|
||||
|
||||
// must be in order from oldest to newest
|
||||
// Must be in order from oldest to newest.
|
||||
pub const ALL_EDITIONS: &[Edition] = &[Edition::Edition2015, Edition::Edition2018];
|
||||
|
||||
pub const EDITION_NAME_LIST: &str = "2015|2018";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue