diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-18 13:40:58 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-18 13:43:43 +1100 |
| commit | 04eeda47abd07a5ba6f3f93e586ecf75d5574545 (patch) | |
| tree | fdf63954d6f8c7b6640ca8b21bfb0fb10bf1e0a8 /compiler/rustc_middle/src | |
| parent | 69f5e342bf179c991e325587fb9b16a75851b372 (diff) | |
| download | rust-04eeda47abd07a5ba6f3f93e586ecf75d5574545.tar.gz rust-04eeda47abd07a5ba6f3f93e586ecf75d5574545.zip | |
Inline and replace `Statement::replace_nop`.
It has a single call site, and doesn't seem worth having as an API function.
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/statement.rs | 9 |
2 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 582941e7e04..74ecff72082 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -4,8 +4,8 @@ use std::borrow::Cow; use std::fmt::{self, Debug, Formatter}; +use std::iter; use std::ops::{Index, IndexMut}; -use std::{iter, mem}; pub use basic_blocks::BasicBlocks; use either::Either; diff --git a/compiler/rustc_middle/src/mir/statement.rs b/compiler/rustc_middle/src/mir/statement.rs index d345c99f902..690a907f9a3 100644 --- a/compiler/rustc_middle/src/mir/statement.rs +++ b/compiler/rustc_middle/src/mir/statement.rs @@ -19,15 +19,6 @@ impl Statement<'_> { pub fn make_nop(&mut self) { self.kind = StatementKind::Nop } - - /// Changes a statement to a nop and returns the original statement. - #[must_use = "If you don't need the statement, use `make_nop` instead"] - pub fn replace_nop(&mut self) -> Self { - Statement { - source_info: self.source_info, - kind: mem::replace(&mut self.kind, StatementKind::Nop), - } - } } impl<'tcx> StatementKind<'tcx> { |
