Skip to content

Commit 12187b7

Browse files
committed
Remove unused #[allow(...)] statements from compiler/
1 parent c6e4db6 commit 12187b7

File tree

21 files changed

+2
-28
lines changed

21 files changed

+2
-28
lines changed

compiler/rustc_arena/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#![feature(new_uninit)]
1616
#![feature(maybe_uninit_slice)]
1717
#![cfg_attr(test, feature(test))]
18-
#![allow(deprecated)]
1918

2019
use rustc_data_structures::cold_path;
2120
use smallvec::SmallVec;

compiler/rustc_codegen_llvm/src/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,6 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
931931
unsafe { llvm::LLVMBuildSelect(self.llbuilder, cond, then_val, else_val, UNNAMED) }
932932
}
933933

934-
#[allow(dead_code)]
935934
fn va_arg(&mut self, list: &'ll Value, ty: &'ll Type) -> &'ll Value {
936935
unsafe { llvm::LLVMBuildVAArg(self.llbuilder, list, ty, UNNAMED) }
937936
}

compiler/rustc_codegen_llvm/src/common.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_camel_case_types, non_snake_case)]
2-
31
//! Code that is useful in various codegen modules.
42
53
use crate::consts::{self, const_alloc_to_llvm};

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,6 @@ impl<'tcx> VariantInfo<'_, 'tcx> {
18451845
None
18461846
}
18471847

1848-
#[allow(dead_code)]
18491848
fn is_artificial(&self) -> bool {
18501849
match self {
18511850
VariantInfo::Generator { .. } => true,

compiler/rustc_codegen_llvm/src/va_arg.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use rustc_middle::ty::layout::HasTyCtxt;
1111
use rustc_middle::ty::Ty;
1212
use rustc_target::abi::{Align, HasDataLayout, LayoutOf, Size};
1313

14-
#[allow(dead_code)]
1514
fn round_pointer_up_to_alignment(
1615
bx: &mut Builder<'a, 'll, 'tcx>,
1716
addr: &'ll Value,

compiler/rustc_codegen_ssa/src/common.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(non_camel_case_types, non_snake_case)]
1+
#![allow(non_camel_case_types)]
22

33
use rustc_errors::struct_span_err;
44
use rustc_hir as hir;
@@ -25,7 +25,6 @@ pub enum IntPredicate {
2525
IntSLE,
2626
}
2727

28-
#[allow(dead_code)]
2928
pub enum RealPredicate {
3029
RealPredicateFalse,
3130
RealOEQ,
@@ -60,7 +59,6 @@ pub enum AtomicRmwBinOp {
6059
}
6160

6261
pub enum AtomicOrdering {
63-
#[allow(dead_code)]
6462
NotAtomic,
6563
Unordered,
6664
Monotonic,

compiler/rustc_data_structures/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//! This API is completely unstable and subject to change.
88
99
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
10-
#![allow(incomplete_features)]
1110
#![feature(array_windows)]
1211
#![feature(control_flow_enum)]
1312
#![feature(in_band_lifetimes)]

compiler/rustc_hir/src/intravisit.rs

-3
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ pub trait Visitor<'v>: Sized {
256256
/// patterns described on `itemlikevisit::ItemLikeVisitor`. The only
257257
/// reason to override this method is if you want a nested pattern
258258
/// but cannot supply a `Map`; see `nested_visit_map` for advice.
259-
#[allow(unused_variables)]
260259
fn visit_nested_item(&mut self, id: ItemId) {
261260
let opt_item = self.nested_visit_map().inter().map(|map| map.item(id.id));
262261
walk_list!(self, visit_item, opt_item);
@@ -265,7 +264,6 @@ pub trait Visitor<'v>: Sized {
265264
/// Like `visit_nested_item()`, but for trait items. See
266265
/// `visit_nested_item()` for advice on when to override this
267266
/// method.
268-
#[allow(unused_variables)]
269267
fn visit_nested_trait_item(&mut self, id: TraitItemId) {
270268
let opt_item = self.nested_visit_map().inter().map(|map| map.trait_item(id));
271269
walk_list!(self, visit_trait_item, opt_item);
@@ -274,7 +272,6 @@ pub trait Visitor<'v>: Sized {
274272
/// Like `visit_nested_item()`, but for impl items. See
275273
/// `visit_nested_item()` for advice on when to override this
276274
/// method.
277-
#[allow(unused_variables)]
278275
fn visit_nested_impl_item(&mut self, id: ImplItemId) {
279276
let opt_item = self.nested_visit_map().inter().map(|map| map.impl_item(id));
280277
walk_list!(self, visit_impl_item, opt_item);

compiler/rustc_infer/src/infer/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
12751275
}
12761276

12771277
/// Gives temporary access to the region constraint data.
1278-
#[allow(non_camel_case_types)] // bug with impl trait
12791278
pub fn with_region_constraints<R>(
12801279
&self,
12811280
op: impl FnOnce(&RegionConstraintData<'tcx>) -> R,

compiler/rustc_lint/src/types.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_snake_case)]
2-
31
use crate::{LateContext, LateLintPass, LintContext};
42
use rustc_ast as ast;
53
use rustc_attr as attr;

compiler/rustc_llvm/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ impl RustString {
2121

2222
/// Appending to a Rust string -- used by RawRustStringOstream.
2323
#[no_mangle]
24-
#[allow(improper_ctypes_definitions)]
2524
pub unsafe extern "C" fn LLVMRustStringWriteImpl(
2625
sr: &RustString,
2726
ptr: *const c_char,

compiler/rustc_macros/src/query.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use syn::{
99
ReturnType, Token, Type,
1010
};
1111

12-
#[allow(non_camel_case_types)]
1312
mod kw {
1413
syn::custom_keyword!(query);
1514
}

compiler/rustc_macros/src/symbols.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::collections::HashSet;
44
use syn::parse::{Parse, ParseStream, Result};
55
use syn::{braced, parse_macro_input, Ident, LitStr, Token};
66

7-
#[allow(non_camel_case_types)]
87
mod kw {
98
syn::custom_keyword!(Keywords);
109
syn::custom_keyword!(Symbols);

compiler/rustc_middle/src/util/common.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_camel_case_types)]
2-
31
use rustc_data_structures::sync::Lock;
42

53
use std::fmt::Debug;

compiler/rustc_mir/src/borrow_check/prefixes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub(super) struct Prefixes<'cx, 'tcx> {
3333
}
3434

3535
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
36-
#[allow(dead_code)]
3736
pub(super) enum PrefixSet {
3837
/// Doesn't stop until it returns the base case (a Local or
3938
/// Static prefix).

compiler/rustc_mir/src/dataflow/move_paths/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ impl<'tcx> fmt::Display for MovePath<'tcx> {
144144
}
145145
}
146146

147-
#[allow(unused)]
148147
struct MovePathLinearIter<'a, 'tcx, F> {
149148
next: Option<(MovePathIndex, &'a MovePath<'tcx>)>,
150149
fetch_next: F,

compiler/rustc_session/src/filesearch.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(non_camel_case_types)]
2-
31
pub use self::FileMatch::*;
42

53
use std::borrow::Cow;

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub enum AutoTraitResult<A> {
3232
NegativeImpl,
3333
}
3434

35+
#[allow(dead_code)]
3536
impl<A> AutoTraitResult<A> {
3637
fn is_auto(&self) -> bool {
3738
match *self {

compiler/rustc_trait_selection/src/traits/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html
44
5-
#[allow(dead_code)]
65
pub mod auto_trait;
76
mod chalk_fulfill;
87
pub mod codegen;

compiler/rustc_trait_selection/src/traits/select/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,6 @@ trait TraitObligationExt<'tcx> {
21482148
}
21492149

21502150
impl<'tcx> TraitObligationExt<'tcx> for TraitObligation<'tcx> {
2151-
#[allow(unused_comparisons)]
21522151
fn derived_cause(
21532152
&self,
21542153
variant: fn(DerivedObligationCause<'tcx>) -> ObligationCauseCode<'tcx>,

compiler/rustc_typeck/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ This API is completely unstable and subject to change.
5656
*/
5757

5858
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
59-
#![allow(non_camel_case_types)]
6059
#![feature(bool_to_option)]
6160
#![feature(box_syntax)]
6261
#![feature(crate_visibility_modifier)]

0 commit comments

Comments
 (0)