Skip to content

Commit 826dca2

Browse files
committedDec 9, 2024
Disable non-required MIR opts with optimize(none)
1 parent b739645 commit 826dca2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+352
-75
lines changed
 

‎compiler/rustc_attr/src/builtin.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ pub enum OptimizeAttr {
6363
Size,
6464
}
6565

66+
impl OptimizeAttr {
67+
pub fn do_not_optimize(&self) -> bool {
68+
matches!(self, Self::None)
69+
}
70+
}
71+
6672
/// Represents the following attributes:
6773
///
6874
/// - `#[stable]`

‎compiler/rustc_mir_transform/src/abort_unwinding_calls.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,8 @@ impl<'tcx> crate::MirPass<'tcx> for AbortUnwindingCalls {
116116
// We may have invalidated some `cleanup` blocks so clean those up now.
117117
super::simplify::remove_dead_blocks(body);
118118
}
119+
120+
fn is_required(&self) -> bool {
121+
true
122+
}
119123
}

0 commit comments

Comments
 (0)