1
Fork 0

A few small cleanups for newtype_index

Remove the `..` from the body, only a few invocations used it and it's
inconsistent with rust syntax.

Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
This commit is contained in:
Nilstrieb 2022-12-18 21:47:28 +01:00
parent d679764fb6
commit 8bfd6450c7
35 changed files with 68 additions and 115 deletions

View file

@ -12,8 +12,7 @@ use std::hash::{Hash, Hasher};
rustc_index::newtype_index! {
#[custom_encodable]
#[debug_format = "crate{}"]
pub struct CrateNum {
}
pub struct CrateNum {}
}
/// Item definitions in the currently-compiled crate would have the `CrateNum`
@ -199,7 +198,7 @@ rustc_index::newtype_index! {
pub struct DefIndex {
/// The crate root is always assigned index 0 by the AST Map code,
/// thanks to `NodeCollector::new`.
const CRATE_DEF_INDEX = 0,
const CRATE_DEF_INDEX = 0;
}
}

View file

@ -62,8 +62,7 @@ pub struct SyntaxContextData {
rustc_index::newtype_index! {
/// A unique ID associated with a macro invocation and expansion.
#[custom_encodable]
pub struct ExpnIndex {
}
pub struct ExpnIndex {}
}
/// A unique ID associated with a macro invocation and expansion.
@ -85,8 +84,7 @@ rustc_index::newtype_index! {
#[custom_encodable]
#[no_ord_impl]
#[debug_format = "expn{}"]
pub struct LocalExpnId {
}
pub struct LocalExpnId {}
}
// To ensure correctness of incremental compilation,

View file

@ -1801,7 +1801,7 @@ impl fmt::Display for MacroRulesNormalizedIdent {
pub struct Symbol(SymbolIndex);
rustc_index::newtype_index! {
struct SymbolIndex { .. }
struct SymbolIndex {}
}
impl Symbol {