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/op_ref.rs
src/tools/clippy/tests/ui/op_ref.rs
#![allow(unused_variables, clippy::disallowed_names)] #![warn(clippy::op_ref)] use std::collections::HashSet; use std::ops::{BitAnd, Mul}; fn main() { let tracked_fds: HashSet<i32> = HashSet::new(); let new_fds = HashSet::new(); let unwanted = &tracked_fds - &new_fds; let foo = &5 - &6; //~^ op_re...
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/result_unit_error_no_std.rs
src/tools/clippy/tests/ui/result_unit_error_no_std.rs
#![feature(lang_items, libc)] #![no_std] #![no_main] #![warn(clippy::result_unit_err)] #[clippy::msrv = "1.80"] pub fn returns_unit_error_no_lint() -> Result<u32, ()> { Err(()) } #[clippy::msrv = "1.81"] pub fn returns_unit_error_lint() -> Result<u32, ()> { //~^ result_unit_err Err(()) } #[unsafe(no_mang...
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/unnecessary_unsafety_doc.rs
src/tools/clippy/tests/ui/unnecessary_unsafety_doc.rs
//@aux-build:proc_macros.rs #![allow(clippy::let_unit_value, clippy::needless_pass_by_ref_mut)] #![warn(clippy::unnecessary_safety_doc)] extern crate proc_macros; use proc_macros::external; /// This is has no safety section, and does not need one either pub fn destroy_the_planet() { unimplemented!(); } /// 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/equatable_if_let.rs
src/tools/clippy/tests/ui/equatable_if_let.rs
//@aux-build:proc_macros.rs #![allow(clippy::derive_partial_eq_without_eq, clippy::needless_ifs)] #![warn(clippy::equatable_if_let)] use proc_macros::{external, inline_macros}; use std::cmp::Ordering; #[derive(PartialEq)] enum Enum { TupleVariant(i32, u64), RecordVariant { a: i64, b: u32 }, UnitVariant, ...
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/filter_map_identity.rs
src/tools/clippy/tests/ui/filter_map_identity.rs
#![allow(unused_imports, clippy::needless_return, clippy::useless_vec)] #![warn(clippy::filter_map_identity)] #![feature(stmt_expr_attributes)] use std::option::Option; struct NonCopy; use std::convert::identity; fn non_copy_vec() -> Vec<Option<NonCopy>> { todo!() } fn copy_vec<T: Copy>() -> Vec<Option<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/needless_type_cast.rs
src/tools/clippy/tests/ui/needless_type_cast.rs
#![warn(clippy::needless_type_cast)] #![allow(clippy::no_effect, clippy::unnecessary_cast, unused)] fn takes_i32(x: i32) -> i32 { x } fn generic<T>(x: T) -> T { x } fn returns_u8() -> u8 { 10 } fn main() { let a: u8 = 10; //~^ needless_type_cast let _ = a as i32 + 5; let _ = a as i32 * 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/infinite_iter.rs
src/tools/clippy/tests/ui/infinite_iter.rs
#![allow(clippy::double_ended_iterator_last)] use std::iter::repeat; fn square_is_lower_64(x: &u32) -> bool { x * x < 64 } #[allow(clippy::maybe_infinite_iter)] #[deny(clippy::infinite_iter)] fn infinite_iters() { repeat(0_u8).collect::<Vec<_>>(); //~^ infinite_iter // infinite iter (0..8_u32).ta...
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/cast_size.rs
src/tools/clippy/tests/ui/cast_size.rs
//@revisions: r32bit r64bit //@[r32bit]ignore-bitwidth: 64 //@[r64bit]ignore-bitwidth: 32 //@no-rustfix: only some diagnostics have suggestions #![warn( clippy::cast_precision_loss, clippy::cast_possible_truncation, clippy::cast_sign_loss, clippy::cast_possible_wrap, clippy::cast_lossless )] #![all...
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/map_unwrap_or.rs
src/tools/clippy/tests/ui/map_unwrap_or.rs
//@aux-build:option_helpers.rs //@no-rustfix #![warn(clippy::map_unwrap_or)] #![allow(clippy::uninlined_format_args, clippy::unnecessary_lazy_evaluations)] #[macro_use] extern crate option_helpers; use std::collections::HashMap; #[rustfmt::skip] fn option_methods() { let opt = Some(1); // Check for `option....
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/implicit_clone.rs
src/tools/clippy/tests/ui/implicit_clone.rs
#![warn(clippy::implicit_clone)] #![allow(clippy::clone_on_copy, clippy::redundant_clone)] use std::borrow::Borrow; use std::ffi::{OsStr, OsString}; use std::path::PathBuf; fn return_owned_from_slice(slice: &[u32]) -> Vec<u32> { slice.to_owned() } pub fn own_same<T>(v: T) -> T where T: ToOwned<Owned = 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/transmute.rs
src/tools/clippy/tests/ui/transmute.rs
#![feature(f128)] #![feature(f16)] #![allow( dead_code, clippy::borrow_as_ptr, unnecessary_transmutes, integer_to_ptr_transmutes, clippy::needless_lifetimes, clippy::missing_transmute_annotations )] //@no-rustfix extern crate core; use std::mem::transmute as my_transmute; use std::vec::Vec as M...
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/redundant_pattern_matching_ipaddr.rs
src/tools/clippy/tests/ui/redundant_pattern_matching_ipaddr.rs
#![warn(clippy::redundant_pattern_matching)] #![allow( clippy::match_like_matches_macro, clippy::needless_bool, clippy::needless_ifs, clippy::uninlined_format_args )] use std::net::IpAddr::{self, V4, V6}; use std::net::{Ipv4Addr, Ipv6Addr}; fn main() { let ipaddr: IpAddr = V4(Ipv4Addr::LOCALHOST);...
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/module_name_repetitions.rs
src/tools/clippy/tests/ui/module_name_repetitions.rs
//@compile-flags: --test #![warn(clippy::module_name_repetitions)] #![allow(dead_code)] pub mod foo { pub fn foo() {} pub fn foo_bar() {} //~^ module_name_repetitions pub fn bar_foo() {} //~^ module_name_repetitions pub struct FooCake; //~^ module_name_repetitions pub enum CakeFoo {...
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/unnecessary_self_imports.rs
src/tools/clippy/tests/ui/unnecessary_self_imports.rs
#![warn(clippy::unnecessary_self_imports)] #![allow(unused_imports, dead_code)] use std::collections::hash_map::{self, *}; use std::fs::{self as alias}; //~^ unnecessary_self_imports use std::io::{self, Read}; use std::rc::{self}; //~^ unnecessary_self_imports 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/unneeded_struct_pattern.rs
src/tools/clippy/tests/ui/unneeded_struct_pattern.rs
//@aux-build:non-exhaustive-enum.rs #![allow( clippy::manual_unwrap_or_default, clippy::manual_unwrap_or, clippy::redundant_pattern_matching )] #![warn(clippy::unneeded_struct_pattern)] extern crate non_exhaustive_enum; use non_exhaustive_enum::*; fn noop() {} fn main() { match Some(114514) { ...
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/partial_pub_fields.rs
src/tools/clippy/tests/ui/partial_pub_fields.rs
#![allow(unused)] #![warn(clippy::partial_pub_fields)] fn main() { use std::collections::HashMap; #[derive(Default)] pub struct FileSet { files: HashMap<String, u32>, pub paths: HashMap<u32, String>, //~^ partial_pub_fields } pub struct Color { pub r: u8, 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/tests/ui/into_iter_on_ref.rs
src/tools/clippy/tests/ui/into_iter_on_ref.rs
#![allow(clippy::useless_vec, clippy::needless_borrow)] #![warn(clippy::into_iter_on_ref)] struct X; use std::collections::*; fn main() { for _ in &[1, 2, 3] {} for _ in vec![X, X] {} for _ in &vec![X, X] {} let _ = vec![1, 2, 3].into_iter(); let _ = (&vec![1, 2, 3]).into_iter(); //~^ into_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/unnecessary_cast_unfixable.rs
src/tools/clippy/tests/ui/unnecessary_cast_unfixable.rs
#![warn(clippy::unnecessary_cast)] //@no-rustfix fn main() { let _ = std::ptr::null() as *const u8; //~^ unnecessary_cast } mod issue11113 { #[repr(C)] struct Vtbl { query: unsafe extern "system" fn(), } struct TearOff { object: *mut std::ffi::c_void, } impl TearOff { ...
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/cloned_instead_of_copied.rs
src/tools/clippy/tests/ui/cloned_instead_of_copied.rs
#![warn(clippy::cloned_instead_of_copied)] #![allow(unused)] #![allow(clippy::useless_vec)] fn main() { // yay let _ = [1].iter().cloned(); //~^ cloned_instead_of_copied let _ = vec!["hi"].iter().cloned(); //~^ cloned_instead_of_copied let _ = Some(&1).cloned(); //~^ cloned_instead_of_copie...
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/cast_abs_to_unsigned.rs
src/tools/clippy/tests/ui/cast_abs_to_unsigned.rs
#![warn(clippy::cast_abs_to_unsigned)] #![allow(unused)] fn main() { let x: i32 = -42; let y: u32 = x.abs() as u32; //~^ cast_abs_to_unsigned println!("The absolute value of {x} is {y}"); let a: i32 = -3; let _: usize = a.abs() as usize; //~^ cast_abs_to_unsigned let _: usize = a.abs()...
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/never_loop.rs
src/tools/clippy/tests/ui/never_loop.rs
#![feature(try_blocks)] #![expect(clippy::eq_op, clippy::single_match, clippy::while_immutable_condition)] //@no-rustfix use std::arch::asm; fn test1() { let mut x = 0; loop { //~^ never_loop // clippy::never_loop x += 1; if x == 1 { return; } break...
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/def_id_nocore.rs
src/tools/clippy/tests/ui/def_id_nocore.rs
#![feature(no_core, lang_items)] #![no_core] #![allow(clippy::missing_safety_doc)] #[link(name = "c")] unsafe extern "C" {} #[lang = "pointee_sized"] pub trait PointeeSized {} #[lang = "meta_sized"] pub trait MetaSized: PointeeSized {} #[lang = "sized"] pub trait Sized: MetaSized {} #[lang = "copy"] pub trait Copy ...
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_type_cast_unfixable.rs
src/tools/clippy/tests/ui/needless_type_cast_unfixable.rs
//@no-rustfix #![warn(clippy::needless_type_cast)] struct Foo(*mut core::ffi::c_void); enum Bar { Variant(*mut core::ffi::c_void), } // Suggestions will not compile directly, as `123` is a literal which // is not compatible with the suggested `*mut core::ffi::c_void` type fn issue_16243() { let underlying: 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/tests/ui/implicit_saturating_add.rs
src/tools/clippy/tests/ui/implicit_saturating_add.rs
#![allow(unused)] #![warn(clippy::implicit_saturating_add)] fn main() { let mut u_8: u8 = 255; let mut u_16: u16 = 500; let mut u_32: u32 = 7000; let mut u_64: u64 = 7000; let mut i_8: i8 = 30; let mut i_16: i16 = 500; let mut i_32: i32 = 7000; let mut i_64: i64 = 7000; if i_8 < 42...
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/map_collect_result_unit.rs
src/tools/clippy/tests/ui/map_collect_result_unit.rs
#![warn(clippy::map_collect_result_unit)] fn main() { { let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<(), _>>(); //~^ map_collect_result_unit let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect(); //~^ map_collect_result_unit let _ = (0..3).try_for_each(|t| Err(...
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/expect_tool_lint_rfc_2383.rs
src/tools/clippy/tests/ui/expect_tool_lint_rfc_2383.rs
//! This file tests the `#[expect]` attribute implementation for tool lints. The same //! file is used to test clippy and rustdoc. Any changes to this file should be synced //! to the other test files as well. //! //! Expectations: //! * rustc: only rustc lint expectations are emitted //! * clippy: rustc and Clippy's e...
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/tuple_array_conversions.rs
src/tools/clippy/tests/ui/tuple_array_conversions.rs
//@aux-build:proc_macros.rs #![allow(clippy::no_effect, clippy::useless_vec, unused)] #![warn(clippy::tuple_array_conversions)] #[macro_use] extern crate proc_macros; fn main() { let x = [1, 2]; let x = (x[0], x[1]); //~^ tuple_array_conversions let x = [x.0, x.1]; //~^ tuple_array_conversions ...
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/literals.rs
src/tools/clippy/tests/ui/literals.rs
//@no-rustfix: overlapping suggestions // does not test any rustfixable lints #![warn(clippy::mixed_case_hex_literals)] #![warn(clippy::zero_prefixed_literal)] #![warn(clippy::unseparated_literal_suffix)] #![warn(clippy::separated_literal_suffix)] #![allow(dead_code, overflowing_literals)] fn main() { let ok1 = 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/question_mark_used.rs
src/tools/clippy/tests/ui/question_mark_used.rs
// non rustfixable #![allow(unreachable_code)] #![allow(dead_code)] #![warn(clippy::question_mark_used)] fn other_function() -> Option<i32> { Some(32) } fn my_function() -> Option<i32> { other_function()?; //~^ question_mark_used None } 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/entry_with_else.rs
src/tools/clippy/tests/ui/entry_with_else.rs
#![allow(unused, clippy::needless_pass_by_value, clippy::collapsible_if)] #![warn(clippy::map_entry)] use std::collections::{BTreeMap, HashMap}; use std::hash::Hash; macro_rules! m { ($e:expr) => {{ $e }}; } fn foo() {} fn insert_if_absent0<K: Eq + Hash + Copy, V: Copy>(m: &mut HashMap<K, V>, k: K, v: V, v2: 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/tests/ui/manual_ignore_case_cmp.rs
src/tools/clippy/tests/ui/manual_ignore_case_cmp.rs
#![warn(clippy::manual_ignore_case_cmp)] #![allow( clippy::deref_addrof, clippy::op_ref, clippy::ptr_arg, clippy::short_circuit_statement, clippy::unnecessary_operation )] use std::ffi::{OsStr, OsString}; fn main() {} fn variants(a: &str, b: &str) { if a.to_ascii_lowercase() == b.to_ascii_low...
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/bytes_count_to_len.rs
src/tools/clippy/tests/ui/bytes_count_to_len.rs
#![warn(clippy::bytes_count_to_len)] use std::fs::File; use std::io::{BufReader, Read}; fn main() { // should fix, because type is String let _ = String::from("foo").bytes().count(); //~^ bytes_count_to_len let s1 = String::from("foo"); let _ = s1.bytes().count(); //~^ bytes_count_to_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/reversed_empty_ranges_unfixable.rs
src/tools/clippy/tests/ui/reversed_empty_ranges_unfixable.rs
#![warn(clippy::reversed_empty_ranges)] const ANSWER: i32 = 42; const SOME_NUM: usize = 3; fn main() { let arr = [1, 2, 3, 4, 5]; let _ = &arr[3usize..=1usize]; //~^ reversed_empty_ranges let _ = &arr[SOME_NUM..1]; //~^ reversed_empty_ranges for _ in ANSWER..ANSWER {} //~^ reversed_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/unnecessary_result_map_or_else.rs
src/tools/clippy/tests/ui/unnecessary_result_map_or_else.rs
#![warn(clippy::unnecessary_result_map_or_else)] #![allow(clippy::unnecessary_literal_unwrap, clippy::let_and_return, clippy::let_unit_value)] fn main() { let x: Result<(), ()> = Ok(()); x.map_or_else(|err| err, |n| n); //~^ unnecessary_result_map_or_else // Type ascribtion. let x: Result<(), ()> ...
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/derived_hash_with_manual_eq.rs
src/tools/clippy/tests/ui/derived_hash_with_manual_eq.rs
#![allow(clippy::derive_partial_eq_without_eq)] #[derive(PartialEq, Hash)] struct Foo; impl PartialEq<u64> for Foo { fn eq(&self, _: &u64) -> bool { true } } #[derive(Hash)] //~^ derived_hash_with_manual_eq struct Bar; impl PartialEq for Bar { fn eq(&self, _: &Bar) -> bool { true } ...
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/missing_panics_doc.rs
src/tools/clippy/tests/ui/missing_panics_doc.rs
//@aux-build:macro_rules.rs #![warn(clippy::missing_panics_doc)] #![allow(clippy::option_map_unit_fn, clippy::unnecessary_literal_unwrap)] #[macro_use] extern crate macro_rules; use macro_rules::macro_with_panic; fn main() {} /// This needs to be documented pub fn unwrap() { //~^ missing_panics_doc let resu...
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/string_slice.rs
src/tools/clippy/tests/ui/string_slice.rs
#![warn(clippy::string_slice)] #![allow(clippy::no_effect)] use std::borrow::Cow; fn main() { &"Ölkanne"[1..]; //~^ string_slice let m = "Mötörhead"; &m[2..5]; //~^ string_slice let s = String::from(m); &s[0..2]; //~^ string_slice let a = Cow::Borrowed("foo"); &a[0..3]; ...
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_parens_on_range_literals.rs
src/tools/clippy/tests/ui/needless_parens_on_range_literals.rs
//@edition:2018 #![warn(clippy::needless_parens_on_range_literals)] #![allow(clippy::almost_complete_range)] fn main() { let _ = ('a')..=('z'); //~^ needless_parens_on_range_literals //~| needless_parens_on_range_literals let _ = 'a'..('z'); //~^ needless_parens_on_range_literals let _ = (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/manual_hash_one.rs
src/tools/clippy/tests/ui/manual_hash_one.rs
#![warn(clippy::manual_hash_one)] #![allow(clippy::needless_borrows_for_generic_args)] use std::hash::{BuildHasher, Hash, Hasher}; fn returned(b: impl BuildHasher) -> u64 { let mut hasher = b.build_hasher(); true.hash(&mut hasher); hasher.finish() //~^ manual_hash_one } fn unsized_receiver(b: impl Bu...
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/must_use_candidates.rs
src/tools/clippy/tests/ui/must_use_candidates.rs
#![feature(never_type)] #![allow( unused_mut, clippy::redundant_allocation, clippy::needless_pass_by_ref_mut, static_mut_refs )] #![warn(clippy::must_use_candidate)] use std::rc::Rc; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; pub struct MyAtomic(AtomicBool); pub struct MyPure; ...
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/from_str_radix_10.rs
src/tools/clippy/tests/ui/from_str_radix_10.rs
#![warn(clippy::from_str_radix_10)] mod some_mod { // fake function that shouldn't trigger the lint pub fn from_str_radix(_: &str, _: u32) -> Result<(), std::num::ParseIntError> { unimplemented!() } } // fake function that shouldn't trigger the lint fn from_str_radix(_: &str, _: u32) -> Result<(),...
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/reserve_after_initialization.rs
src/tools/clippy/tests/ui/reserve_after_initialization.rs
//@aux-build:proc_macros.rs #![warn(clippy::reserve_after_initialization)] #![no_main] extern crate proc_macros; use proc_macros::{external, with_span}; // Should lint fn standard() { let mut v1: Vec<usize> = vec![]; //~^ reserve_after_initialization v1.reserve(10); } // Should lint fn capacity_as_expr()...
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/manual_let_else.rs
src/tools/clippy/tests/ui/manual_let_else.rs
#![feature(try_blocks)] #![allow(unused_braces, unused_variables, dead_code)] #![allow( clippy::collapsible_else_if, clippy::unused_unit, clippy::let_unit_value, clippy::match_single_binding, clippy::never_loop, clippy::needless_ifs, clippy::diverging_sub_expression, clippy::single_match...
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/print_with_newline.rs
src/tools/clippy/tests/ui/print_with_newline.rs
// FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934 #![allow(clippy::print_literal)] #![warn(clippy::print_with_newline)] fn main() { print!("Hello\n"); //~^ print_with_newline print!("Hello {}\n", "world"); //~^ print_with_newline print!("Hello {} {}\...
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/too_long_first_doc_paragraph.rs
src/tools/clippy/tests/ui/too_long_first_doc_paragraph.rs
//@no-rustfix #![warn(clippy::too_long_first_doc_paragraph)] pub mod foo { // in foo.rs //! A very short summary. //~^ too_long_first_doc_paragraph //! A much longer explanation that goes into a lot more detail about //! how the thing works, possibly with doclinks and so one, //! and probably...
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/manual_string_new.rs
src/tools/clippy/tests/ui/manual_string_new.rs
#![warn(clippy::manual_string_new)] #![allow(clippy::unnecessary_fallible_conversions)] macro_rules! create_strings_from_macro { // When inside a macro, nothing should warn to prevent false positives. ($some_str:expr) => { let _: String = $some_str.into(); let _ = $some_str.to_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/clone_on_copy_impl.rs
src/tools/clippy/tests/ui/clone_on_copy_impl.rs
//@ check-pass #![allow(clippy::non_canonical_clone_impl)] use std::fmt; use std::marker::PhantomData; pub struct Key<T> { #[doc(hidden)] pub __name: &'static str, #[doc(hidden)] pub __phantom: PhantomData<T>, } impl<T> Copy for Key<T> {} impl<T> Clone for Key<T> { fn clone(&self) -> 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/needless_pub_self.rs
src/tools/clippy/tests/ui/needless_pub_self.rs
//@aux-build:proc_macros.rs #![feature(custom_inner_attributes)] #![allow(unused)] #![warn(clippy::needless_pub_self)] #![no_main] #![rustfmt::skip] // rustfmt will remove `in`, understandable // but very annoying for our purposes! #[macro_use] extern crate proc_macros; pub(self) fn a() {} //~^ nee...
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/cloned_ref_to_slice_refs.rs
src/tools/clippy/tests/ui/cloned_ref_to_slice_refs.rs
#![warn(clippy::cloned_ref_to_slice_refs)] #[derive(Clone)] struct Data; fn main() { { let data = Data; let data_ref = &data; let _ = &[data_ref.clone()]; //~ ERROR: this call to `clone` can be replaced with `std::slice::from_ref` } { let _ = &[Data.clone()]; //~ ERROR: th...
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/floating_point_log.rs
src/tools/clippy/tests/ui/floating_point_log.rs
#![allow(dead_code, clippy::double_parens, clippy::unnecessary_cast)] #![warn(clippy::suboptimal_flops, clippy::imprecise_flops)] // FIXME(f16_f128): add tests for these types once math functions are available const TWO: f32 = 2.0; const E: f32 = std::f32::consts::E; fn check_log_base() { let x = 1f32; 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/tests/ui/print_stdout.rs
src/tools/clippy/tests/ui/print_stdout.rs
#![expect(clippy::print_literal)] #![warn(clippy::print_stdout)] fn main() { println!("Hello"); //~^ print_stdout print!("Hello"); //~^ print_stdout print!("Hello {}", "World"); //~^ print_stdout print!("Hello {:?}", "World"); //~^ print_stdout print!("Hello {:#?}", "#orld"); ...
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/bytes_nth.rs
src/tools/clippy/tests/ui/bytes_nth.rs
#![allow(clippy::unnecessary_operation)] #![allow(clippy::sliced_string_as_bytes)] #![warn(clippy::bytes_nth)] fn main() { let s = String::from("String"); let _ = s.bytes().nth(3); //~^ bytes_nth let _ = &s.bytes().nth(3).unwrap(); //~^ bytes_nth let _ = s[..].bytes().nth(3); //~^ bytes_nth...
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/unused_unit.rs
src/tools/clippy/tests/ui/unused_unit.rs
//@revisions: edition2021 edition2024 //@[edition2021] edition:2021 //@[edition2024] edition:2024 // The output for humans should just highlight the whole span without showing // the suggested replacement, but we also want to test that suggested // replacement only removes one set of parentheses, rather than naïvely /...
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.rs
src/tools/clippy/tests/ui/mixed_attributes_style.rs
//@aux-build:proc_macro_attr.rs //@compile-flags: --test --cfg dummy_cfg #![feature(custom_inner_attributes)] #![warn(clippy::mixed_attributes_style)] #![allow(clippy::duplicated_attributes)] #[macro_use] extern crate proc_macro_attr; #[allow(unused)] //~ ERROR: item has both inner and outer attributes fn foo1() { ...
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/option_map_unit_fn_fixable.rs
src/tools/clippy/tests/ui/option_map_unit_fn_fixable.rs
#![warn(clippy::option_map_unit_fn)] #![expect(clippy::unnecessary_wraps)] fn do_nothing<T>(_: T) {} fn diverge<T>(_: T) -> ! { panic!() } fn plus_one(value: usize) -> usize { value + 1 } fn option() -> Option<usize> { Some(10) } struct HasOption { field: Option<usize>, } impl HasOption { fn d...
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/iter_out_of_bounds.rs
src/tools/clippy/tests/ui/iter_out_of_bounds.rs
#![deny(clippy::iter_out_of_bounds)] #![allow(clippy::useless_vec)] fn opaque_empty_iter() -> impl Iterator<Item = ()> { std::iter::empty() } fn main() { #[allow(clippy::never_loop)] for _ in [1, 2, 3].iter().skip(4) { //~^ iter_out_of_bounds unreachable!(); } for (i, _) in [1, 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/vec_resize_to_zero.rs
src/tools/clippy/tests/ui/vec_resize_to_zero.rs
#![warn(clippy::vec_resize_to_zero)] fn main() { let mut v = vec![1, 2, 3, 4, 5]; // applicable here v.resize(0, 5); //~^ vec_resize_to_zero // not applicable v.resize(2, 5); let mut v = vec!["foo", "bar", "baz"]; // applicable here, but only implemented for integer literals for now...
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/unnecessary_sort_by.rs
src/tools/clippy/tests/ui/unnecessary_sort_by.rs
#![allow(clippy::stable_sort_primitive, clippy::useless_vec)] use std::cell::Ref; fn unnecessary_sort_by() { fn id(x: isize) -> isize { x } let mut vec: Vec<isize> = vec![3, 6, 1, 2, 5]; // Forward examples vec.sort_by(|a, b| a.cmp(b)); //~^ unnecessary_sort_by vec.sort_unstable_b...
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/large_enum_variant_no_std.rs
src/tools/clippy/tests/ui/large_enum_variant_no_std.rs
#![no_std] #![warn(clippy::large_enum_variant)] enum Myenum { //~^ ERROR: large size difference between variants Small(u8), Large([u8; 1024]), }
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/match_bool.rs
src/tools/clippy/tests/ui/match_bool.rs
#![deny(clippy::match_bool)] #![allow(clippy::nonminimal_bool, clippy::eq_op)] fn match_bool() { let test: bool = true; match test { //~^ match_bool true => 0, false => 42, }; let option = 1; match option == 1 { //~^ match_bool true => 1, false => 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/needless_bool_assign.rs
src/tools/clippy/tests/ui/needless_bool_assign.rs
#![allow(unused)] #![warn(clippy::needless_bool_assign)] fn random() -> bool { true } fn main() { struct Data { field: bool, }; let mut a = Data { field: false }; if random() && random() { a.field = true; } else { a.field = false } //~^^^^^ needless_bool_assign ...
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/mem_forget.rs
src/tools/clippy/tests/ui/mem_forget.rs
use std::rc::Rc; use std::sync::Arc; use std::mem as memstuff; use std::mem::forget as forgetSomething; #[warn(clippy::mem_forget)] #[allow(forgetting_copy_types)] fn main() { let five: i32 = 5; forgetSomething(five); let six: Arc<i32> = Arc::new(6); memstuff::forget(six); //~^ mem_forget le...
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/seek_from_current.rs
src/tools/clippy/tests/ui/seek_from_current.rs
#![warn(clippy::seek_from_current)] use std::fs::File; use std::io::{self, Seek, SeekFrom, Write}; #[clippy::msrv = "1.50"] fn _msrv_1_50() -> io::Result<()> { let mut f = File::create("foo.txt")?; f.write_all(b"Hi!")?; f.seek(SeekFrom::Current(0))?; f.seek(SeekFrom::Current(1))?; Ok(()) } #[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/tests/ui/unwrap.rs
src/tools/clippy/tests/ui/unwrap.rs
#![warn(clippy::unwrap_used)] #![allow(clippy::unnecessary_literal_unwrap)] fn unwrap_option() { let opt = Some(0); let _ = opt.unwrap(); //~^ unwrap_used } fn unwrap_result() { let res: Result<u8, u8> = Ok(0); let _ = res.unwrap(); //~^ unwrap_used let _ = res.unwrap_err(); //~^ unwr...
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/match_wild_err_arm.rs
src/tools/clippy/tests/ui/match_wild_err_arm.rs
#![allow(clippy::match_same_arms, dead_code)] #![warn(clippy::match_wild_err_arm)] fn issue_10635() { enum Error { A, B, } // Don't trigger in const contexts. Const unwrap is not yet stable const X: () = match Ok::<_, Error>(()) { Ok(x) => x, Err(_) => 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/formatting.rs
src/tools/clippy/tests/ui/formatting.rs
#![allow(clippy::if_same_then_else)] #![allow(clippy::deref_addrof)] #![allow(clippy::nonminimal_bool)] fn foo() -> bool { true } #[rustfmt::skip] fn main() { // weird op_eq formatting: let mut a = 42; a =- 35; //~^ suspicious_assignment_formatting a =* &191; //~^ suspicious_assignment_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/float_cmp.rs
src/tools/clippy/tests/ui/float_cmp.rs
// FIXME(f16_f128): const casting is not yet supported for these types. Add when available. #![warn(clippy::float_cmp)] #![allow( unused, clippy::no_effect, clippy::op_ref, clippy::unnecessary_operation, clippy::cast_lossless )] //@no-rustfix: suggestions have an error margin placeholder use std::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/tests/ui/while_let_on_iterator.rs
src/tools/clippy/tests/ui/while_let_on_iterator.rs
#![warn(clippy::while_let_on_iterator)] #![allow(dead_code, unreachable_code, unused_mut)] #![allow( clippy::equatable_if_let, clippy::manual_find, clippy::never_loop, clippy::redundant_closure_call, clippy::single_range_in_vec_init, clippy::uninlined_format_args, clippy::useless_vec )] fn ...
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/floating_point_powf.rs
src/tools/clippy/tests/ui/floating_point_powf.rs
#![warn(clippy::suboptimal_flops, clippy::imprecise_flops)] #![allow(clippy::unnecessary_cast)] // FIXME(f16_f128): add tests for these types when `powf` is available fn main() { let x = 3f32; let _ = 2f32.powf(x); //~^ suboptimal_flops let _ = 2f32.powf(3.1); //~^ suboptimal_flops let _ = 2f3...
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/empty_enum_variants_with_brackets.rs
src/tools/clippy/tests/ui/empty_enum_variants_with_brackets.rs
#![warn(clippy::empty_enum_variants_with_brackets)] #![allow(dead_code)] #![feature(more_qualified_paths)] pub enum PublicTestEnum { NonEmptyBraces { x: i32, y: i32 }, // No error NonEmptyParentheses(i32, i32), // No error EmptyBraces {}, //~^ empty_enum_variants_with_brackets EmptyParentheses(...
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/manual_unwrap_or_default_unfixable.rs
src/tools/clippy/tests/ui/manual_unwrap_or_default_unfixable.rs
//@no-rustfix fn issue_12670() { // no auto: type not found #[allow(clippy::match_result_ok)] let _ = if let Some(x) = "1".parse().ok() { //~^ manual_unwrap_or_default x } else { i32::default() }; let _ = if let Some(x) = None { x } else { i32::default() }; //~^ manua...
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/duplicate_underscore_argument.rs
src/tools/clippy/tests/ui/duplicate_underscore_argument.rs
#![warn(clippy::duplicate_underscore_argument)] fn join_the_dark_side(darth: i32, _darth: i32) {} //~^ duplicate_underscore_argument fn join_the_light_side(knight: i32, _master: i32) {} // the Force is strong with this one fn main() { join_the_dark_side(0, 0); join_the_light_side(0, 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/single_char_lifetime_names.rs
src/tools/clippy/tests/ui/single_char_lifetime_names.rs
#![warn(clippy::single_char_lifetime_names)] #![allow(clippy::let_unit_value)] // Lifetimes should only be linted when they're introduced struct DiagnosticCtx<'a, 'b> //~^ single_char_lifetime_names //~| single_char_lifetime_names where 'a: 'b, { _source: &'a str, _unit: &'b (), } // Only the lifetimes on...
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/filetype_is_file.rs
src/tools/clippy/tests/ui/filetype_is_file.rs
#![allow(clippy::needless_ifs)] #![warn(clippy::filetype_is_file)] fn main() -> std::io::Result<()> { use std::fs; use std::ops::BitOr; // !filetype.is_dir() if fs::metadata("foo.txt")?.file_type().is_file() { //~^ filetype_is_file // read file } // positive of filetype.is_di...
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_suspicious_footnotes_include.rs
src/tools/clippy/tests/ui/doc_suspicious_footnotes_include.rs
//@ error-in-other-file: footnote //@ no-rustfix #![warn(clippy::doc_suspicious_footnotes)] #![doc=include_str!("doc_suspicious_footnotes_include.txt")]
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/ineffective_open_options.rs
src/tools/clippy/tests/ui/ineffective_open_options.rs
#![warn(clippy::ineffective_open_options)] use std::fs::OpenOptions; fn main() { let file = OpenOptions::new() .create(true) .write(true) //~^ ineffective_open_options .append(true) .open("dump.json") .unwrap(); let file = OpenOptions::new() .create(tru...
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/floating_point_logbase.rs
src/tools/clippy/tests/ui/floating_point_logbase.rs
#![warn(clippy::suboptimal_flops)] #![allow(clippy::unnecessary_cast)] fn main() { let x = 3f32; let y = 5f32; let _ = x.ln() / y.ln(); //~^ suboptimal_flops let _ = (x as f32).ln() / y.ln(); //~^ suboptimal_flops let _ = x.log2() / y.log2(); //~^ suboptimal_flops let _ = x.log10() ...
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/suspicious_operation_groupings.rs
src/tools/clippy/tests/ui/suspicious_operation_groupings.rs
//@compile-flags: -Zdeduplicate-diagnostics=yes #![warn(clippy::suspicious_operation_groupings)] #![allow(dead_code, unused_parens, clippy::eq_op, clippy::manual_midpoint)] struct Vec3 { x: f64, y: f64, z: f64, } impl Eq for Vec3 {} impl PartialEq for Vec3 { fn eq(&self, other: &Self) -> 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/manual_find_fixable.rs
src/tools/clippy/tests/ui/manual_find_fixable.rs
#![warn(clippy::manual_find)] #![allow(unused)] #![allow(clippy::needless_return, clippy::uninlined_format_args)] use std::collections::HashMap; const ARRAY: &[u32; 5] = &[2, 7, 1, 9, 3]; fn lookup(n: u32) -> Option<u32> { for &v in ARRAY { //~^ manual_find if v == n { return Some(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/tests/ui/unbuffered_bytes.rs
src/tools/clippy/tests/ui/unbuffered_bytes.rs
#![warn(clippy::unbuffered_bytes)] use std::fs::File; use std::io::{BufReader, Cursor, Read, Stdin, stdin}; use std::net::TcpStream; fn main() { // File is not buffered, should complain let file = File::open("./bytes.txt").unwrap(); file.bytes(); //~^ unbuffered_bytes // TcpStream is not buffered...
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/manual_flatten.rs
src/tools/clippy/tests/ui/manual_flatten.rs
#![warn(clippy::manual_flatten)] #![allow(clippy::useless_vec, clippy::uninlined_format_args)] fn main() { // Test for loop over implicitly adjusted `Iterator` with `if let` expression let x = vec![Some(1), Some(2), Some(3)]; for n in x { //~^ manual_flatten if let Some(y) = n { ...
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/unnecessary_fallible_conversions_unfixable.rs
src/tools/clippy/tests/ui/unnecessary_fallible_conversions_unfixable.rs
//@aux-build:proc_macros.rs //@no-rustfix #![warn(clippy::unnecessary_fallible_conversions)] extern crate proc_macros; struct Foo; impl TryFrom<i32> for Foo { type Error = (); fn try_from(_: i32) -> Result<Self, Self::Error> { Ok(Foo) } } impl From<i64> for Foo { fn from(_: i64) -> 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/eta.rs
src/tools/clippy/tests/ui/eta.rs
// we have some HELP annotations -- don't complain about them not being present everywhere //@require-annotations-for-level: ERROR #![warn(clippy::redundant_closure, clippy::redundant_closure_for_method_calls)] #![allow(unused)] #![allow( clippy::needless_borrow, clippy::needless_option_as_deref, clippy::n...
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/or_fun_call.rs
src/tools/clippy/tests/ui/or_fun_call.rs
#![warn(clippy::or_fun_call)] #![allow( clippy::borrow_as_ptr, clippy::uninlined_format_args, clippy::unnecessary_wraps, clippy::unnecessary_literal_unwrap, clippy::unnecessary_result_map_or_else, clippy::unnecessary_option_map_or_else, clippy::useless_vec )] use std::collections::{BTreeMap...
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/manual_ilog2.rs
src/tools/clippy/tests/ui/manual_ilog2.rs
//@aux-build:proc_macros.rs #![warn(clippy::manual_ilog2)] #![allow(clippy::unnecessary_operation)] use proc_macros::{external, with_span}; fn foo(a: u32, b: u64) { 31 - a.leading_zeros(); //~ manual_ilog2 a.ilog(2); //~ manual_ilog2 63 - b.leading_zeros(); //~ manual_ilog2 64 - b.leading_zeros(); //...
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/mut_mut.rs
src/tools/clippy/tests/ui/mut_mut.rs
//@aux-build:proc_macros.rs #![warn(clippy::mut_mut)] #![allow(unused)] #![allow( clippy::no_effect, clippy::uninlined_format_args, clippy::unnecessary_operation, clippy::needless_pass_by_ref_mut )] extern crate proc_macros; use proc_macros::{external, inline_macros}; fn fun(x: &mut &mut 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/volatile_composites.rs
src/tools/clippy/tests/ui/volatile_composites.rs
#![feature(ptr_metadata)] #![feature(portable_simd)] #![warn(clippy::volatile_composites)] use std::ptr::null_mut; #[repr(C)] #[derive(Copy, Clone, Default)] struct MyDevRegisters { baseaddr: usize, count: usize, } #[repr(transparent)] struct Wrapper<T>((), T, ()); // Not to be confused with std::ptr::NonNu...
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_borrows_for_generic_args.rs
src/tools/clippy/tests/ui/needless_borrows_for_generic_args.rs
#![warn(clippy::needless_borrows_for_generic_args)] #![allow( clippy::unnecessary_to_owned, clippy::unnecessary_literal_unwrap, clippy::needless_borrow )] use core::ops::Deref; use std::any::Any; use std::ffi::OsStr; use std::fmt::{Debug, Display}; use std::path::Path; use std::process::Command; 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/partialeq_to_none.rs
src/tools/clippy/tests/ui/partialeq_to_none.rs
#![warn(clippy::partialeq_to_none)] #![allow(clippy::eq_op, clippy::needless_ifs)] struct Foobar; impl PartialEq<Option<()>> for Foobar { fn eq(&self, _: &Option<()>) -> bool { false } } #[allow(dead_code)] fn foo(f: Option<u32>) -> &'static str { if f != None { "yay" } else { "nay" } //~^ pa...
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/floating_point_powi.rs
src/tools/clippy/tests/ui/floating_point_powi.rs
#![warn(clippy::suboptimal_flops)] #![allow(clippy::unnecessary_cast)] fn main() { let one = 1; let x = 3f32; let y = 4f32; let _ = x.powi(2) + y; //~^ suboptimal_flops let _ = x.powi(2) - y; //~^ suboptimal_flops let _ = x + y.powi(2); //~^ suboptimal_flops let _ = x - y.powi(...
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/manual_strip_fixable.rs
src/tools/clippy/tests/ui/manual_strip_fixable.rs
#![warn(clippy::manual_strip)] #![allow(clippy::uninlined_format_args)] fn main() { let s = "abc"; if s.starts_with("ab") { let stripped = &s["ab".len()..]; //~^ ERROR: stripping a prefix manually println!("{stripped}{}", &s["ab".len()..]); } if s.ends_with("bc") { 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/tests/ui/significant_drop_tightening.rs
src/tools/clippy/tests/ui/significant_drop_tightening.rs
#![warn(clippy::significant_drop_tightening)] use std::sync::Mutex; pub fn complex_return_triggers_the_lint() -> i32 { fn foo() -> i32 { 1 } let mutex = Mutex::new(1); let lock = mutex.lock().unwrap(); //~^ significant_drop_tightening let _ = *lock; let _ = *lock; foo() } pub ...
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/result_large_err.rs
src/tools/clippy/tests/ui/result_large_err.rs
//@ignore-bitwidth: 32 #![warn(clippy::result_large_err)] #![allow(clippy::large_enum_variant)] pub fn small_err() -> Result<(), u128> { Ok(()) } pub fn large_err() -> Result<(), [u8; 512]> { //~^ result_large_err Ok(()) } pub struct FullyDefinedLargeError { _foo: u128, _bar: [u8; 100], _fo...
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/zero_repeat_side_effects_unfixable.rs
src/tools/clippy/tests/ui/zero_repeat_side_effects_unfixable.rs
//@no-rustfix #![warn(clippy::zero_repeat_side_effects)] #![expect(clippy::diverging_sub_expression)] fn issue_14998() { // unnameable types, don't suggest let _data = [|| 3i32; 0]; //~^ zero_repeat_side_effects // unnameable type because `never_type` is not enabled, don't suggest let _data = [pan...
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/iter_next_loop.rs
src/tools/clippy/tests/ui/iter_next_loop.rs
#![allow(dead_code, unused, for_loops_over_fallibles)] #![warn(clippy::iter_next_loop)] fn main() { let x = [1, 2, 3, 4]; for _ in x.iter().next() {} //~^ iter_next_loop struct Unrelated(&'static [u8]); impl Unrelated { fn next(&self) -> std::slice::Iter<'_, u8> { self.0.iter()...
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/large_types_passed_by_value.rs
src/tools/clippy/tests/ui/large_types_passed_by_value.rs
//@normalize-stderr-test: "\(\d+ byte\)" -> "(N byte)" //@normalize-stderr-test: "\(limit: \d+ byte\)" -> "(limit: N byte)" //@no-rustfix #![warn(clippy::large_types_passed_by_value)] pub struct Large([u8; 2048]); #[derive(Clone, Copy)] pub struct LargeAndCopy([u8; 2048]); pub struct Small([u8; 4]); #[derive(Clone,...
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_borrow.rs
src/tools/clippy/tests/ui/needless_borrow.rs
#![allow( unused, non_local_definitions, clippy::uninlined_format_args, clippy::unnecessary_mut_passed, clippy::unnecessary_to_owned, clippy::unnecessary_literal_unwrap, clippy::needless_lifetimes )] #![warn(clippy::needless_borrow)] fn main() { let a = 5; let ref_a = &a; 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/tests/ui/manual_while_let_some.rs
src/tools/clippy/tests/ui/manual_while_let_some.rs
#![allow(unused)] #![warn(clippy::manual_while_let_some)] struct VecInStruct { numbers: Vec<i32>, unrelated: String, } struct Foo { a: i32, b: i32, } fn accept_i32(_: i32) {} fn accept_optional_i32(_: Option<i32>) {} fn accept_i32_tuple(_: (i32, i32)) {} fn main() { let mut numbers = vec![1, 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/min_ident_chars.rs
src/tools/clippy/tests/ui/min_ident_chars.rs
//@aux-build:proc_macros.rs #![allow(irrefutable_let_patterns, nonstandard_style, unused)] #![allow(clippy::struct_field_names)] #![warn(clippy::min_ident_chars)] extern crate proc_macros; use proc_macros::{external, with_span}; struct A { //~^ min_ident_chars a: u32, //~^ min_ident_chars i: 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/manual_swap_auto_fix.rs
src/tools/clippy/tests/ui/manual_swap_auto_fix.rs
#![warn(clippy::manual_swap)] #![no_main] fn swap1() { let mut v = [3, 2, 1, 0]; let index = v[0]; //~^ manual_swap v[0] = v[index]; v[index] = index; } fn swap2() { let mut v = [3, 2, 1, 0]; let tmp = v[0]; //~^ manual_swap v[0] = v[1]; v[1] = tmp; // check not found in t...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false