1
Fork 0

refactor: cleanup

This commit is contained in:
Rejyr 2022-11-23 15:52:03 -05:00
parent fe09291036
commit 88e5dd2530
22 changed files with 3 additions and 49 deletions

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ArrayIntoIterDiag, ArrayIntoIterDiagSub}; use crate::lints::{ArrayIntoIterDiag, ArrayIntoIterDiagSub};
use crate::{LateContext, LateLintPass, LintContext}; use crate::{LateContext, LateLintPass, LintContext};
use rustc_hir as hir; use rustc_hir as hir;

View file

@ -1,5 +1,3 @@
// #![deny(rustc::untranslatable_diagnostic)]
// #![deny(rustc::diagnostic_outside_of_impl)]
//! Lints in the Rust compiler. //! Lints in the Rust compiler.
//! //!
//! This contains lints which can feasibly be implemented as their own //! 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. // 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 this = this_fi.ident.name;
let orig = orig.get_name(); let orig = orig.get_name();
let previous_decl_label = get_relevant_span(orig_fi); let previous_decl_label = get_relevant_span(orig_fi);
@ -3119,6 +3112,7 @@ declare_lint! {
declare_lint_pass!(NamedAsmLabels => [NAMED_ASM_LABELS]); declare_lint_pass!(NamedAsmLabels => [NAMED_ASM_LABELS]);
impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels { 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>) { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
if let hir::Expr { if let hir::Expr {
kind: hir::ExprKind::InlineAsm(hir::InlineAsm { template_strs, .. }), kind: hir::ExprKind::InlineAsm(hir::InlineAsm { template_strs, .. }),

View file

@ -13,8 +13,6 @@
//! previous lint state is pushed onto a stack and the ast is then recursed //! 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 //! upon. As the ast is traversed, this keeps track of the current lint level
//! for all lint attributes. //! for all lint attributes.
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use self::TargetLint::*; use self::TargetLint::*;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
//! Implementation of lint checking. //! Implementation of lint checking.
//! //!
//! The lint checking is mostly consolidated into one pass which runs //! The lint checking is mostly consolidated into one pass which runs

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::{ use crate::{
context::LintContext, context::LintContext,
lints::{EnumIntrinsicsMemDiscriminate, EnumIntrinsicsMemVariant}, lints::{EnumIntrinsicsMemDiscriminate, EnumIntrinsicsMemVariant},

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use rustc_errors::{ use rustc_errors::{
fluent, AddToDiagnostic, Diagnostic, ErrorGuaranteed, Handler, IntoDiagnostic, fluent, AddToDiagnostic, Diagnostic, ErrorGuaranteed, Handler, IntoDiagnostic,
SubdiagnosticMessage, SubdiagnosticMessage,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{Expectation, ExpectationNote}; use crate::lints::{Expectation, ExpectationNote};
use rustc_middle::ty::query::Providers; use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt; use rustc_middle::ty::TyCtxt;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::{ use crate::{
lints::{ lints::{
ForLoopsOverFalliblesDiag, ForLoopsOverFalliblesLoopSub, ForLoopsOverFalliblesQuestionMark, ForLoopsOverFalliblesDiag, ForLoopsOverFalliblesLoopSub, ForLoopsOverFalliblesQuestionMark,

View file

@ -1,8 +1,6 @@
//! Some lints that are only useful in the compiler or crates that use compiler internals, such as //! Some lints that are only useful in the compiler or crates that use compiler internals, such as
//! Clippy. //! Clippy.
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ use crate::lints::{
BadOptAccessDiag, DefaultHashTypesDiag, DiagOutOfImpl, LintPassByHand, NonExistantDocKeyword, BadOptAccessDiag, DefaultHashTypesDiag, DiagOutOfImpl, LintPassByHand, NonExistantDocKeyword,
QueryInstability, TyQualified, TykindDiag, TykindKind, UntranslatableDiag, QueryInstability, TyQualified, TykindDiag, TykindKind, UntranslatableDiag,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::{ use crate::{
lints::{NonBindingLet, NonBindingLetSub}, lints::{NonBindingLet, NonBindingLetSub},
LateContext, LateLintPass, LintContext, LateContext, LateLintPass, LintContext,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::context::{CheckLintNameResult, LintStore}; use crate::context::{CheckLintNameResult, LintStore};
use crate::late::unerased_lint_store; use crate::late::unerased_lint_store;
use crate::lints::{ use crate::lints::{

View file

@ -38,8 +38,8 @@
#![feature(never_type)] #![feature(never_type)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![recursion_limit = "256"] #![recursion_limit = "256"]
// #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::untranslatable_diagnostic)]
// #![deny(rustc::diagnostic_outside_of_impl)] #![deny(rustc::diagnostic_outside_of_impl)]
#[macro_use] #[macro_use]
extern crate rustc_middle; extern crate rustc_middle;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::CStringPtr; use crate::lints::CStringPtr;
use crate::LateContext; use crate::LateContext;
use crate::LateLintPass; use crate::LateLintPass;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ use crate::lints::{
ConfusableIdentifierPair, IdentifierNonAsciiChar, IdentifierUncommonCodepoints, ConfusableIdentifierPair, IdentifierNonAsciiChar, IdentifierUncommonCodepoints,
MixedScriptConfusables, MixedScriptConfusables,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{NonFmtPanicBraces, NonFmtPanicUnused}; use crate::lints::{NonFmtPanicBraces, NonFmtPanicUnused};
use crate::{LateContext, LateLintPass, LintContext}; use crate::{LateContext, LateLintPass, LintContext};
use rustc_ast as ast; use rustc_ast as ast;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ use crate::lints::{
NonCamelCaseType, NonCamelCaseTypeSub, NonSnakeCaseDiag, NonSnakeCaseDiagSub, NonCamelCaseType, NonCamelCaseTypeSub, NonSnakeCaseDiag, NonSnakeCaseDiagSub,
NonUpperCaseGlobal, NonUpperCaseGlobalSub, NonUpperCaseGlobal, NonUpperCaseGlobalSub,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::context::LintContext; use crate::context::LintContext;
use crate::lints::NoopMethodCallDiag; use crate::lints::NoopMethodCallDiag;
use crate::LateContext; use crate::LateContext;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::PassByValueDiag; use crate::lints::PassByValueDiag;
use crate::{LateContext, LateLintPass, LintContext}; use crate::{LateContext, LateLintPass, LintContext};
use rustc_hir as hir; use rustc_hir as hir;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::{lints::RedundantSemicolonsDiag, EarlyContext, EarlyLintPass, LintContext}; use crate::{lints::RedundantSemicolonsDiag, EarlyContext, EarlyLintPass, LintContext};
use rustc_ast::{Block, StmtKind}; use rustc_ast::{Block, StmtKind};
use rustc_span::Span; use rustc_span::Span;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{DropGlue, DropTraitConstraintsDiag}; use crate::lints::{DropGlue, DropTraitConstraintsDiag};
use crate::LateContext; use crate::LateContext;
use crate::LateLintPass; use crate::LateLintPass;

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ use crate::lints::{
AtomicOrderingFence, AtomicOrderingLoad, AtomicOrderingStore, ImproperCTypes, AtomicOrderingFence, AtomicOrderingLoad, AtomicOrderingStore, ImproperCTypes,
InvalidAtomicOrderingDiag, OnlyCastu8ToChar, OverflowingBinHex, OverflowingBinHexSign, InvalidAtomicOrderingDiag, OnlyCastu8ToChar, OverflowingBinHex, OverflowingBinHexSign,

View file

@ -1,5 +1,3 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
use crate::lints::{ use crate::lints::{
PathStatementDrop, PathStatementDropSub, PathStatementNoEffect, UnusedAllocationDiag, PathStatementDrop, PathStatementDropSub, PathStatementNoEffect, UnusedAllocationDiag,
UnusedAllocationMutDiag, UnusedClosure, UnusedDef, UnusedDelim, UnusedDelimSuggestion, UnusedAllocationMutDiag, UnusedClosure, UnusedDef, UnusedDelim, UnusedDelimSuggestion,