rust/compiler/rustc_lint/src/lib.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

532 lines
20 KiB
Rust
Raw Normal View History

2020-01-09 06:58:48 +00:00
//! Lints, aka compiler warnings.
//!
2020-01-09 06:58:48 +00:00
//! A 'lint' check is a kind of miscellaneous constraint that a user _might_
//! want to enforce, but might reasonably want to permit as well, on a
//! module-by-module basis. They contrast with static constraints enforced by
//! other phases of the compiler, which are generally required to hold in order
//! to compile the program at all.
//!
2020-05-01 20:32:33 +00:00
//! Most lints can be written as [LintPass] instances. These run after
2020-01-09 06:58:48 +00:00
//! all other analyses. The `LintPass`es built into rustc are defined
2020-05-01 20:32:33 +00:00
//! within [rustc_session::lint::builtin],
2020-01-09 06:58:48 +00:00
//! which has further comments on how to add such a lint.
//! rustc can also load user-defined lint plugins via the plugin mechanism.
//!
//! Some of rustc's lints are defined elsewhere in the compiler and work by
//! calling `add_lint()` on the overall `Session` object. This works when
//! it happens before the main lint pass, which emits the lints stored by
//! `add_lint()`. To emit lints after the main lint pass (from codegen, for
//! example) requires more effort. See `emit_lint` and `GatherNodeLevels`
//! in `context.rs`.
//!
2020-05-01 20:32:33 +00:00
//! Some code also exists in [rustc_session::lint], [rustc_middle::lint].
//!
//! ## Note
//!
//! This API is completely unstable and subject to change.
#![allow(rustc::potential_query_instability)]
2020-09-23 19:51:56 +00:00
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(array_windows)]
2021-01-29 07:31:08 +00:00
#![feature(box_patterns)]
#![feature(control_flow_enum)]
2022-01-05 12:02:16 +00:00
#![feature(if_let_guard)]
#![feature(iter_intersperse)]
#![feature(iter_order_by)]
#![feature(let_chains)]
2022-09-20 13:41:42 +00:00
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(rustc_attrs)]
2018-12-13 15:57:25 +00:00
#![recursion_limit = "256"]
2022-11-23 20:52:03 +00:00
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
2018-12-13 15:57:25 +00:00
#[macro_use]
2020-03-29 14:41:09 +00:00
extern crate rustc_middle;
#[macro_use]
extern crate rustc_session;
#[macro_use]
extern crate tracing;
mod array_into_iter;
pub mod builtin;
mod context;
mod deref_into_dyn_supertrait;
mod early;
2021-07-31 16:14:30 +00:00
mod enum_intrinsics_non_enums;
mod errors;
mod expect;
2022-10-07 15:59:39 +00:00
mod for_loops_over_fallibles;
pub mod hidden_unicode_codepoints;
2020-01-09 05:49:49 +00:00
mod internal;
mod late;
mod let_underscore;
mod levels;
mod lints;
mod methods;
mod multiple_supertrait_upcastable;
mod non_ascii_idents;
mod non_fmt_panic;
mod nonstandard_style;
2021-01-05 09:07:50 +00:00
mod noop_method_call;
2022-10-02 05:45:15 +00:00
mod opaque_hidden_inferred_bound;
mod pass_by_value;
mod passes;
mod redundant_semicolon;
2020-08-19 10:05:44 +00:00
mod traits;
mod types;
mod unused;
pub use array_into_iter::ARRAY_INTO_ITER;
2020-04-27 17:56:11 +00:00
use rustc_ast as ast;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
2020-03-29 14:41:09 +00:00
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt;
use rustc_session::lint::builtin::{
BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS,
};
use rustc_span::symbol::Ident;
use rustc_span::Span;
use array_into_iter::ArrayIntoIter;
use builtin::*;
use deref_into_dyn_supertrait::*;
2021-07-31 16:14:30 +00:00
use enum_intrinsics_non_enums::EnumIntrinsicsNonEnums;
2022-10-07 15:59:39 +00:00
use for_loops_over_fallibles::*;
use hidden_unicode_codepoints::*;
2020-01-09 05:49:49 +00:00
use internal::*;
use let_underscore::*;
use methods::*;
use multiple_supertrait_upcastable::*;
use non_ascii_idents::*;
use non_fmt_panic::NonPanicFmt;
use nonstandard_style::*;
2021-01-05 09:07:50 +00:00
use noop_method_call::*;
2022-10-02 05:45:15 +00:00
use opaque_hidden_inferred_bound::*;
use pass_by_value::*;
use redundant_semicolon::*;
2020-08-19 10:05:44 +00:00
use traits::*;
use types::*;
use unused::*;
/// Useful for other parts of the compiler / Clippy.
2018-06-09 15:20:58 +00:00
pub use builtin::SoftLints;
pub use context::{CheckLintNameResult, FindLintError, LintStore};
pub use context::{EarlyContext, LateContext, LintContext};
pub use early::{check_ast_node, EarlyCheckNode};
2021-07-13 16:45:20 +00:00
pub use late::{check_crate, unerased_lint_store};
pub use passes::{EarlyLintPass, LateLintPass};
pub use rustc_session::lint::Level::{self, *};
pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Lint, LintId};
pub use rustc_session::lint::{LintArray, LintPass};
2018-06-09 15:20:58 +00:00
pub fn provide(providers: &mut Providers) {
levels::provide(providers);
expect::provide(providers);
2019-01-31 00:36:11 +00:00
*providers = Providers { lint_mod, ..*providers };
}
fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
2019-01-31 00:36:11 +00:00
}
early_lint_methods!(
declare_combined_early_lint_pass,
[
pub BuiltinCombinedPreExpansionLintPass,
[
KeywordIdents: KeywordIdents,
]
]
);
early_lint_methods!(
declare_combined_early_lint_pass,
[
pub BuiltinCombinedEarlyLintPass,
[
2023-01-14 08:52:46 +00:00
UnusedParens: UnusedParens::new(),
UnusedBraces: UnusedBraces,
UnusedImportBraces: UnusedImportBraces,
UnsafeCode: UnsafeCode,
SpecialModuleName: SpecialModuleName,
AnonymousParameters: AnonymousParameters,
EllipsisInclusiveRangePatterns: EllipsisInclusiveRangePatterns::default(),
NonCamelCaseTypes: NonCamelCaseTypes,
DeprecatedAttr: DeprecatedAttr::new(),
WhileTrue: WhileTrue,
NonAsciiIdents: NonAsciiIdents,
HiddenUnicodeCodepoints: HiddenUnicodeCodepoints,
IncompleteFeatures: IncompleteFeatures,
RedundantSemicolons: RedundantSemicolons,
UnusedDocComment: UnusedDocComment,
UnexpectedCfgs: UnexpectedCfgs,
]
]
);
2019-01-31 00:36:11 +00:00
2022-12-07 03:18:19 +00:00
// FIXME: Make a separate lint type which does not require typeck tables.
late_lint_methods!(
declare_combined_late_lint_pass,
[
pub BuiltinCombinedLateLintPass,
[
// Tracks state across modules
UnnameableTestItems: UnnameableTestItems::new(),
// Tracks attributes of parents
MissingDoc: MissingDoc::new(),
// Builds a global list of all impls of `Debug`.
// FIXME: Turn the computation of types which implement Debug into a query
// and change this to a module lint pass
MissingDebugImplementations: MissingDebugImplementations::default(),
// Keeps a global list of foreign declarations.
ClashingExternDeclarations: ClashingExternDeclarations::new(),
]
]
);
2019-01-31 00:36:11 +00:00
late_lint_methods!(
declare_combined_late_lint_pass,
[
BuiltinCombinedModuleLateLintPass,
[
ForLoopsOverFallibles: ForLoopsOverFallibles,
DerefIntoDynSupertrait: DerefIntoDynSupertrait,
HardwiredLints: HardwiredLints,
ImproperCTypesDeclarations: ImproperCTypesDeclarations,
ImproperCTypesDefinitions: ImproperCTypesDefinitions,
VariantSizeDifferences: VariantSizeDifferences,
BoxPointers: BoxPointers,
PathStatements: PathStatements,
LetUnderscore: LetUnderscore,
// Depends on referenced function signatures in expressions
UnusedResults: UnusedResults,
NonUpperCaseGlobals: NonUpperCaseGlobals,
NonShorthandFieldPatterns: NonShorthandFieldPatterns,
UnusedAllocation: UnusedAllocation,
// Depends on types used in type definitions
MissingCopyImplementations: MissingCopyImplementations,
// Depends on referenced function signatures in expressions
MutableTransmutes: MutableTransmutes,
TypeAliasBounds: TypeAliasBounds,
TrivialConstraints: TrivialConstraints,
TypeLimits: TypeLimits::new(),
NonSnakeCase: NonSnakeCase,
InvalidNoMangleItems: InvalidNoMangleItems,
// Depends on effective visibilities
UnreachablePub: UnreachablePub,
ExplicitOutlivesRequirements: ExplicitOutlivesRequirements,
InvalidValue: InvalidValue,
DerefNullPtr: DerefNullPtr,
// May Depend on constants elsewhere
UnusedBrokenConst: UnusedBrokenConst,
UnstableFeatures: UnstableFeatures,
UngatedAsyncFnTrackCaller: UngatedAsyncFnTrackCaller,
ArrayIntoIter: ArrayIntoIter::default(),
DropTraitConstraints: DropTraitConstraints,
TemporaryCStringAsPtr: TemporaryCStringAsPtr,
NonPanicFmt: NonPanicFmt,
NoopMethodCall: NoopMethodCall,
EnumIntrinsicsNonEnums: EnumIntrinsicsNonEnums,
InvalidAtomicOrdering: InvalidAtomicOrdering,
NamedAsmLabels: NamedAsmLabels,
OpaqueHiddenInferredBound: OpaqueHiddenInferredBound,
MultipleSupertraitUpcastable: MultipleSupertraitUpcastable,
]
]
);
2019-01-31 00:36:11 +00:00
pub fn new_lint_store(internal_lints: bool) -> LintStore {
let mut lint_store = LintStore::new();
register_builtins(&mut lint_store);
if internal_lints {
register_internals(&mut lint_store);
}
lint_store
}
/// Tell the `LintStore` about all the built-in lints (the ones
/// defined in this crate and the ones defined in
/// `rustc_session::lint::builtin`).
fn register_builtins(store: &mut LintStore) {
macro_rules! add_lint_group {
($name:expr, $($lint:ident),*) => (
store.register_group(false, $name, None, vec![$(LintId::of($lint)),*]);
)
2018-07-14 14:40:17 +00:00
}
store.register_lints(&BuiltinCombinedPreExpansionLintPass::get_lints());
store.register_lints(&BuiltinCombinedEarlyLintPass::get_lints());
store.register_lints(&BuiltinCombinedModuleLateLintPass::get_lints());
store.register_lints(&BuiltinCombinedLateLintPass::get_lints());
add_lint_group!(
"nonstandard_style",
NON_CAMEL_CASE_TYPES,
NON_SNAKE_CASE,
NON_UPPER_CASE_GLOBALS
);
2019-12-22 22:42:04 +00:00
add_lint_group!(
"unused",
2016-10-09 04:08:07 +00:00
UNUSED_IMPORTS,
UNUSED_VARIABLES,
UNUSED_ASSIGNMENTS,
DEAD_CODE,
UNUSED_MUT,
UNREACHABLE_CODE,
UNREACHABLE_PATTERNS,
2016-10-09 04:08:07 +00:00
UNUSED_MUST_USE,
UNUSED_UNSAFE,
PATH_STATEMENTS,
2017-05-11 08:26:07 +00:00
UNUSED_ATTRIBUTES,
UNUSED_MACROS,
UNUSED_MACRO_RULES,
UNUSED_ALLOCATION,
2018-05-18 22:13:53 +00:00
UNUSED_DOC_COMMENTS,
UNUSED_EXTERN_CRATES,
UNUSED_FEATURES,
UNUSED_LABELS,
UNUSED_PARENS,
2020-03-27 20:54:52 +00:00
UNUSED_BRACES,
REDUNDANT_SEMICOLONS
);
2019-12-22 22:42:04 +00:00
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
add_lint_group!(
"rust_2018_idioms",
2018-05-18 22:13:53 +00:00
BARE_TRAIT_OBJECTS,
UNUSED_EXTERN_CRATES,
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
in which inferable outlives-requirements are linted RFC 2093 (tracking issue #44493) lets us leave off commonsensically inferable `T: 'a` outlives requirements. (A separate feature-gate was split off for the case of 'static lifetimes, for which questions still remain.) Detecting these was requested as an idioms-2018 lint. It turns out that issuing a correct, autofixable suggestion here is somewhat subtle in the presence of other bounds and generic parameters. Basically, we want to handle these three cases: • One outlives-bound. We want to drop the bound altogether, including the colon— MyStruct<'a, T: 'a> ^^^^ help: remove this bound • An outlives bound first, followed by a trait bound. We want to delete the outlives bound and the following plus sign (and hopefully get the whitespace right, too)— MyStruct<'a, T: 'a + MyTrait> ^^^^^ help: remove this bound • An outlives bound after a trait bound. We want to delete the outlives lifetime and the preceding plus sign— MyStruct<'a, T: MyTrait + 'a> ^^^^^ help: remove this bound This gets (slightly) even more complicated in the case of where clauses, where we want to drop the where clause altogether if there's just the one bound. Hopefully the comments are enough to explain what's going on! A script (in Python, sorry) was used to generate the hopefully-sufficiently-exhaustive UI test input. Some of these are split off into a different file because rust-lang-nursery/rustfix#141 (and, causally upstream of that, #53934) prevents them from being `run-rustfix`-tested. We also make sure to include a UI test of a case (copied from RFC 2093) where the outlives-bound can't be inferred. Special thanks to Niko Matsakis for pointing out the `inferred_outlives_of` query, rather than blindly stripping outlives requirements as if we weren't a production compiler and didn't care. This concerns #52042.
2018-08-26 19:22:04 +00:00
ELIDED_LIFETIMES_IN_PATHS,
EXPLICIT_OUTLIVES_REQUIREMENTS // FIXME(#52665, #47816) not always applicable and not all
// macros are ready for this yet.
// UNREACHABLE_PUB,
2019-12-22 22:42:04 +00:00
// FIXME macro crates are not up for this yet, too much
// breakage is seen if we try to encourage this lint.
// MACRO_USE_EXTERN_CRATE
);
2019-12-22 22:42:04 +00:00
// Register renamed and removed lints.
2018-05-18 22:13:53 +00:00
store.register_renamed("single_use_lifetime", "single_use_lifetimes");
store.register_renamed("elided_lifetime_in_path", "elided_lifetimes_in_paths");
store.register_renamed("bare_trait_object", "bare_trait_objects");
store.register_renamed("unstable_name_collision", "unstable_name_collisions");
store.register_renamed("unused_doc_comment", "unused_doc_comments");
store.register_renamed("async_idents", "keyword_idents");
2020-02-18 21:49:47 +00:00
store.register_renamed("exceeding_bitshifts", "arithmetic_overflow");
store.register_renamed("redundant_semicolon", "redundant_semicolons");
store.register_renamed("overlapping_patterns", "overlapping_range_endpoints");
store.register_renamed("safe_packed_borrows", "unaligned_references");
2021-06-29 14:05:32 +00:00
store.register_renamed("disjoint_capture_migration", "rust_2021_incompatible_closure_captures");
store.register_renamed("or_patterns_back_compat", "rust_2021_incompatible_or_patterns");
2021-06-29 18:33:31 +00:00
store.register_renamed("non_fmt_panic", "non_fmt_panics");
// These were moved to tool lints, but rustc still sees them when compiling normally, before
// tool lints are registered, so `check_tool_name_for_backwards_compat` doesn't work. Use
// `register_removed` explicitly.
const RUSTDOC_LINTS: &[&str] = &[
"broken_intra_doc_links",
"private_intra_doc_links",
"missing_crate_level_docs",
"missing_doc_code_examples",
"private_doc_tests",
"invalid_codeblock_attributes",
"invalid_html_tags",
"non_autolinks",
];
for rustdoc_lint in RUSTDOC_LINTS {
store.register_ignored(rustdoc_lint);
}
store.register_removed(
"intra_doc_link_resolution_failure",
"use `rustdoc::broken_intra_doc_links` instead",
);
store.register_removed("rustdoc", "use `rustdoc::all` instead");
store.register_removed("unknown_features", "replaced by an error");
store.register_removed("unsigned_negation", "replaced by negate_unsigned feature gate");
store.register_removed("negate_unsigned", "cast a signed value instead");
store.register_removed("raw_pointer_derive", "using derive with raw pointers is ok");
// Register lint group aliases.
store.register_group_alias("nonstandard_style", "bad_style");
// This was renamed to `raw_pointer_derive`, which was then removed,
// so it is also considered removed.
store.register_removed("raw_pointer_deriving", "using derive with raw pointers is ok");
store.register_removed("drop_with_repr_extern", "drop flags have been removed");
store.register_removed("fat_ptr_transmutes", "was accidentally removed back in 2014");
store.register_removed("deprecated_attr", "use `deprecated` instead");
store.register_removed(
"transmute_from_fn_item_types",
"always cast functions before transmuting them",
);
store.register_removed(
"hr_lifetime_in_assoc_type",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #33685 \
<https://github.com/rust-lang/rust/issues/33685> for more information",
);
store.register_removed(
"inaccessible_extern_crate",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36886 \
<https://github.com/rust-lang/rust/issues/36886> for more information",
);
store.register_removed(
"super_or_self_in_global_path",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36888 \
<https://github.com/rust-lang/rust/issues/36888> for more information",
);
store.register_removed(
"overlapping_inherent_impls",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36889 \
<https://github.com/rust-lang/rust/issues/36889> for more information",
);
store.register_removed(
"illegal_floating_point_constant_pattern",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36890 \
<https://github.com/rust-lang/rust/issues/36890> for more information",
);
store.register_removed(
"illegal_struct_or_enum_constant_pattern",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36891 \
<https://github.com/rust-lang/rust/issues/36891> for more information",
);
store.register_removed(
"lifetime_underscore",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36892 \
<https://github.com/rust-lang/rust/issues/36892> for more information",
);
store.register_removed(
"extra_requirement_in_impl",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #37166 \
<https://github.com/rust-lang/rust/issues/37166> for more information",
);
store.register_removed(
"legacy_imports",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #38260 \
<https://github.com/rust-lang/rust/issues/38260> for more information",
);
2018-03-14 04:04:29 +00:00
store.register_removed(
"coerce_never",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #48950 \
<https://github.com/rust-lang/rust/issues/48950> for more information",
2018-03-14 04:04:29 +00:00
);
store.register_removed(
"resolve_trait_on_defaulted_unit",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #48950 \
<https://github.com/rust-lang/rust/issues/48950> for more information",
2018-03-14 04:04:29 +00:00
);
store.register_removed(
"private_no_mangle_fns",
"no longer a warning, `#[no_mangle]` functions always exported",
);
store.register_removed(
"private_no_mangle_statics",
"no longer a warning, `#[no_mangle]` statics always exported",
);
store.register_removed("bad_repr", "replaced with a generic attribute input check");
store.register_removed(
"duplicate_matcher_binding_name",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #57742 \
<https://github.com/rust-lang/rust/issues/57742> for more information",
);
store.register_removed(
"incoherent_fundamental_impls",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #46205 \
<https://github.com/rust-lang/rust/issues/46205> for more information",
);
2019-08-03 14:59:05 +00:00
store.register_removed(
"legacy_constructor_visibility",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #39207 \
<https://github.com/rust-lang/rust/issues/39207> for more information",
2019-08-03 14:59:05 +00:00
);
store.register_removed(
"legacy_directory_ownership",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #37872 \
<https://github.com/rust-lang/rust/issues/37872> for more information",
2019-08-03 15:42:17 +00:00
);
2019-08-03 17:34:21 +00:00
store.register_removed(
"safe_extern_statics",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #36247 \
<https://github.com/rust-lang/rust/issues/36247> for more information",
2019-08-03 17:34:21 +00:00
);
store.register_removed(
"parenthesized_params_in_types_and_modules",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #42238 \
<https://github.com/rust-lang/rust/issues/42238> for more information",
);
2019-08-03 18:29:45 +00:00
store.register_removed(
"duplicate_macro_exports",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #35896 \
<https://github.com/rust-lang/rust/issues/35896> for more information",
2019-08-03 18:29:45 +00:00
);
2019-08-03 19:59:22 +00:00
store.register_removed(
"nested_impl_trait",
2020-02-07 12:06:35 +00:00
"converted into hard error, see issue #59014 \
<https://github.com/rust-lang/rust/issues/59014> for more information",
2019-08-03 19:59:22 +00:00
);
store.register_removed("plugin_as_library", "plugins have been deprecated and retired");
store.register_removed(
"unsupported_naked_functions",
"converted into hard error, see RFC 2972 \
<https://github.com/rust-lang/rfcs/blob/master/text/2972-constrained-naked.md> for more information",
);
store.register_removed(
"mutable_borrow_reservation_conflict",
"now allowed, see issue #59159 \
<https://github.com/rust-lang/rust/issues/59159> for more information",
);
2022-09-21 11:05:20 +00:00
store.register_removed(
"const_err",
"converted into hard error, see issue #71800 \
<https://github.com/rust-lang/rust/issues/71800> for more information",
);
}
fn register_internals(store: &mut LintStore) {
store.register_lints(&LintPassImpl::get_lints());
2021-08-05 03:39:52 +00:00
store.register_early_pass(|| Box::new(LintPassImpl));
store.register_lints(&DefaultHashTypes::get_lints());
store.register_late_pass(|_| Box::new(DefaultHashTypes));
2022-01-05 12:02:16 +00:00
store.register_lints(&QueryStability::get_lints());
store.register_late_pass(|_| Box::new(QueryStability));
2020-11-29 21:34:41 +00:00
store.register_lints(&ExistingDocKeyword::get_lints());
store.register_late_pass(|_| Box::new(ExistingDocKeyword));
store.register_lints(&TyTyKind::get_lints());
store.register_late_pass(|_| Box::new(TyTyKind));
store.register_lints(&Diagnostics::get_lints());
store.register_late_pass(|_| Box::new(Diagnostics));
store.register_lints(&BadOptAccess::get_lints());
store.register_late_pass(|_| Box::new(BadOptAccess));
store.register_lints(&PassByValue::get_lints());
store.register_late_pass(|_| Box::new(PassByValue));
// FIXME(davidtwco): deliberately do not include `UNTRANSLATABLE_DIAGNOSTIC` and
// `DIAGNOSTIC_OUTSIDE_OF_IMPL` here because `-Wrustc::internal` is provided to every crate and
// these lints will trigger all of the time - change this once migration to diagnostic structs
// and translation is completed
store.register_group(
false,
2019-06-17 15:06:11 +00:00
"rustc::internal",
None,
vec![
LintId::of(DEFAULT_HASH_TYPES),
2022-01-05 12:02:16 +00:00
LintId::of(POTENTIAL_QUERY_INSTABILITY),
LintId::of(USAGE_OF_TY_TYKIND),
LintId::of(PASS_BY_VALUE),
LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO),
LintId::of(USAGE_OF_QUALIFIED_TY),
2020-11-29 21:34:41 +00:00
LintId::of(EXISTING_DOC_KEYWORD),
LintId::of(BAD_OPT_ACCESS),
],
);
}
#[cfg(test)]
mod tests;