about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir/mod.rs
diff options
context:
space:
mode:
authordianqk <dianqk@dianqk.net>2025-07-01 07:02:14 +0800
committerdianqk <dianqk@dianqk.net>2025-07-01 07:14:13 +0800
commit90e0835004b2ec6dc596bbecf65eb49f49c01e7f (patch)
treeb540fc3421d8b09d1f005f1d384ceb2562416971 /compiler/rustc_middle/src/mir/mod.rs
parentf26e58023071e71636a3c72ac3a2bf89b1f76706 (diff)
downloadrust-90e0835004b2ec6dc596bbecf65eb49f49c01e7f.tar.gz
rust-90e0835004b2ec6dc596bbecf65eb49f49c01e7f.zip
mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`
Ensure they are always created using constructors.
Diffstat (limited to 'compiler/rustc_middle/src/mir/mod.rs')
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 9f39908c3b2..33e97766a02 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1336,6 +1336,7 @@ impl BasicBlock {
 ///
 /// See [`BasicBlock`] for documentation on what basic blocks are at a high level.
 #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
+#[non_exhaustive]
 pub struct BasicBlockData<'tcx> {
     /// List of statements in this block.
     pub statements: Vec<Statement<'tcx>>,