Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ impl InitMaskMaterialized {
None
}

#[cfg_attr(not(debug_assertions), allow(dead_code))]
fn find_bit_slow(
init_mask: &InitMaskMaterialized,
start: Size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ impl<Prov: Provenance> ProvenanceMap<Prov> {
}

/// Removes all provenance inside the given range.
#[allow(irrefutable_let_patterns)] // these actually make the code more clear
pub fn clear(&mut self, range: AllocRange, data_bytes: &[u8], cx: &impl HasDataLayout) {
if range.size == Size::ZERO {
return;
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,6 @@ macro_rules! super_body {
$self.visit_local_decl(local, & $($mutability)? $body.local_decls[local]);
}

#[allow(unused_macro_rules)]
macro_rules! type_annotations {
(mut) => ($body.user_type_annotations.iter_enumerated_mut());
() => ($body.user_type_annotations.iter_enumerated());
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
//!
//! For more details, see the [rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/query.html).

#![allow(unused_parens)]

use std::ffi::OsStr;
use std::path::PathBuf;
use std::sync::Arc;
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,9 +1736,7 @@ nop_list_lift! { args; GenericArg<'a> => GenericArg<'tcx> }

macro_rules! sty_debug_print {
($fmt: expr, $ctxt: expr, $($variant: ident),*) => {{
// Curious inner module to allow variant names to be used as
// variable names.
#[allow(non_snake_case)]
#[allow(non_snake_case, reason = "we're using variant names as local variables")]
mod inner {
use crate::ty::{self, TyCtxt};
use crate::ty::context::InternedInSet;
Expand Down
12 changes: 2 additions & 10 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,9 @@ use rustc_span::{DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol};
use rustc_target::callconv::FnAbi;
pub use rustc_type_ir::data_structures::{DelayedMap, DelayedSet};
pub use rustc_type_ir::fast_reject::DeepRejectCtxt;
#[allow(
hidden_glob_reexports,
rustc::usage_of_type_ir_inherent,
rustc::non_glob_import_of_type_ir_inherent
)]
use rustc_type_ir::inherent;
pub use rustc_type_ir::relate::VarianceDiagInfo;
pub use rustc_type_ir::solve::{CandidatePreferenceMode, SizedTraitKind, VisibleForLeakCheck};
pub use rustc_type_ir::*;
#[allow(hidden_glob_reexports, unused_imports)]
use rustc_type_ir::{InferCtxtLike, Interner};
use tracing::{debug, instrument};
pub use vtable::*;

Expand Down Expand Up @@ -170,7 +162,7 @@ mod opaque_types;
mod predicate;
mod region;
mod structural_impls;
#[allow(hidden_glob_reexports)]
#[expect(hidden_glob_reexports)]
mod sty;
mod typeck_results;
mod visit;
Expand Down Expand Up @@ -1936,7 +1928,7 @@ impl<'tcx> TyCtxt<'tcx> {
did: impl Into<DefId>,
attr: Symbol,
) -> impl Iterator<Item = &'tcx hir::Attribute> {
#[allow(deprecated)]
#[expect(deprecated)]
self.get_all_attrs(did).iter().filter(move |a: &&hir::Attribute| a.has_name(attr))
}

Expand Down
24 changes: 13 additions & 11 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3126,18 +3126,20 @@ pub struct PrintClosureAsImpl<'tcx> {

macro_rules! forward_display_to_print {
($($ty:ty),+) => {
// Some of the $ty arguments may not actually use 'tcx
$(#[allow(unused_lifetimes)] impl<'tcx> fmt::Display for $ty {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
ty::tls::with(|tcx| {
let mut p = FmtPrinter::new(tcx, Namespace::TypeNS);
tcx.lift(*self)
.print(&mut p)?;
f.write_str(&p.into_buffer())?;
Ok(())
})
$(
#[allow(unused_lifetimes, reason = "not all `$ty` have a 'tcx")]
impl<'tcx> fmt::Display for $ty {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
ty::tls::with(|tcx| {
let mut p = FmtPrinter::new(tcx, Namespace::TypeNS);
tcx.lift(*self)
.print(&mut p)?;
f.write_str(&p.into_buffer())?;
Ok(())
})
}
}
})+
)+
};
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ impl ParamConst {
impl<'tcx> Ty<'tcx> {
/// Avoid using this in favour of more specific `new_*` methods, where possible.
/// The more specific methods will often optimize their creation.
#[allow(rustc::usage_of_ty_tykind)]
#[inline]
fn new(tcx: TyCtxt<'tcx>, st: TyKind<'tcx>) -> Ty<'tcx> {
tcx.mk_ty_from_kind(st)
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ pub mod outlives_bounds;
pub mod outlives_for_liveness;
pub mod project;
pub mod query;
#[allow(hidden_glob_reexports)]
#[expect(hidden_glob_reexports)]
mod select;
pub mod specialize;
mod structural_normalize;
#[allow(hidden_glob_reexports)]
#[expect(hidden_glob_reexports)]
mod util;
pub mod vtable;
pub mod wf;
Expand Down
Loading