refactor: cleanup
This commit is contained in:
parent
fe09291036
commit
88e5dd2530
22 changed files with 3 additions and 49 deletions
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{ArrayIntoIterDiag, ArrayIntoIterDiagSub};
|
||||
use crate::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_hir as hir;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// #![deny(rustc::untranslatable_diagnostic)]
|
||||
// #![deny(rustc::diagnostic_outside_of_impl)]
|
||||
//! Lints in the Rust compiler.
|
||||
//!
|
||||
//! This contains lints which can feasibly be implemented as their own
|
||||
|
@ -2956,11 +2954,6 @@ impl<'tcx> LateLintPass<'tcx> for ClashingExternDeclarations {
|
|||
};
|
||||
|
||||
// Finally, emit the diagnostic.
|
||||
let mut expected_str = DiagnosticStyledString::new();
|
||||
expected_str.push(existing_decl_ty.fn_sig(tcx).to_string(), false);
|
||||
let mut found_str = DiagnosticStyledString::new();
|
||||
found_str.push(this_decl_ty.fn_sig(tcx).to_string(), true);
|
||||
|
||||
let this = this_fi.ident.name;
|
||||
let orig = orig.get_name();
|
||||
let previous_decl_label = get_relevant_span(orig_fi);
|
||||
|
@ -3119,6 +3112,7 @@ declare_lint! {
|
|||
declare_lint_pass!(NamedAsmLabels => [NAMED_ASM_LABELS]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
|
||||
#[allow(rustc::diagnostic_outside_of_impl)]
|
||||
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
|
||||
if let hir::Expr {
|
||||
kind: hir::ExprKind::InlineAsm(hir::InlineAsm { template_strs, .. }),
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
//! previous lint state is pushed onto a stack and the ast is then recursed
|
||||
//! upon. As the ast is traversed, this keeps track of the current lint level
|
||||
//! for all lint attributes.
|
||||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
|
||||
use self::TargetLint::*;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
//! Implementation of lint checking.
|
||||
//!
|
||||
//! The lint checking is mostly consolidated into one pass which runs
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::{
|
||||
context::LintContext,
|
||||
lints::{EnumIntrinsicsMemDiscriminate, EnumIntrinsicsMemVariant},
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use rustc_errors::{
|
||||
fluent, AddToDiagnostic, Diagnostic, ErrorGuaranteed, Handler, IntoDiagnostic,
|
||||
SubdiagnosticMessage,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{Expectation, ExpectationNote};
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::{
|
||||
lints::{
|
||||
ForLoopsOverFalliblesDiag, ForLoopsOverFalliblesLoopSub, ForLoopsOverFalliblesQuestionMark,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
//! Some lints that are only useful in the compiler or crates that use compiler internals, such as
|
||||
//! Clippy.
|
||||
|
||||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{
|
||||
BadOptAccessDiag, DefaultHashTypesDiag, DiagOutOfImpl, LintPassByHand, NonExistantDocKeyword,
|
||||
QueryInstability, TyQualified, TykindDiag, TykindKind, UntranslatableDiag,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::{
|
||||
lints::{NonBindingLet, NonBindingLetSub},
|
||||
LateContext, LateLintPass, LintContext,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::context::{CheckLintNameResult, LintStore};
|
||||
use crate::late::unerased_lint_store;
|
||||
use crate::lints::{
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
#![feature(never_type)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![recursion_limit = "256"]
|
||||
// #![deny(rustc::untranslatable_diagnostic)]
|
||||
// #![deny(rustc::diagnostic_outside_of_impl)]
|
||||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::CStringPtr;
|
||||
use crate::LateContext;
|
||||
use crate::LateLintPass;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{
|
||||
ConfusableIdentifierPair, IdentifierNonAsciiChar, IdentifierUncommonCodepoints,
|
||||
MixedScriptConfusables,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{NonFmtPanicBraces, NonFmtPanicUnused};
|
||||
use crate::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_ast as ast;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{
|
||||
NonCamelCaseType, NonCamelCaseTypeSub, NonSnakeCaseDiag, NonSnakeCaseDiagSub,
|
||||
NonUpperCaseGlobal, NonUpperCaseGlobalSub,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::context::LintContext;
|
||||
use crate::lints::NoopMethodCallDiag;
|
||||
use crate::LateContext;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::PassByValueDiag;
|
||||
use crate::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_hir as hir;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::{lints::RedundantSemicolonsDiag, EarlyContext, EarlyLintPass, LintContext};
|
||||
use rustc_ast::{Block, StmtKind};
|
||||
use rustc_span::Span;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{DropGlue, DropTraitConstraintsDiag};
|
||||
use crate::LateContext;
|
||||
use crate::LateLintPass;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{
|
||||
AtomicOrderingFence, AtomicOrderingLoad, AtomicOrderingStore, ImproperCTypes,
|
||||
InvalidAtomicOrderingDiag, OnlyCastu8ToChar, OverflowingBinHex, OverflowingBinHexSign,
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
use crate::lints::{
|
||||
PathStatementDrop, PathStatementDropSub, PathStatementNoEffect, UnusedAllocationDiag,
|
||||
UnusedAllocationMutDiag, UnusedClosure, UnusedDef, UnusedDelim, UnusedDelimSuggestion,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue