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/tests/ui/crashes/ice-11422.rs
src/tools/clippy/tests/ui/crashes/ice-11422.rs
#![warn(clippy::implied_bounds_in_impls)] use std::fmt::Debug; use std::ops::*; fn r#gen() -> impl PartialOrd + PartialEq + Debug {} //~^ implied_bounds_in_impls struct Bar {} trait Foo<T = Self> {} trait FooNested<T = Option<Self>> {} impl Foo for Bar {} impl FooNested for Bar {} fn foo() -> impl Foo + FooNested {...
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/tests/ui/crashes/ice-9414.rs
src/tools/clippy/tests/ui/crashes/ice-9414.rs
//@ check-pass #![warn(clippy::result_large_err)] trait T {} fn f(_: &u32) -> Result<(), *const (dyn '_ + T)> { Ok(()) } 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/clippy/tests/ui/crashes/ice-1969.rs
src/tools/clippy/tests/ui/crashes/ice-1969.rs
//@ check-pass // Test for https://github.com/rust-lang/rust-clippy/issues/1969 fn main() {} pub trait Convert { type Action: From<*const f64>; fn convert(val: *const f64) -> Self::Action { val.into() } }
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/tests/ui/crashes/ice-11230.rs
src/tools/clippy/tests/ui/crashes/ice-11230.rs
// Test for https://github.com/rust-lang/rust-clippy/issues/11230 #![warn(clippy::explicit_iter_loop)] #![warn(clippy::needless_collect)] // explicit_iter_loop fn main() { const A: &[for<'a> fn(&'a ())] = &[]; for v in A.iter() {} //~^ explicit_iter_loop } // needless_collect trait Helper<'a>: Iterator<It...
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/tests/ui/crashes/ice-7340.rs
src/tools/clippy/tests/ui/crashes/ice-7340.rs
//@ check-pass #![allow(clippy::no_effect)] fn main() { const CONSTANT: usize = 8; [1; 1 % CONSTANT]; }
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/tests/ui/crashes/ice-15657.rs
src/tools/clippy/tests/ui/crashes/ice-15657.rs
//@check-pass #![warn(clippy::len_zero)] pub struct S1; pub struct S2; impl S1 { pub fn len(&self) -> S2 { S2 } }
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/tests/ui/crashes/elidable_lifetime_names_impl_trait.rs
src/tools/clippy/tests/ui/crashes/elidable_lifetime_names_impl_trait.rs
#![deny(clippy::elidable_lifetime_names)] #![allow(dead_code)] trait Foo {} struct Bar; struct Baz<'a> { bar: &'a Bar, } impl<'a> Foo for Baz<'a> {} //~^ elidable_lifetime_names impl Bar { fn baz<'a>(&'a self) -> impl Foo + 'a { //~^ elidable_lifetime_names Baz { bar: self } } } fn 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/clippy/tests/ui/crashes/ice-12979.rs
src/tools/clippy/tests/ui/crashes/ice-12979.rs
#[deny(clippy::declare_interior_mutable_const)] //~ empty_line_after_outer_attr const FOO: u8 = 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/tests/ui/crashes/ice-14303.rs
src/tools/clippy/tests/ui/crashes/ice-14303.rs
//@check-pass #![warn(clippy::macro_use_imports)] #[repr(transparent)] pub struct X(()); #[repr(u8)] pub enum Action { Off = 0, } 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/clippy/tests/ui/crashes/ice-6792.rs
src/tools/clippy/tests/ui/crashes/ice-6792.rs
//@ check-pass //! This is a reproducer for the ICE 6792: https://github.com/rust-lang/rust-clippy/issues/6792. //! The ICE is caused by using `TyCtxt::type_of(assoc_type_id)`. trait Trait { type Ty; fn broken() -> Self::Ty; } struct Foo; impl Trait for Foo { type Ty = Foo; fn broken() -> Self::Ty ...
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/tests/ui/crashes/implements-trait.rs
src/tools/clippy/tests/ui/crashes/implements-trait.rs
//@ check-pass #[allow(clippy::needless_borrowed_reference)] fn main() { let mut v = Vec::<String>::new(); let _ = v.iter_mut().filter(|&ref a| a.is_empty()); }
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/tests/ui/crashes/missing_const_for_fn_14774.rs
src/tools/clippy/tests/ui/crashes/missing_const_for_fn_14774.rs
//@compile-flags: -Z validate-mir #![warn(clippy::missing_const_for_fn)] static BLOCK_FN_DEF: fn(usize) -> usize = { //~v missing_const_for_fn fn foo(a: usize) -> usize { a + 10 } foo }; struct X; 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/clippy/tests/ui/crashes/ice-15684.rs
src/tools/clippy/tests/ui/crashes/ice-15684.rs
#![warn(clippy::unnecessary_safety_comment)] fn foo() -> i32 { // SAFETY: fail ONLY if `accept-comment-above-attribute = false` #[must_use] return 33; //~^ unnecessary_safety_comment } 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/clippy/tests/ui/crashes/ice-13544-reduced.rs
src/tools/clippy/tests/ui/crashes/ice-13544-reduced.rs
//@ check-pass #![warn(clippy::significant_drop_tightening)] #![allow(unused, clippy::no_effect)] use std::marker::PhantomData; trait Trait { type Assoc: Trait; } struct S<T: Trait>(*const S<T::Assoc>, PhantomData<T>); fn f<T: Trait>(x: &mut S<T>) { &mut x.0; } 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/clippy/tests/ui/crashes/ice-7272.rs
src/tools/clippy/tests/ui/crashes/ice-7272.rs
//@ check-pass //@aux-build:ice-7272-aux.rs #![allow(clippy::no_effect)] extern crate ice_7272_aux; use ice_7272_aux::*; pub fn main() { || WARNING!("Style changed!"); || "}{"; }
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/tests/ui/crashes/ice-3891.rs
src/tools/clippy/tests/ui/crashes/ice-3891.rs
fn main() { 1x; //~^ ERROR: invalid suffix `x` for number literal }
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/tests/ui/crashes/issues_loop_mut_cond.rs
src/tools/clippy/tests/ui/crashes/issues_loop_mut_cond.rs
//@ check-pass #![allow(dead_code)] /// Issue: https://github.com/rust-lang/rust-clippy/issues/2596 pub fn loop_on_block_condition(u: &mut isize) { while { *u < 0 } { *u += 1; } } /// https://github.com/rust-lang/rust-clippy/issues/2584 fn loop_with_unsafe_condition(ptr: *const u8) { let mut len ...
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/tests/ui/crashes/ice-6254.rs
src/tools/clippy/tests/ui/crashes/ice-6254.rs
//@ check-pass // originally from ./tests/ui/pattern/usefulness/consts-opaque.rs // panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', // compiler/rustc_mir_build/src/thir/pattern/_match.rs:2030:5 #![allow(clippy::derive_partial_eq_without_eq, clippy::single_match)] #[derive(PartialEq)] struct F...
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/tests/ui/crashes/ice-6256.rs
src/tools/clippy/tests/ui/crashes/ice-6256.rs
// originally from rustc ./tests/ui/regions/issue-78262.rs // ICE: to get the signature of a closure, use args.as_closure().sig() not fn_sig() #![allow(clippy::upper_case_acronyms)] trait TT {} impl dyn TT { fn func(&self) {} } #[rustfmt::skip] fn main() { let f = |x: &dyn TT| x.func(); //~^ ERROR: borro...
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/tests/ui/crashes/ice-5497.rs
src/tools/clippy/tests/ui/crashes/ice-5497.rs
// reduced from rustc issue-69020-assoc-const-arith-overflow.rs #![allow(clippy::out_of_bounds_indexing)] pub fn main() {} pub trait Foo { const OOB: i32; } impl<T: Foo> Foo for Vec<T> { const OOB: i32 = [1][1] + T::OOB; //~^ ERROR: operation will panic }
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/tests/ui/crashes/ice-10148.rs
src/tools/clippy/tests/ui/crashes/ice-10148.rs
//@aux-build:../auxiliary/proc_macros.rs //@no-rustfix extern crate proc_macros; use proc_macros::with_span; fn main() { println!(with_span!(""something "")); //~^ println_empty_string }
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/tests/ui/crashes/ice-11939.rs
src/tools/clippy/tests/ui/crashes/ice-11939.rs
//@ check-pass #![allow(clippy::unit_arg, clippy::no_effect)] const fn v(_: ()) {} fn main() { if true { v({ [0; 1 + 1]; }); Some(()) } else { None }; }
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/tests/ui/crashes/ice-7231.rs
src/tools/clippy/tests/ui/crashes/ice-7231.rs
//@ check-pass #![allow(clippy::never_loop)] async fn f() { loop { break; } } 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/clippy/tests/ui/crashes/ice-6332.rs
src/tools/clippy/tests/ui/crashes/ice-6332.rs
//@ check-pass fn cmark_check() { let mut link_err = false; macro_rules! cmark_error { ($bad:expr) => { *$bad = true; }; } cmark_error!(&mut link_err); } pub 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/clippy/tests/ui/crashes/cc_seme.rs
src/tools/clippy/tests/ui/crashes/cc_seme.rs
//@ check-pass // Test for https://github.com/rust-lang/rust-clippy/issues/478 enum Baz { One, Two, } struct Test { t: Option<usize>, b: Baz, } fn main() {} pub fn foo() { use Baz::*; let x = Test { t: Some(0), b: One }; match x { Test { t: Some(_), b: One } => unreachable!(), ...
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/tests/ui/crashes/ice-4727.rs
src/tools/clippy/tests/ui/crashes/ice-4727.rs
//@ check-pass #![warn(clippy::use_self)] #[path = "auxiliary/ice-4727-aux.rs"] mod aux; 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/clippy/tests/ui/crashes/ice-9238.rs
src/tools/clippy/tests/ui/crashes/ice-9238.rs
//@ check-pass #![allow(incomplete_features)] #![feature(generic_const_exprs)] #![warn(clippy::branches_sharing_code)] const fn f() -> usize { 2 } const C: [f64; f()] = [0f64; f()]; fn main() { let _ = if true { C[0] } else { C[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/clippy/tests/ui/crashes/ice-3741.rs
src/tools/clippy/tests/ui/crashes/ice-3741.rs
//@ check-pass //@aux-build:proc_macro_crash.rs #![warn(clippy::suspicious_else_formatting)] extern crate proc_macro_crash; use proc_macro_crash::macro_test; fn main() { macro_test!(2); }
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/tests/ui/crashes/ice-7410.rs
src/tools/clippy/tests/ui/crashes/ice-7410.rs
//@ check-pass //@compile-flags: -Clink-arg=-nostartfiles //@ignore-target: windows #![crate_type = "lib"] #![no_std] #![allow(clippy::if_same_then_else)] #![allow(clippy::redundant_pattern_matching)] #![allow(clippy::needless_else)] use core::panic::PanicInfo; struct S; impl Drop for S { fn drop(&mut self) {} ...
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/tests/ui/crashes/ice-6539.rs
src/tools/clippy/tests/ui/crashes/ice-6539.rs
//@ check-pass // The test for the ICE 6539: https://github.com/rust-lang/rust-clippy/issues/6539. // The cause is that `zero_sized_map_values` used `layout_of` with types from type aliases, // which is essentially the same as the ICE 4968. // Note that only type aliases with associated types caused the crash this time...
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/tests/ui/crashes/ice-12616.rs
src/tools/clippy/tests/ui/crashes/ice-12616.rs
#![warn(clippy::ptr_as_ptr)] #![allow(clippy::unnecessary_operation, clippy::unnecessary_cast)] fn main() { let s = std::ptr::null::<()>; s() as *const (); //~^ ptr_as_ptr }
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/tests/ui/crashes/ice-5835.rs
src/tools/clippy/tests/ui/crashes/ice-5835.rs
#[rustfmt::skip] pub struct Foo { //~v tabs_in_doc_comments /// 位 /// ^ Do not remove this tab character. /// It was required to trigger the ICE. pub bar: u8, } 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/clippy/tests/ui/crashes/ice-3969.rs
src/tools/clippy/tests/ui/crashes/ice-3969.rs
// https://github.com/rust-lang/rust-clippy/issues/3969 // used to crash: error: internal compiler error: // src/librustc_traits/normalize_erasing_regions.rs:43: could not fully normalize `<i32 as // std::iter::Iterator>::Item` test from rustc ./ui/trivial-bounds/trivial-bounds-inconsistent.rs // Check that tautalogic...
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/tests/ui/crashes/ice-6251.rs
src/tools/clippy/tests/ui/crashes/ice-6251.rs
// originally from glacier/fixed/77329.rs // assertion failed: `(left == right)` ; different DefIds //@no-rustfix fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> { //~^ ERROR: the size for values //~| ERROR: the size for values //~| ERROR: mismatched types std::iter::empty() }
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/tests/ui/crashes/ice-3151.rs
src/tools/clippy/tests/ui/crashes/ice-3151.rs
//@ check-pass // Test for https://github.com/rust-lang/rust-clippy/issues/3151 #[derive(Clone)] pub struct HashMap<V, S> { hash_builder: S, table: RawTable<V>, } #[derive(Clone)] pub struct RawTable<V> { size: usize, val: V, } 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/clippy/tests/ui/crashes/ice-6179.rs
src/tools/clippy/tests/ui/crashes/ice-6179.rs
//@ check-pass //! This is a minimal reproducer for the ICE in https://github.com/rust-lang/rust-clippy/pull/6179. //! The ICE is mainly caused by using `lower_ty`. See the discussion in the PR for details. #![warn(clippy::use_self)] #![allow(dead_code, clippy::let_with_type_underscore)] #![allow(non_local_definitions...
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/tests/ui/crashes/ice-12585.rs
src/tools/clippy/tests/ui/crashes/ice-12585.rs
//@ check-pass #![allow(clippy::unit_arg)] struct One { x: i32, } struct Two { x: i32, } struct Product {} impl Product { pub fn a_method(self, _: ()) {} } fn from_array(_: [i32; 2]) -> Product { todo!() } pub fn main() { let one = One { x: 1 }; let two = Two { x: 2 }; let product = f...
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/tests/ui/crashes/third-party/conf_allowlisted.rs
src/tools/clippy/tests/ui/crashes/third-party/conf_allowlisted.rs
//@ check-pass 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/clippy/tests/ui/crashes/auxiliary/ice-7934-aux.rs
src/tools/clippy/tests/ui/crashes/auxiliary/ice-7934-aux.rs
fn zero() { // SAFETY: unsafe { 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/tests/ui/crashes/auxiliary/ice-8681-aux.rs
src/tools/clippy/tests/ui/crashes/auxiliary/ice-8681-aux.rs
pub fn foo(x: &u32) -> u32 { /* Safety: * This is totally ok. */ unsafe { *(x as *const u32) } }
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/tests/ui/crashes/auxiliary/ice-7868-aux.rs
src/tools/clippy/tests/ui/crashes/auxiliary/ice-7868-aux.rs
fn zero() { unsafe { 0 }; //~^ ERROR: unsafe block missing a safety comment //~| NOTE: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings` }
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/tests/ui/crashes/auxiliary/ice-4727-aux.rs
src/tools/clippy/tests/ui/crashes/auxiliary/ice-4727-aux.rs
pub trait Trait { fn fun(par: &str) -> &str; } impl Trait for str { fn fun(par: &str) -> &str { &par[0..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/clippy/tests/ui/crashes/auxiliary/use_self_macro.rs
src/tools/clippy/tests/ui/crashes/auxiliary/use_self_macro.rs
macro_rules! use_self { ( impl $ty:ident { fn func(&$this:ident) { [fields($($field:ident)*)] } } ) => ( impl $ty { fn func(&$this) { let $ty { $($field),* } = $this; } } ) }
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/tests/ui/crashes/auxiliary/ice-7272-aux.rs
src/tools/clippy/tests/ui/crashes/auxiliary/ice-7272-aux.rs
pub fn warn<T>(_: T) {} macro_rules! define_macro { ($d:tt $lower:ident $upper:ident) => { #[macro_export] macro_rules! $upper { ($arg:tt) => { $crate::$lower($arg) }; } }; } define_macro! {$ warn WARNING}
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/tests/ui/crashes/auxiliary/proc_macro_crash.rs
src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs
extern crate proc_macro; use proc_macro::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; #[proc_macro] pub fn macro_test(input_stream: TokenStream) -> TokenStream { let first_token = input_stream.into_iter().next().unwrap(); let span = first_token.span(); TokenStream::from_iter(vec![ Tok...
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/tests/ui/doc/link_adjacent.rs
src/tools/clippy/tests/ui/doc/link_adjacent.rs
#![warn(clippy::doc_link_code)] //! Test case for code links that are adjacent to code text. //! //! This is not an example: `first``second` //! //! Neither is this: [`first`](x) //! //! Neither is this: [`first`](x) `second` //! //! Neither is this: [first](x)`second` //! //! This is: [`first`](x)`second` //~^ ERROR:...
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/tests/ui/doc/issue_1832.rs
src/tools/clippy/tests/ui/doc/issue_1832.rs
//@ check-pass /// Ok: <http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels> /// /// Not ok: http://www.unicode.org /// Not ok: https://www.unicode.org /// Not ok: http://www.unicode.org/ /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels fn issue_1832() {} 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/clippy/tests/ui/doc/doc_markdown-issue_13097.rs
src/tools/clippy/tests/ui/doc/doc_markdown-issue_13097.rs
#![deny(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)] mod issue13097 { // This test checks that words starting with capital letters and ending with "ified" don't // trigger the lint. pub enum OutputFormat { /// HumaNified //~^ ERROR: item in documentation is missing backti...
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/tests/ui/doc/issue_9473.rs
src/tools/clippy/tests/ui/doc/issue_9473.rs
#![warn(clippy::doc_markdown)] // Should not warn! /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>. pub struct Foo(u32); // Should warn. /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar]. //~^ doc_markdown pub struct FooBar(u32);
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/tests/ui/doc/issue_12795.rs
src/tools/clippy/tests/ui/doc/issue_12795.rs
#![warn(clippy::doc_markdown)] //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c))) //~^ doc_markdown //~| doc_markdown //~| doc_markdown //~| doc_markdown pub 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/clippy/tests/ui/doc/doc_comment_double_space_linebreaks.rs
src/tools/clippy/tests/ui/doc/doc_comment_double_space_linebreaks.rs
#![feature(custom_inner_attributes)] #![rustfmt::skip] #![warn(clippy::doc_comment_double_space_linebreaks)] #![allow(unused, clippy::empty_docs)] //~v doc_comment_double_space_linebreaks //! Should warn on double space linebreaks //! in file/module doc comment /// Should not warn on single-line doc comments fn si...
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/tests/ui/doc/issue_10262.rs
src/tools/clippy/tests/ui/doc/issue_10262.rs
#![warn(clippy::doc_markdown)] // Should only warn for the first line! /// AviSynth documentation: //~^ ERROR: item in documentation is missing backticks /// /// > AvisynthPluginInit3 may be called more than once with different IScriptEnvironments. /// /// <blockquote>bla AvisynthPluginInit3 bla</blockquote> /// /// <...
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/tests/ui/doc/doc_nested_refdef_list_item.rs
src/tools/clippy/tests/ui/doc/doc_nested_refdef_list_item.rs
// https://github.com/rust-lang/rust/issues/133150 #![warn(clippy::doc_nested_refdefs)] #[rustfmt::skip] /// - [link]: def //~^ ERROR: link reference defined in list item /// /// - [link]: def (title) //~^ ERROR: link reference defined in list item /// /// - [link]: def "title" //~^ ERROR: link reference defined in lis...
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/tests/ui/doc/footnote_issue_13183.rs
src/tools/clippy/tests/ui/doc/footnote_issue_13183.rs
//@ check-pass // This is a regression test for <https://github.com/rust-lang/rust-clippy/issues/13183>. // It should not warn on missing backticks on footnote references. #![warn(clippy::doc_markdown)] // Should not warn! //! Here's a footnote[^example_footnote_identifier] //! //! [^example_footnote_identifier]: This...
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/tests/ui/doc/doc_include_without_cfg.rs
src/tools/clippy/tests/ui/doc/doc_include_without_cfg.rs
#![warn(clippy::doc_include_without_cfg)] // Should not lint. #![doc(html_playground_url = "https://playground.example.com/")] #![doc = include_str!("../approx_const.rs")] //~^ doc_include_without_cfg // Should not lint. #![cfg_attr(feature = "whatever", doc = include_str!("../approx_const.rs"))] #![cfg_attr(doc, doc =...
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/tests/ui/doc/needless_doctest_main.rs
src/tools/clippy/tests/ui/doc/needless_doctest_main.rs
#![warn(clippy::needless_doctest_main)] /// Description /// ```rust /// fn main() { //~^ needless_doctest_main /// let a = 0; /// } /// ``` fn mulpipulpi() {} /// With a `#[no_main]` /// ```rust /// #[no_main] /// fn a() { /// let _ = 0; /// } /// ``` fn pulpimulpi() {} // Without a `#[no_main]` attribute //...
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/tests/ui/doc/doc_lazy_blockquote.rs
src/tools/clippy/tests/ui/doc/doc_lazy_blockquote.rs
#![warn(clippy::doc_lazy_continuation)] /// > blockquote with /// lazy continuation //~^ ERROR: doc quote line without `>` marker fn first() {} /// > blockquote with no /// > lazy continuation fn first_nowarn() {} /// > blockquote with no /// /// lazy continuation fn two_nowarn() {} /// > nest here /// > /// > > ne...
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/tests/ui/doc/issue_902.rs
src/tools/clippy/tests/ui/doc/issue_902.rs
//@ check-pass /// See [NIST SP 800-56A, revision 2]. /// /// [NIST SP 800-56A, revision 2]: /// https://github.com/rust-lang/rust-clippy/issues/902#issuecomment-261919419 fn issue_902_comment() {} 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/clippy/tests/ui/doc/doc_paragraphs_missing_punctuation_unfixable.rs
src/tools/clippy/tests/ui/doc/doc_paragraphs_missing_punctuation_unfixable.rs
#![feature(custom_inner_attributes)] #![rustfmt::skip] #![warn(clippy::doc_paragraphs_missing_punctuation)] //@no-rustfix enum UnfixableTrailers { /// Sometimes the doc comment ends with parentheses (like this) //~^ doc_paragraphs_missing_punctuation EndsWithParens, /// This comment ends with "a quote"...
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/tests/ui/doc/doc_lazy_list.rs
src/tools/clippy/tests/ui/doc/doc_lazy_list.rs
#![warn(clippy::doc_lazy_continuation)] #![allow(clippy::doc_overindented_list_items)] /// 1. nest here /// lazy continuation //~^ ERROR: doc list item without indentation fn one() {} /// 1. first line /// lazy list continuations don't make warnings with this lint //~^ ERROR: doc list item without indentation /// bec...
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/tests/ui/doc/unbalanced_ticks.rs
src/tools/clippy/tests/ui/doc/unbalanced_ticks.rs
//! This file tests for the `DOC_MARKDOWN` lint, specifically cases //! where ticks are unbalanced (see issue #6753). //@no-rustfix #![allow(dead_code)] #![warn(clippy::doc_markdown)] /// This is a doc comment with `unbalanced_tick marks and several words that //~^ doc_markdown /// should be `encompassed_by` tick mark...
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/tests/ui/doc/doc_overindented_list_items.rs
src/tools/clippy/tests/ui/doc/doc_overindented_list_items.rs
#![warn(clippy::doc_overindented_list_items)] #[rustfmt::skip] /// - first list item /// overindented line //~^ ERROR: doc list item overindented /// this is overindented line too //~^ ERROR: doc list item overindented /// - second list item fn foo() {} #[rustfmt::skip] /// - first list item /// ...
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/tests/ui/doc/doc_nested_refdef_blockquote.rs
src/tools/clippy/tests/ui/doc/doc_nested_refdef_blockquote.rs
// https://github.com/rust-lang/rust/issues/133150 #![warn(clippy::doc_nested_refdefs)] #[rustfmt::skip] /// > [link]: def //~^ ERROR: link reference defined in quote /// /// > [link]: def (title) //~^ ERROR: link reference defined in quote /// /// > [link]: def "title" //~^ ERROR: link reference defined in quote /// /...
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/tests/ui/doc/doc_paragraphs_missing_punctuation.rs
src/tools/clippy/tests/ui/doc/doc_paragraphs_missing_punctuation.rs
#![feature(custom_inner_attributes)] #![rustfmt::skip] #![warn(clippy::doc_paragraphs_missing_punctuation)] /// Returns the Answer to the Ultimate Question of Life, the Universe, and Everything //~^ doc_paragraphs_missing_punctuation fn answer() -> i32 { 42 } /// The `Option` type //~^ doc_paragraphs_missing_punc...
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/tests/ui/doc/doc-fixable.rs
src/tools/clippy/tests/ui/doc/doc-fixable.rs
//! This file tests for the `DOC_MARKDOWN` lint. #![allow(dead_code, incomplete_features)] #![warn(clippy::doc_markdown)] #![feature(custom_inner_attributes, generic_const_exprs)] #![rustfmt::skip] /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) //~^ doc_markdown //~| doc_markdown ///...
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/tests/ui/items_after_test_module/imported_module.rs
src/tools/clippy/tests/ui/items_after_test_module/imported_module.rs
//@ check-pass //@compile-flags: --test #![allow(unused)] #![warn(clippy::items_after_test_module)] // Nothing here should lint, as `tests` is an imported module (that has no body). fn main() {} fn should_not_lint() {} #[path = "auxiliary/tests.rs"] #[cfg(test)] mod tests; // Should not lint fn should_not_lint2() ...
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/tests/ui/items_after_test_module/in_submodule.rs
src/tools/clippy/tests/ui/items_after_test_module/in_submodule.rs
//@error-in-other-file: #[path = "auxiliary/submodule.rs"] mod submodule; #[cfg(test)] mod tests { #[test] fn t() {} }
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/tests/ui/items_after_test_module/multiple_modules.rs
src/tools/clippy/tests/ui/items_after_test_module/multiple_modules.rs
//@ check-pass #[cfg(test)] mod tests { #[test] fn f() {} } #[cfg(test)] mod more_tests { #[test] fn g() {} }
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/tests/ui/items_after_test_module/after_proc_macros.rs
src/tools/clippy/tests/ui/items_after_test_module/after_proc_macros.rs
//@ check-pass //@aux-build:../auxiliary/proc_macros.rs extern crate proc_macros; proc_macros::with_span! { span #[cfg(test)] mod tests {} } #[test] fn f() {}
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/tests/ui/items_after_test_module/root_module.rs
src/tools/clippy/tests/ui/items_after_test_module/root_module.rs
#![warn(clippy::items_after_test_module)] fn main() {} fn should_not_lint() {} #[allow(dead_code)] #[allow(unused)] // Some attributes to check that span replacement is good enough #[allow(clippy::allow_attributes)] #[cfg(test)] mod tests { //~^ items_after_test_module #[test] fn hi() {} } fn should_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/tests/ui/items_after_test_module/auxiliary/tests.rs
src/tools/clippy/tests/ui/items_after_test_module/auxiliary/tests.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/clippy/tests/ui/items_after_test_module/auxiliary/submodule.rs
src/tools/clippy/tests/ui/items_after_test_module/auxiliary/submodule.rs
#[cfg(test)] mod tests {} fn in_submodule() {}
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/tests/ui/needless_bool/fixable.rs
src/tools/clippy/tests/ui/needless_bool/fixable.rs
#![warn(clippy::needless_bool)] #![allow( unused, dead_code, clippy::no_effect, clippy::if_same_then_else, clippy::equatable_if_let, clippy::needless_ifs, clippy::needless_return, clippy::self_named_constructors, clippy::struct_field_names )] use std::cell::Cell; macro_rules! bool_...
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/tests/ui/needless_bool/simple.rs
src/tools/clippy/tests/ui/needless_bool/simple.rs
#![warn(clippy::needless_bool)] #![allow( unused, dead_code, clippy::no_effect, clippy::if_same_then_else, clippy::needless_return, clippy::branches_sharing_code )] fn main() { let x = true; let y = false; if x { true } else { true }; //~^^^^^ needless_bo...
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/tests/ui/mixed_attributes_style/global_allow.rs
src/tools/clippy/tests/ui/mixed_attributes_style/global_allow.rs
// https://github.com/rust-lang/rust-clippy/issues/12436 //@check-pass #![allow(clippy::mixed_attributes_style)] #[path = "auxiliary/submodule.rs"] mod submodule; 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/clippy/tests/ui/mixed_attributes_style/mod_declaration.rs
src/tools/clippy/tests/ui/mixed_attributes_style/mod_declaration.rs
//@error-in-other-file: item has both inner and outer attributes //@no-rustfix #[path = "auxiliary/submodule.rs"] // don't lint. /// This doc comment should not lint, it could be used to add context to the original module doc mod submodule;
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/tests/ui/mixed_attributes_style/auxiliary/submodule.rs
src/tools/clippy/tests/ui/mixed_attributes_style/auxiliary/submodule.rs
//! Module level doc #![allow(dead_code)] #[allow(unused)] mod foo { #![allow(dead_code)] }
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/tests/test_utils/mod.rs
src/tools/clippy/tests/test_utils/mod.rs
#![allow(dead_code)] // see https://github.com/rust-lang/rust/issues/46379 use std::path::PathBuf; use std::sync::LazyLock; pub static CARGO_CLIPPY_PATH: LazyLock<PathBuf> = LazyLock::new(|| { let mut path = std::env::current_exe().unwrap(); assert!(path.pop()); // deps path.set_file_name("cargo-clippy");...
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_config/src/lib.rs
src/tools/clippy/clippy_config/src/lib.rs
#![feature(rustc_private)] #![warn( trivial_casts, trivial_numeric_casts, rust_2018_idioms, unused_lifetimes, unused_qualifications )] #![allow( clippy::must_use_candidate, clippy::missing_panics_doc, rustc::diagnostic_outside_of_impl, rustc::untranslatable_diagnostic )] #![deny(clip...
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_config/src/conf.rs
src/tools/clippy/clippy_config/src/conf.rs
use crate::ClippyConfiguration; use crate::types::{ DisallowedPath, DisallowedPathWithoutReplacement, InherentImplLintScope, MacroMatcher, MatchLintBehaviour, PubUnderscoreFieldsBehaviour, Rename, SourceItemOrdering, SourceItemOrderingCategory, SourceItemOrderingModuleItemGroupings, SourceItemOrderingModule...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_config/src/types.rs
src/tools/clippy/clippy_config/src/types.rs
use clippy_utils::paths::{PathNS, find_crates, lookup_path}; use rustc_data_structures::fx::FxHashMap; use rustc_errors::{Applicability, Diag}; use rustc_hir::PrimTy; use rustc_hir::def::DefKind; use rustc_hir::def_id::DefIdMap; use rustc_middle::ty::TyCtxt; use rustc_span::{Span, Symbol}; use serde::de::{self, Deseria...
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_config/src/metadata.rs
src/tools/clippy/clippy_config/src/metadata.rs
use itertools::Itertools; use std::fmt; #[derive(Debug, Clone, Default)] pub struct ClippyConfiguration { pub name: String, pub default: String, pub lints: &'static [&'static str], pub doc: &'static str, pub deprecation_reason: Option<&'static str>, } impl fmt::Display for ClippyConfiguration { ...
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/declare_clippy_lint/src/lib.rs
src/tools/clippy/declare_clippy_lint/src/lib.rs
#![feature(macro_metavar_expr_concat, rustc_private)] extern crate rustc_lint; use rustc_lint::{Lint, LintId, LintStore}; // Needed by `declare_clippy_lint!`. pub extern crate rustc_session; #[derive(Default)] pub struct LintListBuilder { lints: Vec<&'static Lint>, all: Vec<LintId>, cargo: Vec<LintId>, ...
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_utils/src/consts.rs
src/tools/clippy/clippy_utils/src/consts.rs
//! A simple const eval API, for use on arbitrary HIR expressions. //! //! This cannot use rustc's const eval, aka miri, as arbitrary HIR expressions cannot be lowered to //! executable MIR bodies, so we have to do this instead. #![expect(clippy::float_cmp)] use crate::res::MaybeDef; use crate::source::{SpanRangeExt, ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_utils/src/str_utils.rs
src/tools/clippy/clippy_utils/src/str_utils.rs
/// Dealing with string indices can be hard, this struct ensures that both the /// character and byte index are provided for correct indexing. #[derive(Debug, Default, PartialEq, Eq)] pub struct StrIndex { pub char_index: usize, pub byte_index: usize, } impl StrIndex { pub fn new(char_index: usize, byte_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/clippy/clippy_utils/src/msrvs.rs
src/tools/clippy/clippy_utils/src/msrvs.rs
use crate::sym; use rustc_ast::Attribute; use rustc_ast::attr::AttributeExt; use rustc_attr_parsing::parse_version; use rustc_data_structures::smallvec::SmallVec; use rustc_hir::RustcVersion; use rustc_lint::LateContext; use rustc_session::Session; use rustc_span::Symbol; use serde::Deserialize; use std::iter::once; 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_utils/src/diagnostics.rs
src/tools/clippy/clippy_utils/src/diagnostics.rs
//! Clippy wrappers around rustc's diagnostic functions. //! //! These functions are used by the `INTERNAL_METADATA_COLLECTOR` lint to collect the corresponding //! lint applicability. Please make sure that you update the `LINT_EMISSION_FUNCTIONS` variable in //! `clippy_lints::utils::internal_lints::metadata_collector...
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_utils/src/source.rs
src/tools/clippy/clippy_utils/src/source.rs
//! Utils for extracting, inspecting or transforming source code #![allow(clippy::module_name_repetitions)] use std::sync::Arc; use rustc_ast::{LitKind, StrStyle}; use rustc_errors::Applicability; use rustc_hir::{BlockCheckMode, Expr, ExprKind, UnsafeSource}; use rustc_lexer::{FrontmatterAllowed, LiteralKind, TokenK...
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_utils/src/attrs.rs
src/tools/clippy/clippy_utils/src/attrs.rs
//! Utility functions for attributes, including Clippy's built-in ones use crate::source::SpanRangeExt; use crate::{sym, tokenize_with_text}; use rustc_ast::attr::AttributeExt; use rustc_errors::Applicability; use rustc_hir::attrs::AttributeKind; use rustc_hir::find_attr; use rustc_lexer::TokenKind; use rustc_lint::La...
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_utils/src/lib.rs
src/tools/clippy/clippy_utils/src/lib.rs
#![feature(box_patterns)] #![feature(if_let_guard)] #![feature(macro_metavar_expr)] #![feature(never_type)] #![feature(rustc_private)] #![feature(assert_matches)] #![feature(unwrap_infallible)] #![cfg_attr(bootstrap, feature(array_windows))] #![recursion_limit = "512"] #![allow( clippy::missing_errors_doc, clip...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_utils/src/higher.rs
src/tools/clippy/clippy_utils/src/higher.rs
//! This module contains functions that retrieve specific elements. #![deny(clippy::missing_docs_in_private_items)] use crate::consts::{ConstEvalCtxt, Constant}; use crate::res::MaybeDef; use crate::{is_expn_of, sym}; use rustc_ast::ast; use rustc_hir as hir; use rustc_hir::{Arm, Block, Expr, ExprKind, HirId, LoopSo...
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_utils/src/sugg.rs
src/tools/clippy/clippy_utils/src/sugg.rs
//! Contains utility functions to generate suggestions. #![deny(clippy::missing_docs_in_private_items)] use crate::source::{snippet, snippet_opt, snippet_with_applicability, snippet_with_context}; use crate::ty::expr_sig; use crate::{get_parent_expr_for_hir, higher}; use rustc_ast::util::parser::AssocOp; use rustc_ast...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_utils/src/numeric_literal.rs
src/tools/clippy/clippy_utils/src/numeric_literal.rs
use rustc_ast::ast::{LitFloatType, LitIntType, LitKind}; use std::iter; /// Represents the base of a numeric literal, used for parsing and formatting. #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum Radix { /// A binary literal (e.g., `0b1010`) Binary, /// An octal literal (e.g., `0o670`) Octal, ...
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_utils/src/check_proc_macro.rs
src/tools/clippy/clippy_utils/src/check_proc_macro.rs
//! This module handles checking if the span given is from a proc-macro or not. //! //! Proc-macros are capable of setting the span of every token they output to a few possible spans. //! This includes spans we can detect easily as coming from a proc-macro (e.g. the call site //! or the def site), and spans we can't ea...
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_utils/src/paths.rs
src/tools/clippy/clippy_utils/src/paths.rs
//! This module contains paths to types and functions Clippy needs to know //! about. //! //! Whenever possible, please consider diagnostic items over hardcoded paths. //! See <https://github.com/rust-lang/rust-clippy/issues/5393> for more information. use crate::res::MaybeQPath; use crate::sym; use rustc_ast::Mutabil...
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_utils/src/eager_or_lazy.rs
src/tools/clippy/clippy_utils/src/eager_or_lazy.rs
//! Utilities for evaluating whether eagerly evaluated expressions can be made lazy and vice versa. //! //! Things to consider: //! - does the expression have side-effects? //! - is the expression computationally expensive? //! //! See lints: //! - unnecessary-lazy-evaluations //! - or-fun-call //! - option-if-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_utils/src/visitors.rs
src/tools/clippy/clippy_utils/src/visitors.rs
use crate::get_enclosing_block; use crate::msrvs::Msrv; use crate::qualify_min_const_fn::is_stable_const_fn; use crate::res::MaybeResPath; use crate::ty::needs_ordered_drop; use core::ops::ControlFlow; use rustc_ast::visit::{VisitorResult, try_visit}; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::intravi...
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_utils/src/sym.rs
src/tools/clippy/clippy_utils/src/sym.rs
#![allow(non_upper_case_globals)] use rustc_span::symbol::PREDEFINED_SYMBOLS_COUNT; #[doc(no_inline)] pub use rustc_span::sym::*; macro_rules! val { ($name:ident) => { stringify!($name) }; ($name:ident $value:literal) => { $value }; } macro_rules! generate { ($($name:ident $(: $v...
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_utils/src/hir_utils.rs
src/tools/clippy/clippy_utils/src/hir_utils.rs
use crate::consts::ConstEvalCtxt; use crate::macros::macro_backtrace; use crate::source::{SpanRange, SpanRangeExt, walk_span_to_context}; use crate::tokenize_with_text; use rustc_ast::ast; use rustc_ast::ast::InlineAsmTemplatePiece; use rustc_data_structures::fx::{FxHasher, FxIndexMap}; use rustc_hir::MatchSource::TryD...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
true
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/clippy_utils/src/macros.rs
src/tools/clippy/clippy_utils/src/macros.rs
#![allow(clippy::similar_names)] // `expr` and `expn` use std::sync::{Arc, OnceLock}; use crate::visitors::{Descend, for_each_expr_without_closures}; use crate::{get_unique_builtin_attr, sym}; use arrayvec::ArrayVec; use rustc_ast::{FormatArgs, FormatArgument, FormatPlaceholder}; use rustc_data_structures::fx::FxHas...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false