Use #[derive] instead of custom syntax in all newtype_index

This commit is contained in:
Nilstrieb 2022-12-18 20:53:08 +01:00
parent 37efc81072
commit b4d739ef12
7 changed files with 14 additions and 26 deletions

View file

@ -654,8 +654,8 @@ impl SourceInfo {
// Variables and temps
rustc_index::newtype_index! {
#[derive(HashStable)]
pub struct Local {
derive [HashStable]
DEBUG_FORMAT = "_{}",
const RETURN_PLACE = 0,
}
@ -1146,8 +1146,8 @@ rustc_index::newtype_index! {
/// https://rustc-dev-guide.rust-lang.org/appendix/background.html#what-is-a-dataflow-analysis
/// [`CriticalCallEdges`]: ../../rustc_const_eval/transform/add_call_guards/enum.AddCallGuards.html#variant.CriticalCallEdges
/// [guide-mir]: https://rustc-dev-guide.rust-lang.org/mir/
#[derive(HashStable)]
pub struct BasicBlock {
derive [HashStable]
DEBUG_FORMAT = "bb{}",
const START_BLOCK = 0,
}
@ -1530,8 +1530,8 @@ rustc_index::newtype_index! {
/// [wrapper]: https://rustc-dev-guide.rust-lang.org/appendix/glossary.html#newtype
/// [CFG]: https://rustc-dev-guide.rust-lang.org/appendix/background.html#cfg
/// [mir-datatypes]: https://rustc-dev-guide.rust-lang.org/mir/index.html#mir-data-types
#[derive(HashStable)]
pub struct Field {
derive [HashStable]
DEBUG_FORMAT = "field[{}]"
}
}
@ -1757,8 +1757,8 @@ impl Debug for Place<'_> {
// Scopes
rustc_index::newtype_index! {
#[derive(HashStable)]
pub struct SourceScope {
derive [HashStable]
DEBUG_FORMAT = "scope[{}]",
const OUTERMOST_SOURCE_SCOPE = 0,
}
@ -2755,8 +2755,8 @@ impl<'tcx> TypeVisitable<'tcx> for UserTypeProjection {
}
rustc_index::newtype_index! {
#[derive(HashStable)]
pub struct Promoted {
derive [HashStable]
DEBUG_FORMAT = "promoted[{}]"
}
}