diff options
| -rw-r--r-- | compiler/rustc_lint/src/levels.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 7b7831bd019..be1d7d98aa6 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -494,6 +494,14 @@ impl<'s> LintLevelsBuilder<'s, TopDown> { /// Called after `push` when the scope of a set of attributes are exited. pub(crate) fn pop(&mut self, push: BuilderPush) { self.provider.cur = push.prev; + std::mem::forget(push); + } +} + +#[cfg(debug_assertions)] +impl Drop for BuilderPush { + fn drop(&mut self) { + panic!("Found a `push` without a `pop`."); } } |
