From 4e2bbfef3eaddf399e33caeaa3976005855dc322 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 28 Oct 2023 20:25:43 +0200 Subject: [PATCH] Remove needless `allow`s --- compiler/rustc_middle/src/ty/print/mod.rs | 2 -- compiler/rustc_middle/src/ty/print/pretty.rs | 3 --- 2 files changed, 5 deletions(-) diff --git a/compiler/rustc_middle/src/ty/print/mod.rs b/compiler/rustc_middle/src/ty/print/mod.rs index 80af8a9255398..6bbc8f70f5155 100644 --- a/compiler/rustc_middle/src/ty/print/mod.rs +++ b/compiler/rustc_middle/src/ty/print/mod.rs @@ -12,8 +12,6 @@ pub use self::pretty::*; pub type PrintError = std::fmt::Error; -// FIXME(eddyb) false positive, the lifetime parameters are used with `P: Printer<...>`. -#[allow(unused_lifetimes)] pub trait Print<'tcx, P> { fn print(&self, cx: &mut P) -> Result<(), PrintError>; } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 0bdebc41842ca..799ba2c35ec8b 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -2719,11 +2719,8 @@ macro_rules! define_print { (($self:ident, $cx:ident): $($ty:ty $print:block)+) => { $(impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for $ty { fn print(&$self, $cx: &mut P) -> Result<(), PrintError> { - #[allow(unused_mut)] - let mut $cx = $cx; define_scoped_cx!($cx); let _: () = $print; - #[allow(unreachable_code)] Ok(()) } })+