repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/cargo/common_metadata.rs
src/tools/clippy/clippy_lints/src/cargo/common_metadata.rs
use cargo_metadata::Metadata; use clippy_utils::diagnostics::span_lint; use rustc_lint::LateContext; use rustc_span::DUMMY_SP; use super::CARGO_COMMON_METADATA; pub(super) fn check(cx: &LateContext<'_>, metadata: &Metadata, ignore_publish: bool) { for package in &metadata.packages { // only run the lint i...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs
src/tools/clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs
use clippy_utils::diagnostics::span_lint_hir_and_then; use clippy_utils::has_non_exhaustive_attr; use clippy_utils::ty::implements_trait_with_env; use rustc_errors::Applicability; use rustc_hir::def_id::DefId; use rustc_hir::{self as hir, HirId}; use rustc_lint::LateContext; use rustc_middle::ty::{self, ClauseKind, Gen...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/unsafe_derive_deserialize.rs
src/tools/clippy/clippy_lints/src/derive/unsafe_derive_deserialize.rs
use std::ops::ControlFlow; use clippy_utils::diagnostics::span_lint_hir_and_then; use clippy_utils::{is_lint_allowed, paths}; use rustc_hir::def_id::LocalDefId; use rustc_hir::intravisit::{FnKind, Visitor, walk_expr, walk_fn, walk_item}; use rustc_hir::{self as hir, BlockCheckMode, BodyId, Expr, ExprKind, FnDecl, HirI...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/derive_ord_xor_partial_ord.rs
src/tools/clippy/clippy_lints/src/derive/derive_ord_xor_partial_ord.rs
use clippy_utils::diagnostics::span_lint_hir_and_then; use rustc_hir::{self as hir, HirId}; use rustc_lint::LateContext; use rustc_middle::ty::Ty; use rustc_span::{Span, sym}; use super::DERIVE_ORD_XOR_PARTIAL_ORD; /// Implementation of the `DERIVE_ORD_XOR_PARTIAL_ORD` lint. pub(super) fn check<'tcx>( cx: &LateCo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/mod.rs
src/tools/clippy/clippy_lints/src/derive/mod.rs
use clippy_utils::res::MaybeResPath; use rustc_hir::def::Res; use rustc_hir::{Impl, Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::declare_lint_pass; mod derive_ord_xor_partial_ord; mod derive_partial_eq_without_eq; mod derived_hash_with_manual_eq; mod expl_impl_clone_on_copy; mod uns...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/expl_impl_clone_on_copy.rs
src/tools/clippy/clippy_lints/src/derive/expl_impl_clone_on_copy.rs
use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::fulfill_or_allowed; use clippy_utils::ty::{implements_trait, is_copy}; use rustc_hir::{self as hir, HirId, Item}; use rustc_lint::LateContext; use rustc_middle::ty::{self, GenericArgKind, Ty}; use super::EXPL_IMPL_CLONE_ON_COPY; /// Implementation o...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/derive/derived_hash_with_manual_eq.rs
src/tools/clippy/clippy_lints/src/derive/derived_hash_with_manual_eq.rs
use clippy_utils::diagnostics::span_lint_hir_and_then; use rustc_hir::{HirId, TraitRef}; use rustc_lint::LateContext; use rustc_middle::ty::Ty; use rustc_span::{Span, sym}; use super::DERIVED_HASH_WITH_MANUAL_EQ; /// Implementation of the `DERIVED_HASH_WITH_MANUAL_EQ` lint. pub(super) fn check<'tcx>( cx: &LateCon...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/unneeded_wildcard_pattern.rs
src/tools/clippy/clippy_lints/src/misc_early/unneeded_wildcard_pattern.rs
use clippy_utils::diagnostics::span_lint_and_sugg; use rustc_ast::ast::{Pat, PatKind}; use rustc_errors::Applicability; use rustc_lint::EarlyContext; use rustc_span::Span; use super::UNNEEDED_WILDCARD_PATTERN; pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { if let PatKind::TupleStruct(_, _, ref patterns) ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/redundant_pattern.rs
src/tools/clippy/clippy_lints/src/misc_early/redundant_pattern.rs
use clippy_utils::diagnostics::span_lint_and_sugg; use rustc_ast::ast::{Pat, PatKind}; use rustc_errors::Applicability; use rustc_lint::EarlyContext; use super::REDUNDANT_PATTERN; pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { if let PatKind::Ident(ann, ident, Some(ref right)) = pat.kind && let P...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/unneeded_field_pattern.rs
src/tools/clippy/clippy_lints/src/misc_early/unneeded_field_pattern.rs
use clippy_utils::diagnostics::{span_lint, span_lint_and_then}; use clippy_utils::source::SpanRangeExt; use itertools::Itertools; use rustc_ast::ast::{Pat, PatKind}; use rustc_lint::EarlyContext; use super::UNNEEDED_FIELD_PATTERN; pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { if let PatKind::Struct(_, r...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/mixed_case_hex_literals.rs
src/tools/clippy/clippy_lints/src/misc_early/mixed_case_hex_literals.rs
use clippy_utils::diagnostics::span_lint_and_help; use rustc_lint::EarlyContext; use rustc_span::Span; use super::MIXED_CASE_HEX_LITERALS; pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, suffix: &str, lit_snip: &str) { let num_end_idx = match lit_snip.strip_suffix(suffix) { Some(p) if p.ends_wi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/literal_suffix.rs
src/tools/clippy/clippy_lints/src/misc_early/literal_suffix.rs
use clippy_utils::diagnostics::span_lint_and_then; use rustc_errors::Applicability; use rustc_lint::EarlyContext; use rustc_span::Span; use super::{SEPARATED_LITERAL_SUFFIX, UNSEPARATED_LITERAL_SUFFIX}; pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, lit_snip: &str, suffix: &str, sugg_type: &str) { let...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/mod.rs
src/tools/clippy/clippy_lints/src/misc_early/mod.rs
mod builtin_type_shadow; mod literal_suffix; mod mixed_case_hex_literals; mod redundant_at_rest_pattern; mod redundant_pattern; mod unneeded_field_pattern; mod unneeded_wildcard_pattern; mod zero_prefixed_literal; use clippy_utils::source::snippet_opt; use rustc_ast::ast::{Expr, ExprKind, Generics, LitFloatType, LitIn...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/redundant_at_rest_pattern.rs
src/tools/clippy/clippy_lints/src/misc_early/redundant_at_rest_pattern.rs
use clippy_utils::diagnostics::span_lint_and_sugg; use rustc_ast::{Pat, PatKind}; use rustc_errors::Applicability; use rustc_lint::{EarlyContext, LintContext}; use super::REDUNDANT_AT_REST_PATTERN; pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { if !pat.span.in_external_macro(cx.sess().source_map()) ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/builtin_type_shadow.rs
src/tools/clippy/clippy_lints/src/misc_early/builtin_type_shadow.rs
use clippy_utils::diagnostics::span_lint; use rustc_ast::ast::{GenericParam, GenericParamKind}; use rustc_hir::PrimTy; use rustc_lint::EarlyContext; use super::BUILTIN_TYPE_SHADOW; pub(super) fn check(cx: &EarlyContext<'_>, param: &GenericParam) { if let GenericParamKind::Type { .. } = param.kind && let S...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints/src/misc_early/zero_prefixed_literal.rs
src/tools/clippy/clippy_lints/src/misc_early/zero_prefixed_literal.rs
use clippy_utils::diagnostics::span_lint_and_then; use rustc_errors::Applicability; use rustc_lint::EarlyContext; use rustc_span::Span; use super::ZERO_PREFIXED_LITERAL; pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, lit_snip: &str) { let trimmed_lit_snip = lit_snip.trim_start_matches(['_', '0']); ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/rustc_tools_util/src/lib.rs
src/tools/clippy/rustc_tools_util/src/lib.rs
use std::path::PathBuf; use std::process::Command; use std::str; /// This macro creates the version string during compilation from the /// current environment #[macro_export] macro_rules! get_version_info { () => {{ let major = std::env!("CARGO_PKG_VERSION_MAJOR").parse::<u8>().unwrap(); let minor ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/repeated_is_diagnostic_item.rs
src/tools/clippy/clippy_lints_internal/src/repeated_is_diagnostic_item.rs
use std::iter; use std::ops::ControlFlow; use crate::internal_paths::MAYBE_DEF; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::res::{MaybeDef, MaybeTypeckRes}; use clippy_utils::source::{snippet_indent, snippet_with_applicability}; use clippy_utils::visitors::for_each_expr; use clippy_utils::{eq_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/lib.rs
src/tools/clippy/clippy_lints_internal/src/lib.rs
#![feature(rustc_private)] #![allow( clippy::missing_docs_in_private_items, clippy::must_use_candidate, clippy::symbol_as_str, rustc::diagnostic_outside_of_impl, rustc::untranslatable_diagnostic )] #![warn( trivial_casts, trivial_numeric_casts, rust_2018_idioms, unused_lifetimes, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs
src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs
use clippy_utils::diagnostics::span_lint; use clippy_utils::paths; use rustc_ast::tokenstream::{TokenStream, TokenTree}; use rustc_ast::{AttrStyle, DelimArgs}; use rustc_hir::attrs::AttributeKind; use rustc_hir::def::Res; use rustc_hir::def_id::LocalDefId; use rustc_hir::{ AttrArgs, AttrItem, AttrPath, Attribute, H...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/unsorted_clippy_utils_paths.rs
src/tools/clippy/clippy_lints_internal/src/unsorted_clippy_utils_paths.rs
use clippy_utils::diagnostics::span_lint; use clippy_utils::sym; use rustc_ast::ast::{Crate, ItemKind, ModKind}; use rustc_lint::{EarlyContext, EarlyLintPass}; use rustc_session::{declare_lint_pass, declare_tool_lint}; declare_tool_lint! { /// ### What it does /// Checks that [`clippy_utils::paths`] is sorted ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/lint_without_lint_pass.rs
src/tools/clippy/clippy_lints_internal/src/lint_without_lint_pass.rs
use crate::internal_paths; use clippy_utils::diagnostics::{span_lint, span_lint_and_help}; use clippy_utils::macros::root_macro_call_first_node; use clippy_utils::{is_lint_allowed, sym}; use rustc_ast::ast::LitKind; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_hir as hir; use rustc_hir::def::{DefK...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/internal_paths.rs
src/tools/clippy/clippy_lints_internal/src/internal_paths.rs
use clippy_utils::paths::{PathLookup, PathNS}; use clippy_utils::{sym, type_path, value_path}; // Paths inside rustc pub static APPLICABILITY: PathLookup = type_path!(rustc_errors::Applicability); pub static EARLY_CONTEXT: PathLookup = type_path!(rustc_lint::EarlyContext); pub static EARLY_LINT_PASS: PathLookup = type...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/symbols.rs
src/tools/clippy/clippy_lints_internal/src/symbols.rs
use crate::internal_paths; use clippy_utils::diagnostics::span_lint_and_then; use rustc_ast::LitKind; use rustc_data_structures::fx::FxHashMap; use rustc_errors::Applicability; use rustc_hir::def::{DefKind, Res}; use rustc_hir::{Expr, ExprKind, Lit, Node, Pat, PatExprKind, PatKind}; use rustc_lint::{LateContext, LateLi...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs
src/tools/clippy/clippy_lints_internal/src/almost_standard_lint_formulation.rs
use crate::lint_without_lint_pass::is_lint_ref_type; use clippy_utils::diagnostics::span_lint_and_help; use regex::Regex; use rustc_ast::token::DocFragmentKind; use rustc_hir::{Attribute, Item, ItemKind, Mutability}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_tool_lint, impl_lint_pass}; us...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/collapsible_calls.rs
src/tools/clippy/clippy_lints_internal/src/collapsible_calls.rs
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet; use clippy_utils::{SpanlessEq, is_lint_allowed, peel_blocks_with_stmt}; use rustc_errors::Applicability; use rustc_hir::{Closure, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_lint_pass, dec...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/msrv_attr_impl.rs
src/tools/clippy/clippy_lints_internal/src/msrv_attr_impl.rs
use crate::internal_paths; use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet; use clippy_utils::sym; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::ty::{self, GenericArgKind}; use rustc_session::{decla...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/outer_expn_data_pass.rs
src/tools/clippy/clippy_lints_internal/src/outer_expn_data_pass.rs
use crate::internal_paths; use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::{is_lint_allowed, method_calls, sym}; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_lint::{LateContext, LateLintPass}; use rustc_lint_defs::declare_tool_lint; use rustc_session::declare_lint_pass; declare...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/produce_ice.rs
src/tools/clippy/clippy_lints_internal/src/produce_ice.rs
use rustc_ast::ast::NodeId; use rustc_ast::visit::FnKind; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::Span; declare_tool_lint! { /// ### What it does /// Not an actual lint. This lint is only meant for testing our custom...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/unusual_names.rs
src/tools/clippy/clippy_lints_internal/src/unusual_names.rs
use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::paths::PathLookup; use clippy_utils::sym; use itertools::Itertools; use rustc_hir::def_id::LocalDefId; use rustc_hir::intravisit::FnKind; use rustc_hir::{Body, FnDecl, Pat, PatKind, Stmt, StmtKind}; use rustc_lint::{LateContext, LateLintPass}; use rus...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_lints_internal/src/unnecessary_def_path.rs
src/tools/clippy/clippy_lints_internal/src/unnecessary_def_path.rs
use crate::internal_paths; use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::paths::{PathNS, lookup_path}; use clippy_utils::peel_ref_operators; use clippy_utils::res::MaybeQPath; use rustc_hir::def_id::DefId; use rustc_hir::{Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_lin...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_test_deps/src/main.rs
src/tools/clippy/clippy_test_deps/src/main.rs
fn main() {}
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/combiner.rs
src/tools/rust-installer/src/combiner.rs
use std::io::{Read, Write}; use std::path::Path; use anyhow::{Context, Result, bail}; use tar::Archive; use super::{Scripter, Tarballer}; use crate::compression::{CompressionFormat, CompressionFormats, CompressionProfile}; use crate::util::*; actor! { #[derive(Debug)] pub struct Combiner { /// The na...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/lib.rs
src/tools/rust-installer/src/lib.rs
#[macro_use] mod util; mod combiner; mod compression; mod generator; mod scripter; mod tarballer; pub use crate::combiner::Combiner; pub use crate::generator::Generator; pub use crate::scripter::Scripter; pub use crate::tarballer::Tarballer; /// The installer version, output only to be used by combine-installers.sh....
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/tarballer.rs
src/tools/rust-installer/src/tarballer.rs
use std::fs::{read_link, symlink_metadata}; use std::io::{BufWriter, Write}; use std::path::Path; use anyhow::{Context, Result, bail}; use tar::{Builder, Header, HeaderMode}; use walkdir::WalkDir; use crate::compression::{CombinedEncoder, CompressionFormats, CompressionProfile}; use crate::util::*; actor! { #[de...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/util.rs
src/tools/rust-installer/src/util.rs
use std::fs; // Needed to set the script mode to executable. #[cfg(unix)] use std::os::unix::fs::OpenOptionsExt; // FIXME: what about Windows? Are default ACLs executable? #[cfg(unix)] use std::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use std::os::windows::fs::symlink_file; use std::path::Path; use anyho...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/generator.rs
src/tools/rust-installer/src/generator.rs
use std::collections::BTreeSet; use std::io::Write; use std::path::Path; use anyhow::{Context, Result, bail, format_err}; use super::{Scripter, Tarballer}; use crate::compression::{CompressionFormats, CompressionProfile}; use crate::util::*; actor! { #[derive(Debug)] pub struct Generator { /// The na...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/compression.rs
src/tools/rust-installer/src/compression.rs
use std::fmt; use std::io::{Read, Write}; use std::path::Path; use std::str::FromStr; use anyhow::{Context, Error}; use flate2::read::GzDecoder; use flate2::write::GzEncoder; use rayon::prelude::*; use xz2::read::XzDecoder; use xz2::write::XzEncoder; #[derive(Default, Debug, Copy, Clone)] pub enum CompressionProfile ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/main.rs
src/tools/rust-installer/src/main.rs
use anyhow::{Context, Result}; use clap::Parser; #[derive(Parser)] struct CommandLine { #[clap(subcommand)] command: Subcommand, } #[derive(clap::Subcommand)] enum Subcommand { Generate(installer::Generator), Combine(installer::Combiner), Script(installer::Scripter), Tarball(installer::Tarball...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rust-installer/src/scripter.rs
src/tools/rust-installer/src/scripter.rs
use std::io::Write; use anyhow::{Context, Result}; use crate::util::*; const TEMPLATE: &str = include_str!("../install-template.sh"); actor! { #[derive(Debug)] pub struct Scripter { /// The name of the product, for display #[arg(value_name = "NAME")] product_name: String = "Product",...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/json_find.rs
src/tools/jsondoclint/src/json_find.rs
use std::fmt::Write; use serde::Serialize; use serde_json::Value; #[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub enum SelectorPart { Field(String), Index(usize), } pub type Selector = Vec<SelectorPart>; pub fn to_jsonpath(sel: &Selector) -> String { let mut s = String::from("$"); for part in ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/item_kind.rs
src/tools/jsondoclint/src/item_kind.rs
use rustdoc_json_types::{Item, ItemEnum, ItemKind, ItemSummary}; /// A universal way to represent an [`ItemEnum`] or [`ItemKind`] #[derive(Debug, Clone, Copy)] pub(crate) enum Kind { Module, ExternCrate, Use, Struct, StructField, Union, Enum, Variant, Function, TypeAlias, Co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/validator.rs
src/tools/jsondoclint/src/validator.rs
use std::collections::HashSet; use std::hash::Hash; use rustdoc_json_types::{ AssocItemConstraint, AssocItemConstraintKind, Constant, Crate, DynTrait, Enum, Function, FunctionPointer, FunctionSignature, GenericArg, GenericArgs, GenericBound, GenericParamDef, Generics, Id, Impl, ItemEnum, ItemSummary, Modul...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/main.rs
src/tools/jsondoclint/src/main.rs
use std::io::{BufWriter, Write}; use std::path::{Path, PathBuf}; use anyhow::{Result, bail}; use clap::Parser; use fs_err as fs; use rustdoc_json_types::{Crate, FORMAT_VERSION, Id}; use serde::Serialize; use serde_json::Value; pub(crate) mod item_kind; mod json_find; mod validator; #[derive(Debug, PartialEq, Eq, Ser...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/json_find/tests.rs
src/tools/jsondoclint/src/json_find/tests.rs
use super::*; #[test] fn basic_find() { use SelectorPart::*; let j = serde_json::json!({ "index": { "4": { "inner": { "items": ["1", "2", "3"] } } } }); let sel = find_selector(&j, &serde_json::json!("1")); ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/jsondoclint/src/validator/tests.rs
src/tools/jsondoclint/src/validator/tests.rs
use rustc_hash::FxHashMap; use rustdoc_json_types::{Abi, FORMAT_VERSION, FunctionHeader, Item, ItemKind, Visibility}; use super::*; use crate::json_find::SelectorPart; #[track_caller] fn check(krate: &Crate, errs: &[Error]) { let krate_string = serde_json::to_string(krate).unwrap(); let krate_json = serde_jso...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/unstable-book-gen/src/main.rs
src/tools/unstable-book-gen/src/main.rs
//! Auto-generate stub docs for the unstable book use std::collections::BTreeSet; use std::env; use std::fs::{self, write}; use std::path::Path; use tidy::diagnostics::RunningCheck; use tidy::features::{Features, collect_env_vars, collect_lang_features, collect_lib_features}; use tidy::t; use tidy::unstable_book::{ ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/lld-wrapper/src/main.rs
src/tools/lld-wrapper/src/main.rs
//! Script to invoke the bundled rust-lld with the correct flavor. //! //! `lld` supports multiple command line interfaces. If `-flavor <flavor>` are passed as the first //! two arguments the `<flavor>` command line interface is used to process the remaining arguments. //! If no `-flavor` argument is present the flavor...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/linkchecker/main.rs
src/tools/linkchecker/main.rs
//! Script to check the validity of `href` links in our HTML documentation. //! //! In the past we've been quite error prone to writing in broken links as most //! of them are manually rather than automatically added. As files move over //! time or apis change old links become stale or broken. The purpose of this //! s...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/linkchecker/tests/checks.rs
src/tools/linkchecker/tests/checks.rs
use std::path::Path; use std::process::{Command, ExitStatus}; fn run(dirname: &str) -> (ExitStatus, String, String) { let output = Command::new(env!("CARGO_BIN_EXE_linkchecker")) .current_dir(Path::new(env!("CARGO_MANIFEST_DIR")).join("tests")) .arg(dirname) .output() .unwrap(); ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/remote-test-client/src/main.rs
src/tools/remote-test-client/src/main.rs
//! This is a small client program intended to pair with `remote-test-server` in //! this repository. This client connects to the server over TCP and is used to //! push artifacts and run tests on the server instead of locally. //! //! Here is also where we bake in the support to spawn the QEMU emulator as //! well. u...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/remote-test-client/tests/lib.rs
src/tools/remote-test-client/tests/lib.rs
#[test] fn test_help() { let mut cmd = assert_cmd::cargo::cargo_bin_cmd!(); cmd.arg("help"); let output = cmd.unwrap(); let stdout = String::from_utf8(output.stdout.clone()).unwrap(); assert!(stdout.trim().starts_with("Usage:")); } #[test] fn test_timeout() { let mut cmd = assert_cmd::cargo::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/generate-windows-sys/src/main.rs
src/tools/generate-windows-sys/src/main.rs
use std::error::Error; use std::io::{Read, Seek, SeekFrom, Write}; use std::path::PathBuf; use std::{env, fs}; /// 32-bit ARM is not supported by Microsoft so ARM types are not generated. /// Therefore we need to inject a few types to make the bindings work. const ARM32_SHIM: &str = r#" #[cfg(target_arch = "arm")] #[r...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/rustdoc_templates.rs
src/tools/tidy/src/rustdoc_templates.rs
//! Tidy check to ensure that rustdoc templates didn't forget a `{# #}` to strip extra whitespace //! characters. use std::ffi::OsStr; use std::path::Path; use ignore::DirEntry; use crate::diagnostics::{CheckId, TidyCtx}; use crate::walk::walk; // Array containing `("beginning of tag", "end of tag")`. const TAGS: &...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/diagnostics.rs
src/tools/tidy/src/diagnostics.rs
use std::collections::HashSet; use std::fmt::{Display, Formatter}; use std::io; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use termcolor::Color; /// CLI flags used by tidy. #[derive(Clone, Default)] pub struct TidyFlags { /// Applies style and formatting changes during a tidy run. bless: boo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/fluent_used.rs
src/tools/tidy/src/fluent_used.rs
//! Checks that all Fluent messages appear at least twice use std::collections::HashMap; use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::walk::{filter_dirs, walk}; fn filter_used_messages( contents: &str, msgs_not_appeared_yet: &mut HashMap<String, String>, msgs_appeared_only_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/fluent_alphabetical.rs
src/tools/tidy/src/fluent_alphabetical.rs
//! Checks that all Flunt files have messages in alphabetical order use std::collections::HashMap; use std::fs::OpenOptions; use std::io::Write; use std::path::Path; use fluent_syntax::ast::Entry; use fluent_syntax::parser; use regex::Regex; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; use crate::walk::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/lib.rs
src/tools/tidy/src/lib.rs
//! Library used by tidy and other tools. //! //! This library contains the tidy lints and exposes it //! to be used by tools. use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::process::Command; use std::{env, io}; use build_helper::ci::CiEnv; use build_helper::git::{GitConfig, get_closest_upstream_commit...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/alphabetical.rs
src/tools/tidy/src/alphabetical.rs
//! Checks that a list of items is in alphabetical order //! //! Use the following marker in the code: //! ```rust //! // tidy-alphabetical-start //! fn aaa() {} //! fn eee() {} //! fn z() {} //! // tidy-alphabetical-end //! ``` //! //! Empty lines and lines starting (ignoring spaces) with `//` or `#` (except those sta...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/gcc_submodule.rs
src/tools/tidy/src/gcc_submodule.rs
//! Tidy check to ensure that the commit SHA of the `src/gcc` submodule is the same as the //! required GCC version of the GCC codegen backend. use std::path::Path; use std::process::Command; use crate::diagnostics::TidyCtx; pub fn check(root_path: &Path, compiler_path: &Path, tidy_ctx: TidyCtx) { let mut check ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/rustdoc_css_themes.rs
src/tools/tidy/src/rustdoc_css_themes.rs
//! Tidy check to make sure light and dark themes are synchronized between //! JS-controlled rustdoc.css and noscript.css use std::path::Path; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; pub fn check(librustdoc_path: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check(CheckId::new("rus...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/ui_tests.rs
src/tools/tidy/src/ui_tests.rs
//! Tidy check to ensure below in UI test directories: //! - there are no stray `.stderr` files use std::collections::BTreeSet; use std::ffi::OsStr; use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; const ISSUES_TXT_HEADER: &str = r#"==========...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/rustdoc_gui_tests.rs
src/tools/tidy/src/rustdoc_gui_tests.rs
//! Tidy check to ensure that rustdoc GUI tests start with a small description. use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; pub fn check(path: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check(CheckId::new("rustdoc_gui_tests").path(path)); crate::walk::walk( &path...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/bins.rs
src/tools/tidy/src/bins.rs
//! Tidy check to ensure that there are no binaries checked into the source tree //! by accident. //! //! In the past we've accidentally checked in test binaries and such which add a //! huge amount of bloat to the Git history, so it's good to just ensure we //! don't do that again. pub use os_impl::*; // All files a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/unknown_revision.rs
src/tools/tidy/src/unknown_revision.rs
//! Checks that test revision names appearing in header directives and error //! annotations have actually been declared in `revisions`. // FIXME(jieyouxu) Ideally these checks would be integrated into compiletest's // own directive and revision handling, but for now they've been split out as a // separate `tidy` chec...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/filenames.rs
src/tools/tidy/src/filenames.rs
//! Tidy check to ensure that there are no filenames containing forbidden characters //! checked into the source tree by accident: //! - Non-UTF8 filenames //! - Control characters such as CR or TAB //! - Filenames containing ":" as they are not supported on Windows //! //! Only files added to git are checked, as it ma...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/pal.rs
src/tools/tidy/src/pal.rs
//! Tidy check to enforce rules about platform-specific code in std. //! //! This is intended to maintain existing standards of code //! organization in hopes that the standard library will continue to //! be refactored to isolate platform-specific bits, making porting //! easier; where "standard library" roughly means...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/known_bug.rs
src/tools/tidy/src/known_bug.rs
//! Tidy check to ensure that tests inside 'tests/crashes' have a '@known-bug' directive. use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::walk::*; pub fn check(filepath: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check(CheckId::new("known_bug").path(filepath)); wal...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/error_codes.rs
src/tools/tidy/src/error_codes.rs
//! Tidy check to ensure error codes are properly documented and tested. //! //! Overview of check: //! //! 1. We create a list of error codes used by the compiler. Error codes are extracted from `compiler/rustc_error_codes/src/lib.rs`. //! //! 2. We check that the error code has a long-form explanation in `compiler/ru...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs
src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs
//! Checks that there are no unpaired `.stderr` or `.stdout` for a test with and without revisions. use std::collections::{BTreeMap, BTreeSet}; use std::ffi::OsStr; use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::iter_header::*; use crate::walk::*; // Should be kept in sync with `CompareM...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/edition.rs
src/tools/tidy/src/edition.rs
//! Tidy check to ensure that crate `edition` is '2021' or '2024'. use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::walk::{filter_dirs, walk}; pub fn check(path: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check(CheckId::new("edition").path(path)); walk(path, |path, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/triagebot.rs
src/tools/tidy/src/triagebot.rs
//! Tidy check to ensure paths mentioned in triagebot.toml exist in the project. use std::path::Path; use toml::Value; use crate::diagnostics::TidyCtx; pub fn check(path: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check("triagebot"); let triagebot_path = path.join("triagebot.toml"); // ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/walk.rs
src/tools/tidy/src/walk.rs
use std::ffi::OsStr; use std::fs::File; use std::io::Read; use std::path::Path; use ignore::DirEntry; /// The default directory filter. pub fn filter_dirs(path: &Path) -> bool { // bootstrap/etc let skip = [ "tidy-test-file", "compiler/rustc_codegen_cranelift", "compiler/rustc_codegen_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/deps.rs
src/tools/tidy/src/deps.rs
//! Checks the licenses of third-party dependencies. use std::collections::{HashMap, HashSet}; use std::fmt::{Display, Formatter}; use std::fs::{File, read_dir}; use std::io::Write; use std::path::Path; use build_helper::ci::CiEnv; use cargo_metadata::semver::Version; use cargo_metadata::{Metadata, Package, PackageId...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/unit_tests.rs
src/tools/tidy/src/unit_tests.rs
//! Tidy check to ensure `#[test]` and `#[bench]` are not used directly inside //! of the standard library. //! //! `core` and `alloc` cannot be tested directly due to duplicating lang items. //! All tests and benchmarks must be written externally in //! `{coretests,alloctests}/{tests,benches}`. //! //! Outside of the ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/tests_placement.rs
src/tools/tidy/src/tests_placement.rs
use std::path::Path; use crate::diagnostics::TidyCtx; const FORBIDDEN_PATH: &str = "src/test"; const ALLOWED_PATH: &str = "tests"; pub fn check(root_path: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check("tests_placement"); if root_path.join(FORBIDDEN_PATH).exists() { check.error(for...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/iter_header.rs
src/tools/tidy/src/iter_header.rs
const COMMENT: &str = "//@"; /// A header line, like `//@name: value` consists of the prefix `//@` and the directive /// `name: value`. It is also possibly revisioned, e.g. `//@[revision] name: value`. pub(crate) struct HeaderLine<'ln> { pub(crate) line_number: usize, pub(crate) revision: Option<&'ln str>, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/target_specific_tests.rs
src/tools/tidy/src/target_specific_tests.rs
//! Tidy check to ensure that all target specific tests (those that require a `--target` flag) //! also require the pre-requisite LLVM components to run. use std::collections::BTreeMap; use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::iter_header::{HeaderLine, iter_header}; use crate::walk:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/rustdoc_json.rs
src/tools/tidy/src/rustdoc_json.rs
//! Tidy check to ensure that `FORMAT_VERSION` was correctly updated if `rustdoc-json-types` was //! updated as well. use std::path::Path; use std::str::FromStr; use crate::diagnostics::{CheckId, TidyCtx}; const RUSTDOC_JSON_TYPES: &str = "src/rustdoc-json-types"; pub fn check(src_path: &Path, ci_info: &crate::CiIn...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/style.rs
src/tools/tidy/src/style.rs
//! Tidy check to enforce various stylistic guidelines on the Rust codebase. //! //! Example checks are: //! //! * No lines over 100 characters (in non-Rust files). //! * No files with over 3000 lines (in non-Rust files). //! * No tabs. //! * No trailing whitespace. //! * No CR characters. //! * No `TODO` or `XXX` dire...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/mir_opt_tests.rs
src/tools/tidy/src/mir_opt_tests.rs
//! Tidy check to ensure that mir opt directories do not have stale files or dashes in file names use std::collections::HashSet; use std::path::{Path, PathBuf}; use miropt_test_tools::PanicStrategy; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; use crate::walk::walk_no_read; fn check_unused_files(path: ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/unstable_book.rs
src/tools/tidy/src/unstable_book.rs
use std::collections::BTreeSet; use std::fs; use std::path::{Path, PathBuf}; use crate::diagnostics::{RunningCheck, TidyCtx}; use crate::features::{CollectedFeatures, Features, Status}; pub const PATH_STR: &str = "doc/unstable-book"; pub const ENV_VARS_DIR: &str = "src/compiler-environment-variables"; pub const COM...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/main.rs
src/tools/tidy/src/main.rs
//! Tidy checks source code in this repository. //! //! This program runs all of the various tidy checks for style, cleanliness, //! etc. This is run by default on `./x.py test` and as part of the auto //! builders. The tidy checks can be executed with `./x.py test tidy`. use std::collections::VecDeque; use std::num::...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/fluent_lowercase.rs
src/tools/tidy/src/fluent_lowercase.rs
//! Checks that the error messages start with a lowercased letter (except when allowed to). use std::path::Path; use fluent_syntax::ast::{Entry, Message, PatternElement}; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; use crate::walk::{filter_dirs, walk}; #[rustfmt::skip] const ALLOWED_CAPITALIZED_WORDS:...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/features.rs
src/tools/tidy/src/features.rs
//! Tidy check to ensure that unstable features are all in order. //! //! This check will ensure properties like: //! //! * All stability attributes look reasonably well formed. //! * The set of library features is disjoint from the set of language features. //! * Library features have at most one stability level. //! ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/fluent_period.rs
src/tools/tidy/src/fluent_period.rs
//! Checks that no Fluent messages or attributes end in periods (except ellipses) use std::path::Path; use fluent_syntax::ast::{Entry, PatternElement}; use crate::diagnostics::{CheckId, RunningCheck, TidyCtx}; use crate::walk::{filter_dirs, walk}; fn filter_fluent(path: &Path) -> bool { if let Some(ext) = path....
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/debug_artifacts.rs
src/tools/tidy/src/debug_artifacts.rs
//! Tidy check to prevent creation of unnecessary debug artifacts while running tests. use std::path::Path; use crate::diagnostics::{CheckId, TidyCtx}; use crate::walk::{filter_dirs, filter_not_rust, walk}; const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test"; pub fn check(test_dir: ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/x_version.rs
src/tools/tidy/src/x_version.rs
use std::path::Path; use std::process::{Command, Stdio}; use semver::Version; use crate::diagnostics::{CheckId, TidyCtx}; pub fn check(root: &Path, cargo: &Path, tidy_ctx: TidyCtx) { let mut check = tidy_ctx.start_check(CheckId::new("x_version").path(root)); let cargo_list = Command::new(cargo).args(["instal...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/extdeps.rs
src/tools/tidy/src/extdeps.rs
//! Check for external package sources. Allow only vendorable packages. use std::fs; use std::path::Path; use crate::deps::WorkspaceInfo; use crate::diagnostics::TidyCtx; /// List of allowed sources for packages. const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/target_policy.rs
src/tools/tidy/src/target_policy.rs
//! Tests for target tier policy compliance. //! //! As of writing, only checks that sanity-check assembly test for targets doesn't miss any targets. use std::collections::HashSet; use std::path::Path; use crate::diagnostics::TidyCtx; use crate::walk::{filter_not_rust, walk}; const TARGET_DEFINITIONS_PATH: &str = "c...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/style/tests.rs
src/tools/tidy/src/style/tests.rs
use super::*; #[test] fn test_contains_problematic_const() { assert!(contains_problematic_const("721077")); // check with no "decimal" hex digits - converted to integer assert!(contains_problematic_const("524421")); // check with "decimal" replacements - converted to integer assert!(contains_problematic_co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/extra_checks/mod.rs
src/tools/tidy/src/extra_checks/mod.rs
//! Optional checks for file types other than Rust source //! //! Handles python tool version management via a virtual environment in //! `build/venv`. //! //! # Functional outline //! //! 1. Run tidy with an extra option: `--extra-checks=py,shell`, //! `--extra-checks=py:lint`, or similar. Optionally provide specif...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/extra_checks/rustdoc_js.rs
src/tools/tidy/src/extra_checks/rustdoc_js.rs
//! Tidy check specific to the Javascript file that make up the static part of the generated rustdoc site. use std::ffi::OsStr; use std::io; use std::path::{Path, PathBuf}; use std::process::{Child, Command}; use build_helper::npm; use ignore::DirEntry; use crate::walk::walk_no_read; fn node_module_bin(outdir: &Pat...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/features/version.rs
src/tools/tidy/src/features/version.rs
use std::fmt; use std::num::ParseIntError; use std::str::FromStr; #[cfg(test)] mod tests; pub const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION"; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "build-metrics", derive(serde::Serialize))] pub enum Version { Explicit { par...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/features/tests.rs
src/tools/tidy/src/features/tests.rs
use super::*; #[test] fn test_find_attr_val() { let s = r#"#[unstable(feature = "tidy_test_never_used_anywhere_else", issue = "58402")]"#; assert_eq!(find_attr_val(s, "feature"), Some("tidy_test_never_used_anywhere_else")); assert_eq!(find_attr_val(s, "issue"), Some("58402")); assert_eq!(find_attr_val(...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/features/version/tests.rs
src/tools/tidy/src/features/version/tests.rs
use super::*; #[test] fn test_try_from_invalid_version() { assert!("".parse::<Version>().is_err()); assert!("hello".parse::<Version>().is_err()); assert!("1.32.hi".parse::<Version>().is_err()); assert!("1.32..1".parse::<Version>().is_err()); assert!("1.32".parse::<Version>().is_err()); assert!(...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/tidy/src/alphabetical/tests.rs
src/tools/tidy/src/alphabetical/tests.rs
use std::path::Path; use crate::alphabetical::check_lines; use crate::diagnostics::{TidyCtx, TidyFlags}; #[track_caller] fn test(lines: &str, name: &str, expected_msg: &str, expected_bad: bool) { let tidy_ctx = TidyCtx::new(Path::new("/"), false, TidyFlags::default()); let mut check = tidy_ctx.start_check("al...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/rustbook/src/main.rs
src/tools/rustbook/src/main.rs
use std::env; use std::path::{Path, PathBuf}; use clap::{ArgMatches, Command, arg, crate_version}; use mdbook_driver::MDBook; use mdbook_driver::errors::Result as Result3; use mdbook_i18n_helpers::preprocessors::Gettext; use mdbook_spec::Spec; use mdbook_trpl::{Figure, Listing, Note}; fn main() { let crate_versio...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/miri/cargo-miri/build.rs
src/tools/miri/cargo-miri/build.rs
fn main() { // Don't rebuild miri when nothing changed. println!("cargo:rerun-if-changed=build.rs"); // gather version info rustc_tools_util::setup_version_info!(); }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/miri/cargo-miri/src/setup.rs
src/tools/miri/cargo-miri/src/setup.rs
//! Implements `cargo miri setup`. use std::env; use std::ffi::OsStr; use std::path::PathBuf; use std::process::{self, Command}; use rustc_build_sysroot::{BuildMode, SysrootBuilder, SysrootConfig, SysrootStatus}; use rustc_version::VersionMeta; use crate::util::*; /// Performs the setup required to make `cargo miri...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false