about summary refs log tree commit diff
path: root/compiler/rustc_mir_build
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-20 07:27:01 +0000
committerbors <bors@rust-lang.org>2022-12-20 07:27:01 +0000
commiteb9e5e711d3eef1998ff24ac2bc57386662652e9 (patch)
tree10d0607d0ca60fd9f25fedfde0cf1a025b9de3b1 /compiler/rustc_mir_build
parent7f42e58effa3871dda6a41e250dea60cf88868ca (diff)
parent8bfd6450c7b61ffee0fd7e21b538d00018a0e47e (diff)
downloadrust-eb9e5e711d3eef1998ff24ac2bc57386662652e9.tar.gz
rust-eb9e5e711d3eef1998ff24ac2bc57386662652e9.zip
Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obk
Improve syntax of `newtype_index`

This makes it more like proper Rust and also makes the implementation a lot simpler.

Mostly just turns weird flags in the body into proper attributes.

It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
Diffstat (limited to 'compiler/rustc_mir_build')
-rw-r--r--compiler/rustc_mir_build/src/build/mod.rs2
-rw-r--r--compiler/rustc_mir_build/src/build/scope.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_build/src/build/mod.rs b/compiler/rustc_mir_build/src/build/mod.rs
index 7af89dd472f..c785dfb500f 100644
--- a/compiler/rustc_mir_build/src/build/mod.rs
+++ b/compiler/rustc_mir_build/src/build/mod.rs
@@ -372,7 +372,7 @@ struct CFG<'tcx> {
 }
 
 rustc_index::newtype_index! {
-    struct ScopeId { .. }
+    struct ScopeId {}
 }
 
 #[derive(Debug)]
diff --git a/compiler/rustc_mir_build/src/build/scope.rs b/compiler/rustc_mir_build/src/build/scope.rs
index 33f49ffdaf6..c92634a609d 100644
--- a/compiler/rustc_mir_build/src/build/scope.rs
+++ b/compiler/rustc_mir_build/src/build/scope.rs
@@ -185,7 +185,7 @@ pub(crate) enum BreakableTarget {
 }
 
 rustc_index::newtype_index! {
-    struct DropIdx { .. }
+    struct DropIdx {}
 }
 
 const ROOT_NODE: DropIdx = DropIdx::from_u32(0);