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/wild_in_or_pats.rs
src/tools/clippy/tests/ui/wild_in_or_pats.rs
#![warn(clippy::wildcard_in_or_patterns)] fn main() { match "foo" { "a" => { dbg!("matched a"); }, "bar" | _ => { //~^ wildcard_in_or_patterns dbg!("matched (bar or) wild"); }, }; match "foo" { "a" => { dbg!("matched a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.rs
src/tools/clippy/tests/ui/reversed_empty_ranges_loops_fixable.rs
#![warn(clippy::reversed_empty_ranges)] #![allow(clippy::uninlined_format_args)] fn main() { const MAX_LEN: usize = 42; for i in 10..0 { //~^ reversed_empty_ranges println!("{}", i); } for i in 10..=0 { //~^ reversed_empty_ranges println!("{}", i); } for i 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/tests/ui/map_with_unused_argument_over_ranges_nostd.rs
src/tools/clippy/tests/ui/map_with_unused_argument_over_ranges_nostd.rs
#![warn(clippy::map_with_unused_argument_over_ranges)] #![no_std] extern crate alloc; use alloc::vec::Vec; fn nostd(v: &mut [i32]) { let _: Vec<_> = (0..10).map(|_| 3 + 1).collect(); //~^ map_with_unused_argument_over_ranges }
rust
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_as_str.rs
src/tools/clippy/tests/ui/redundant_as_str.rs
#![warn(clippy::redundant_as_str)] #![allow(clippy::const_is_empty)] fn main() { let string = "Hello, world!".to_owned(); // These methods are redundant and the `as_str` can be removed let _redundant = string.as_str().as_bytes(); //~^ redundant_as_str let _redundant = string.as_str().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/unnecessary_map_or.rs
src/tools/clippy/tests/ui/unnecessary_map_or.rs
//@aux-build:proc_macros.rs #![warn(clippy::unnecessary_map_or)] #![allow(clippy::no_effect)] #![allow(clippy::eq_op)] #![allow(clippy::unnecessary_lazy_evaluations)] #![allow(clippy::nonminimal_bool)] #[clippy::msrv = "1.70.0"] #[macro_use] extern crate proc_macros; fn main() { // should trigger let _ = Some(...
rust
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_closure_call_fixable.rs
src/tools/clippy/tests/ui/redundant_closure_call_fixable.rs
#![warn(clippy::redundant_closure_call)] #![allow(clippy::redundant_async_block)] #![allow(clippy::type_complexity)] #![allow(unused)] async fn something() -> u32 { 21 } async fn something_else() -> u32 { 2 } fn main() { let a = (|| 42)(); //~^ redundant_closure_call let b = (async || { /...
rust
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_iter_cloned.rs
src/tools/clippy/tests/ui/unnecessary_iter_cloned.rs
#![allow(unused_assignments, clippy::uninlined_format_args)] #![warn(clippy::unnecessary_to_owned)] #[allow(dead_code)] #[derive(Clone, Copy)] enum FileType { Account, PrivateKey, Certificate, } fn main() { let path = std::path::Path::new("x"); let _ = check_files(&[(FileType::Account, path)]); ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs
src/tools/clippy/tests/ui/derive_partial_eq_without_eq.rs
#![allow(unused)] #![warn(clippy::derive_partial_eq_without_eq)] // Don't warn on structs that aren't PartialEq pub struct NotPartialEq { foo: u32, bar: String, } // Eq can be derived but is missing #[derive(Debug, PartialEq)] //~^ derive_partial_eq_without_eq pub struct MissingEq { foo: u32, bar: Str...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/borrow_as_ptr_no_std.rs
src/tools/clippy/tests/ui/borrow_as_ptr_no_std.rs
#![warn(clippy::borrow_as_ptr)] #![no_std] #![crate_type = "lib"] #[clippy::msrv = "1.75"] pub fn main(_argc: isize, _argv: *const *const u8) -> isize { let val = 1; let _p = &val as *const i32; //~^ borrow_as_ptr let mut val_mut = 1; let _p_mut = &mut val_mut as *mut i32; //~^ borrow_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/blanket_clippy_restriction_lints.rs
src/tools/clippy/tests/ui/blanket_clippy_restriction_lints.rs
//@compile-flags: -W clippy::restriction //@error-in-other-file: restriction #![warn(clippy::blanket_clippy_restriction_lints)] //! Test that the whole restriction group is not enabled. #![warn(clippy::restriction)] //~^ blanket_clippy_restriction_lints #![deny(clippy::restriction)] //~^ blanket_clippy_restriction_li...
rust
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_doc_comments.rs
src/tools/clippy/tests/ui/suspicious_doc_comments.rs
#![allow(unused)] #![warn(clippy::suspicious_doc_comments)] #![allow(clippy::empty_line_after_doc_comments)] //! Real module documentation. ///! Fake module documentation. //~^ suspicious_doc_comments fn baz() {} pub mod singleline_outer_doc { ///! This module contains useful functions. //~^ suspicious_doc_co...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/mixed_read_write_in_expression.rs
src/tools/clippy/tests/ui/mixed_read_write_in_expression.rs
#[warn(clippy::mixed_read_write_in_expression)] #[allow( unused_assignments, unused_variables, clippy::no_effect, dead_code, clippy::disallowed_names )] fn main() { let mut x = 0; let a = { x = 1; 1 } + x; //~^ mixed_read_write_in_expression // Example from iss#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/unused_self.rs
src/tools/clippy/tests/ui/unused_self.rs
#![warn(clippy::unused_self)] #![allow(clippy::boxed_local, clippy::fn_params_excessive_bools)] mod unused_self { use std::pin::Pin; use std::sync::{Arc, Mutex}; struct A; impl A { fn unused_self_move(self) {} //~^ unused_self fn unused_self_ref(&self) {} //~^ unused_...
rust
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/arithmetic_side_effects.rs
src/tools/clippy/tests/ui/arithmetic_side_effects.rs
//@aux-build:proc_macro_derive.rs #![feature(f128)] #![feature(f16)] #![allow( clippy::assign_op_pattern, clippy::erasing_op, clippy::identity_op, clippy::no_effect, clippy::op_ref, clippy::unnecessary_owned_empty_strings, arithmetic_overflow, unconditional_panic )] #![warn(clippy::arit...
rust
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/tabs_in_doc_comments.rs
src/tools/clippy/tests/ui/tabs_in_doc_comments.rs
#![warn(clippy::tabs_in_doc_comments)] /// /// Struct to hold two strings: /// - first one //~^ tabs_in_doc_comments //~| tabs_in_doc_comments /// - second one //~^ tabs_in_doc_comments //~| tabs_in_doc_comments pub struct DoubleString { /// /// - First String: //~^ tabs_in_doc_comments /// - 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/trait_duplication_in_bounds_unfixable.rs
src/tools/clippy/tests/ui/trait_duplication_in_bounds_unfixable.rs
#![deny(clippy::trait_duplication_in_bounds)] #![allow(clippy::multiple_bound_locations)] use std::collections::BTreeMap; use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}; fn bad_foo<T: Clone + Default, Z: Copy>(arg0: T, arg1: Z) //~^ trait_duplication_in_bounds //~| trait_duplication_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/tests/ui/zombie_processes_fixable.rs
src/tools/clippy/tests/ui/zombie_processes_fixable.rs
#![warn(clippy::zombie_processes)] #![allow(clippy::needless_return)] use std::process::{Child, Command}; fn main() { let _ = Command::new("").spawn().unwrap(); //~^ zombie_processes Command::new("").spawn().unwrap(); //~^ zombie_processes spawn_proc(); //~^ zombie_processes spawn_proc(...
rust
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/std_instead_of_core.rs
src/tools/clippy/tests/ui/std_instead_of_core.rs
//@aux-build:proc_macro_derive.rs #![warn(clippy::std_instead_of_core)] #![allow(unused_imports, deprecated)] extern crate alloc; #[macro_use] extern crate proc_macro_derive; fn std_instead_of_core() { // Regular import use std::hash::Hasher; //~^ ERROR: used import from `std` instead of `core` // A...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/swap.rs
src/tools/clippy/tests/ui/swap.rs
//@aux-build: macro_rules.rs #![allow( clippy::disallowed_names, clippy::no_effect, clippy::redundant_clone, clippy::let_and_return, clippy::useless_vec, clippy::redundant_locals )] struct Foo(u32); #[derive(Clone)] struct Bar { a: u32, b: u32, } fn field() { let mut bar = Bar { ...
rust
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/allow_attributes.rs
src/tools/clippy/tests/ui/allow_attributes.rs
//@aux-build:proc_macros.rs //@aux-build:proc_macro_derive.rs #![allow(unused)] #![warn(clippy::allow_attributes)] #![no_main] extern crate proc_macros; use proc_macros::{external, with_span}; // Using clippy::needless_borrow just as a placeholder, it isn't relevant. // Should lint #[allow(dead_code)] //~^ allow_att...
rust
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/len_zero_unstable.rs
src/tools/clippy/tests/ui/len_zero_unstable.rs
#![warn(clippy::len_zero)] #![feature(exact_size_is_empty)] fn issue15890(vertices: &mut dyn ExactSizeIterator<Item = u8>) -> bool { vertices.len() == 0 //~^ len_zero }
rust
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_statement.rs
src/tools/clippy/tests/ui/items_after_statement.rs
#![warn(clippy::items_after_statements)] #![allow(clippy::uninlined_format_args)] fn ok() { fn foo() { println!("foo"); } foo(); } fn last() { foo(); fn foo() { //~^ items_after_statements println!("foo"); } } fn main() { foo(); fn foo() { //~^ items_a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/shadow.rs
src/tools/clippy/tests/ui/shadow.rs
//@aux-build:proc_macro_derive.rs #![warn(clippy::shadow_same, clippy::shadow_reuse, clippy::shadow_unrelated)] #![allow( clippy::let_unit_value, clippy::needless_ifs, clippy::redundant_guards, clippy::redundant_locals )] extern crate proc_macro_derive; #[derive(proc_macro_derive::ShadowDerive)] 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/option_option.rs
src/tools/clippy/tests/ui/option_option.rs
#![warn(clippy::option_option)] #![expect(clippy::unnecessary_wraps)] const C: Option<Option<i32>> = None; //~^ option_option static S: Option<Option<i32>> = None; //~^ option_option fn input(_: Option<Option<u8>>) {} //~^ option_option fn output() -> Option<Option<u8>> { //~^ option_option None } fn output...
rust
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_match.rs
src/tools/clippy/tests/ui/needless_match.rs
#![warn(clippy::needless_match)] #![allow(clippy::manual_map)] #![allow(dead_code)] #![allow(unused)] #[derive(Clone, Copy)] enum Simple { A, B, C, D, } fn useless_match() { let i = 10; let _: i32 = match i { //~^ needless_match 0 => 0, 1 => 1, 2 => 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/manual_find_map.rs
src/tools/clippy/tests/ui/manual_find_map.rs
#![allow(dead_code)] #![warn(clippy::manual_find_map)] #![allow(clippy::redundant_closure)] // FIXME suggestion may have redundant closure #![allow(clippy::useless_vec)] #![allow(clippy::struct_field_names)] fn main() { // is_some(), unwrap() let _ = (0..).find(|n| to_opt(*n).is_some()).map(|a| to_opt(a).unwra...
rust
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/skip_while_next.rs
src/tools/clippy/tests/ui/skip_while_next.rs
//@aux-build:option_helpers.rs #![warn(clippy::skip_while_next)] #![allow(clippy::disallowed_names, clippy::useless_vec)] extern crate option_helpers; use option_helpers::IteratorFalsePositives; #[rustfmt::skip] fn skip_while_next() { let v = vec![3, 2, 1, 0, -1, -2, -3]; // Single-line case. let _ = 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/mistyped_literal_suffix.rs
src/tools/clippy/tests/ui/mistyped_literal_suffix.rs
//@aux-build: proc_macros.rs #![allow( dead_code, unused_variables, overflowing_literals, clippy::excessive_precision, clippy::inconsistent_digit_grouping, clippy::unusual_byte_groupings )] extern crate proc_macros; use proc_macros::with_span; fn main() { let fail14 = 2_32; //~^ misty...
rust
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_type_annotations.rs
src/tools/clippy/tests/ui/redundant_type_annotations.rs
#![allow(unused)] #![warn(clippy::redundant_type_annotations)] #[derive(Debug, Default)] struct Cake<T> { _data: T, } fn make_something<T>() -> T { unimplemented!() } fn make_cake<T: Default>() -> Cake<T> { Cake::<T>::default() } fn plus_one<T: std::ops::Add<u8, Output = T>>(val: T) -> T { val + 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/missing_asserts_for_indexing.rs
src/tools/clippy/tests/ui/missing_asserts_for_indexing.rs
#![allow(unused)] #![warn(clippy::missing_asserts_for_indexing)] // ok fn sum_with_assert(v: &[u8]) -> u8 { assert!(v.len() > 4); v[0] + v[1] + v[2] + v[3] + v[4] } // ok fn sum_with_assert_other_way(v: &[u8]) -> u8 { assert!(5 <= v.len()); v[0] + v[1] + v[2] + v[3] + v[4] } // ok fn sum_with_assert_...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/manual_contains.rs
src/tools/clippy/tests/ui/manual_contains.rs
#![warn(clippy::manual_contains)] #![allow(clippy::eq_op, clippy::useless_vec)] fn should_lint() { let vec: Vec<u8> = vec![1, 2, 3, 4, 5, 6]; let values = &vec[..]; let _ = values.iter().any(|&v| v == 4); //~^ manual_contains let vec: Vec<u32> = vec![1, 2, 3, 4, 5, 6]; let values = &vec[..]; ...
rust
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_ptr_to_ptr.rs
src/tools/clippy/tests/ui/transmute_ptr_to_ptr.rs
#![warn(clippy::transmute_ptr_to_ptr)] #![allow(clippy::borrow_as_ptr, clippy::missing_transmute_annotations)] use std::mem::transmute; // Make sure we can modify lifetimes, which is one of the recommended uses // of transmute // Make sure we can do static lifetime transmutes unsafe fn transmute_lifetime_to_static<'...
rust
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_assert_message.rs
src/tools/clippy/tests/ui/missing_assert_message.rs
#![allow(unused)] #![warn(clippy::missing_assert_message)] macro_rules! bar { ($( $x:expr ),*) => { foo() }; } // Should trigger warning fn asserts_without_message() { assert!(foo()); //~^ ERROR: assert without any message assert_eq!(foo(), foo()); //~^ ERROR: assert without any messag...
rust
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_lit_chars_any.rs
src/tools/clippy/tests/ui/string_lit_chars_any.rs
//@aux-build:proc_macros.rs #![allow(clippy::eq_op, clippy::needless_raw_string_hashes, clippy::no_effect, unused)] #![warn(clippy::string_lit_chars_any)] #[macro_use] extern crate proc_macros; struct NotStringLit; impl NotStringLit { fn chars(&self) -> impl Iterator<Item = char> { "c".chars() } } 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/filter_map_next_fixable.rs
src/tools/clippy/tests/ui/filter_map_next_fixable.rs
#![warn(clippy::filter_map_next)] fn main() { let a = ["1", "lol", "3", "NaN", "5"]; let element: Option<i32> = a.iter().filter_map(|s| s.parse().ok()).next(); //~^ filter_map_next assert_eq!(element, Some(1)); } #[clippy::msrv = "1.29"] fn msrv_1_29() { let a = ["1", "lol", "3", "NaN", "5"]; ...
rust
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_update.rs
src/tools/clippy/tests/ui/needless_update.rs
#![warn(clippy::needless_update)] #![allow(clippy::no_effect, clippy::unnecessary_struct_initialization)] struct S { pub a: i32, pub b: i32, } #[non_exhaustive] struct T { pub x: i32, pub y: i32, } fn main() { let base = S { a: 0, b: 0 }; S { ..base }; // no error S { a: 1, ..base }; // 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/unneeded_wildcard_pattern.rs
src/tools/clippy/tests/ui/unneeded_wildcard_pattern.rs
//@aux-build:proc_macros.rs #![feature(stmt_expr_attributes)] #![deny(clippy::unneeded_wildcard_pattern)] #![allow(clippy::needless_ifs)] #[macro_use] extern crate proc_macros; fn main() { let t = (0, 1, 2, 3); if let (0, .., _) = t {}; //~^ unneeded_wildcard_pattern if let (0, _, ..) = 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/bind_instead_of_map.rs
src/tools/clippy/tests/ui/bind_instead_of_map.rs
#![deny(clippy::bind_instead_of_map)] // need a main anyway, use it get rid of unused warnings too pub fn main() { let x = Some(5); // the easiest cases let _ = x.and_then(Some); //~^ bind_instead_of_map let _ = x.and_then(|o| Some(o + 1)); //~^ bind_instead_of_map // and an easy counter-ex...
rust
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/drain_collect_nostd.rs
src/tools/clippy/tests/ui/drain_collect_nostd.rs
#![warn(clippy::drain_collect)] #![no_std] extern crate alloc; use alloc::vec::Vec; fn remove_all(v: &mut Vec<i32>) -> Vec<i32> { v.drain(..).collect() //~^ drain_collect }
rust
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/io_other_error.rs
src/tools/clippy/tests/ui/io_other_error.rs
#![warn(clippy::io_other_error)] use std::fmt; #[derive(Debug)] struct E; impl std::error::Error for E {} impl fmt::Display for E { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("E") } } macro_rules! o { {} => { std::io::ErrorKind::Other }; } macro_rules! e { { $kind:exp...
rust
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/excessive_precision.rs
src/tools/clippy/tests/ui/excessive_precision.rs
#![warn(clippy::excessive_precision)] #![allow( dead_code, overflowing_literals, unused_variables, clippy::print_literal, clippy::useless_vec, clippy::approx_constant )] macro_rules! make_pi { ($i:ident : $t:ty) => { const $i: $t = 3.1415926535897932384626433832795028841971693993751...
rust
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/struct_fields.rs
src/tools/clippy/tests/ui/struct_fields.rs
//@aux-build:proc_macros.rs #![warn(clippy::struct_field_names)] #![allow(unused)] #[macro_use] extern crate proc_macros; struct Data1 { field_data1: u8, //~^ ERROR: field name ends with the struct's name another: u8, foo: u8, bar: u8, } struct Data2 { another: u8, foo: u8, data2_fie...
rust
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/swap_with_temporary.rs
src/tools/clippy/tests/ui/swap_with_temporary.rs
#![warn(clippy::swap_with_temporary)] use std::mem::swap; fn func() -> String { String::from("func") } fn func_returning_refmut(s: &mut String) -> &mut String { s } fn main() { let mut x = String::from("x"); let mut y = String::from("y"); let mut zz = String::from("zz"); let z = &mut zz; ...
rust
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/format_push_string_no_std.rs
src/tools/clippy/tests/ui/format_push_string_no_std.rs
#![warn(clippy::format_push_string)] #![no_std] extern crate alloc; use alloc::format; use alloc::string::String; fn foo(string: &mut String) { use core::fmt::Write; // TODO: recognize the already imported `fmt::Write`, and don't suggest importing it again string.push_str(&format!("{:?}", 1234)); //...
rust
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/str_to_string.rs
src/tools/clippy/tests/ui/str_to_string.rs
#![warn(clippy::str_to_string)] fn main() { let hello = "hello world".to_string(); //~^ str_to_string let msg = &hello[..]; msg.to_string(); //~^ 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/unwrap_expect_used.rs
src/tools/clippy/tests/ui/unwrap_expect_used.rs
#![warn(clippy::unwrap_used, clippy::expect_used)] #![allow(clippy::unnecessary_literal_unwrap)] #![feature(never_type)] use std::convert::Infallible; trait OptionExt { type Item; fn unwrap_err(self) -> Self::Item; fn expect_err(self, msg: &str) -> Self::Item; } impl<T> OptionExt for Option<T> { 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/manual_unwrap_or_default.rs
src/tools/clippy/tests/ui/manual_unwrap_or_default.rs
#![warn(clippy::manual_unwrap_or_default)] #![allow(clippy::unnecessary_literal_unwrap)] fn main() { let x: Option<Vec<String>> = None; match x { //~^ manual_unwrap_or_default Some(v) => v, None => Vec::default(), }; let x: Option<Vec<String>> = None; match x { //~^...
rust
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/starts_ends_with.rs
src/tools/clippy/tests/ui/starts_ends_with.rs
#![allow(clippy::needless_ifs, dead_code, unused_must_use, clippy::double_ended_iterator_last)] fn main() {} #[allow(clippy::unnecessary_operation)] fn starts_with() { "".chars().next() == Some(' '); //~^ chars_next_cmp Some(' ') != "".chars().next(); //~^ chars_next_cmp // Ensure that suggestion...
rust
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_filter_is_some.rs
src/tools/clippy/tests/ui/iter_filter_is_some.rs
#![warn(clippy::iter_filter_is_some)] #![allow( clippy::map_identity, clippy::result_filter_map, clippy::needless_borrow, clippy::option_filter_map, clippy::redundant_closure, clippy::unnecessary_get_then_check )] use std::collections::HashMap; fn main() { { let _ = vec![Some(1), 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/multi_assignments.rs
src/tools/clippy/tests/ui/multi_assignments.rs
#![warn(clippy::multi_assignments)] fn main() { let (mut a, mut b, mut c, mut d) = ((), (), (), ()); a = b = c; //~^ multi_assignments a = b = c = d; //~^ multi_assignments //~| multi_assignments a = b = { c }; //~^ multi_assignments a = { b = c }; //~^ multi_assignments ...
rust
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/format_collect.rs
src/tools/clippy/tests/ui/format_collect.rs
#![allow(unused, dead_code)] #![warn(clippy::format_collect)] fn hex_encode(bytes: &[u8]) -> String { bytes.iter().map(|b| format!("{b:02X}")).collect() //~^ format_collect } #[rustfmt::skip] fn hex_encode_deep(bytes: &[u8]) -> String { bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect() //...
rust
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_nth.rs
src/tools/clippy/tests/ui/iter_nth.rs
//@aux-build:option_helpers.rs #![warn(clippy::iter_nth)] #![allow(clippy::useless_vec)] #[macro_use] extern crate option_helpers; use option_helpers::IteratorFalsePositives; use std::collections::VecDeque; /// Struct to generate false positives for things with `.iter()`. #[derive(Copy, Clone)] struct HasIter; imp...
rust
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_box_returns.rs
src/tools/clippy/tests/ui/unnecessary_box_returns.rs
#![warn(clippy::unnecessary_box_returns)] //@no-rustfix trait Bar { // lint fn baz(&self) -> Box<usize>; //~^ unnecessary_box_returns } pub struct Foo {} impl Bar for Foo { // don't lint: this is a problem with the trait, not the implementation fn baz(&self) -> Box<usize> { Box::new(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/needless_collect_indirect.rs
src/tools/clippy/tests/ui/needless_collect_indirect.rs
#![allow(clippy::uninlined_format_args, clippy::useless_vec, clippy::needless_ifs)] #![warn(clippy::needless_collect)] //@no-rustfix use std::collections::{BinaryHeap, HashMap, HashSet, LinkedList, VecDeque}; fn main() { let sample = [1; 5]; let indirect_iter = sample.iter().collect::<Vec<_>>(); //~^ needl...
rust
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_enum_constructor.rs
src/tools/clippy/tests/ui/cast_enum_constructor.rs
#![warn(clippy::cast_enum_constructor)] #![allow(clippy::fn_to_numeric_cast, function_casts_as_integer)] fn main() { enum Foo { Y(u32), } enum Bar { X, } let _ = Foo::Y as usize; //~^ cast_enum_constructor let _ = Foo::Y as isize; //~^ cast_enum_constructor 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/wrong_self_convention.rs
src/tools/clippy/tests/ui/wrong_self_convention.rs
#![warn(clippy::wrong_self_convention)] #![allow(dead_code)] fn main() {} #[derive(Clone, Copy)] struct Foo; impl Foo { fn as_i32(self) {} fn as_u32(&self) {} fn into_i32(self) {} fn is_i32(self) {} fn is_u32(&self) {} fn to_i32(self) {} fn from_i32(self) {} //~^ wrong_self_convention...
rust
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/box_default_no_std.rs
src/tools/clippy/tests/ui/box_default_no_std.rs
//@ check-pass #![warn(clippy::box_default)] #![no_std] #![crate_type = "lib"] pub struct NotBox<T> { _value: T, } impl<T> NotBox<T> { pub fn new(value: T) -> Self { Self { _value: value } } } impl<T: Default> Default for NotBox<T> { fn default() -> Self { Self::new(T::default()) ...
rust
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/bool_to_int_with_if.rs
src/tools/clippy/tests/ui/bool_to_int_with_if.rs
#![warn(clippy::bool_to_int_with_if)] #![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)] fn main() { let a = true; let b = false; let x = 1; let y = 2; // Should lint // precedence if a { //~^ bool_to_int_with_if 1 } else { 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/read_zero_byte_vec.rs
src/tools/clippy/tests/ui/read_zero_byte_vec.rs
#![warn(clippy::read_zero_byte_vec)] #![allow( clippy::unused_io_amount, clippy::needless_pass_by_ref_mut, clippy::slow_vector_initialization )] use std::fs::File; use std::io; use std::io::prelude::*; //@no-rustfix //@require-annotations-for-level: WARN extern crate futures; use futures::io::{AsyncRead, As...
rust
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_cloned_collect.rs
src/tools/clippy/tests/ui/iter_cloned_collect.rs
#![allow(unused)] #![allow(clippy::useless_vec)] use std::collections::{HashSet, VecDeque}; fn main() { let v = [1, 2, 3, 4, 5]; let v2: Vec<isize> = v.iter().cloned().collect(); //~^ iter_cloned_collect let v3: HashSet<isize> = v.iter().cloned().collect(); let v4: VecDeque<isize> = v.iter().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/ok_expect.rs
src/tools/clippy/tests/ui/ok_expect.rs
#![allow(clippy::unnecessary_literal_unwrap)] use std::io; struct MyError(()); // doesn't implement Debug #[derive(Debug)] struct MyErrorWithParam<T> { x: T, } fn main() { let res: Result<i32, ()> = Ok(0); let _ = res.unwrap(); res.ok().expect("disaster!"); //~^ ok_expect res.ok() ...
rust
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/semicolon_if_nothing_returned.rs
src/tools/clippy/tests/ui/semicolon_if_nothing_returned.rs
//@aux-build:proc_macro_attr.rs #![warn(clippy::semicolon_if_nothing_returned)] #![allow( clippy::redundant_closure, clippy::uninlined_format_args, clippy::needless_late_init, clippy::empty_docs )] #[macro_use] extern crate proc_macro_attr; fn get_unit() {} // the functions below trigger the lint 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/while_float.rs
src/tools/clippy/tests/ui/while_float.rs
#[deny(clippy::while_float)] fn main() { let mut x = 0.0_f32; while x < 42.0_f32 { //~^ while_float x += 0.5; } while x < 42.0 { //~^ while_float x += 1.0; } let mut x = 0; while x < 42 { x += 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/empty_loop_intrinsic.rs
src/tools/clippy/tests/ui/empty_loop_intrinsic.rs
//@check-pass #![warn(clippy::empty_loop)] #![feature(intrinsics)] #![feature(rustc_attrs)] // From issue #15200 #[rustc_intrinsic] #[rustc_nounwind] /// # Safety pub const unsafe fn simd_insert<T, U>(x: T, idx: u32, val: U) -> T; 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/lossy_float_literal.rs
src/tools/clippy/tests/ui/lossy_float_literal.rs
#![warn(clippy::lossy_float_literal)] #![allow(overflowing_literals, unused)] #![feature(f128)] #![feature(f16)] fn main() { // Lossy whole-number float literals let _: f16 = 4_097.0; let _: f16 = 4_097.; let _: f16 = 4_097.000; let _ = 4_097f16; let _: f16 = -4_097.0; let _: f32 = 16_777_...
rust
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/get_first.rs
src/tools/clippy/tests/ui/get_first.rs
#![warn(clippy::get_first)] #![allow(clippy::useless_vec)] use std::collections::{BTreeMap, HashMap, VecDeque}; struct Bar { arr: [u32; 3], } impl Bar { fn get(&self, pos: usize) -> Option<&u32> { self.arr.get(pos) } } fn main() { let x = vec![2, 3, 5]; let _ = x.get(0); //~^ get_firs...
rust
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/multiple_unsafe_ops_per_block.rs
src/tools/clippy/tests/ui/multiple_unsafe_ops_per_block.rs
//@needs-asm-support //@aux-build:proc_macros.rs #![expect( dropping_copy_types, clippy::unnecessary_operation, clippy::unnecessary_literal_unwrap )] #![warn(clippy::multiple_unsafe_ops_per_block)] extern crate proc_macros; use proc_macros::external; use core::arch::asm; fn raw_ptr() -> *const () { c...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/needless_pass_by_ref_mut_2021.rs
src/tools/clippy/tests/ui/needless_pass_by_ref_mut_2021.rs
//@edition: 2021 //@check-pass #![warn(clippy::needless_pass_by_ref_mut)] struct Data<T: ?Sized> { value: T, } // Unsafe functions should not warn. unsafe fn get_mut_unchecked<T>(ptr: &mut std::ptr::NonNull<Data<T>>) -> &mut T { &mut (*ptr.as_ptr()).value }
rust
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_without_iter.rs
src/tools/clippy/tests/ui/into_iter_without_iter.rs
//@no-rustfix: suggestions reference out of scope lifetimes/types //@aux-build:proc_macros.rs #![warn(clippy::into_iter_without_iter)] extern crate proc_macros; use std::iter::IntoIterator; pub struct S1; impl<'a> IntoIterator for &'a S1 { //~^ into_iter_without_iter type IntoIter = std::slice::Iter<'a, u8>; ...
rust
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/serde.rs
src/tools/clippy/tests/ui/serde.rs
#![warn(clippy::serde_api_misuse)] #![allow(dead_code, clippy::needless_lifetimes)] extern crate serde; struct A; impl<'de> serde::de::Visitor<'de> for A { type Value = (); fn expecting(&self, _: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { unimplemented!() } fn visit_str<E>(self, _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/crate_in_macro_def.rs
src/tools/clippy/tests/ui/crate_in_macro_def.rs
#![warn(clippy::crate_in_macro_def)] mod hygienic { #[macro_export] macro_rules! print_message_hygienic { () => { println!("{}", $crate::hygienic::MESSAGE); }; } pub const MESSAGE: &str = "Hello!"; } mod unhygienic { #[macro_export] macro_rules! print_message_unhyg...
rust
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/erasing_op.rs
src/tools/clippy/tests/ui/erasing_op.rs
struct Length(u8); struct Meter; impl core::ops::Mul<Meter> for u8 { type Output = Length; fn mul(self, _: Meter) -> Length { Length(self) } } #[derive(Clone, Default, PartialEq, Eq, Hash)] struct Vec1 { x: i32, } impl core::ops::Mul<Vec1> for i32 { type Output = Vec1; fn mul(self, mu...
rust
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/methods_fixable.rs
src/tools/clippy/tests/ui/methods_fixable.rs
#![warn(clippy::filter_next)] #![allow(clippy::useless_vec)] /// Checks implementation of `FILTER_NEXT` lint. fn main() { let v = vec![3, 2, 1, 0, -1, -2, -3]; // Single-line case. let _ = v.iter().filter(|&x| *x < 0).next(); //~^ filter_next let _ = v.iter().filter(|&x| *x < 0).next_back(); ...
rust
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/unseparated_prefix_literals.rs
src/tools/clippy/tests/ui/unseparated_prefix_literals.rs
//@aux-build:proc_macro_derive.rs #![warn(clippy::unseparated_literal_suffix)] #![allow(dead_code)] #[macro_use] extern crate proc_macro_derive; // Test for proc-macro attribute #[derive(ClippyMiniMacroTest)] struct Foo; macro_rules! lit_from_macro { () => { 42usize //~^ unseparated_literal_suff...
rust
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/self_named_constructors.rs
src/tools/clippy/tests/ui/self_named_constructors.rs
#![warn(clippy::self_named_constructors)] struct ShouldSpawn; struct ShouldNotSpawn; impl ShouldSpawn { pub fn should_spawn() -> ShouldSpawn { //~^ self_named_constructors ShouldSpawn } fn should_not_spawn() -> ShouldNotSpawn { ShouldNotSpawn } } impl ShouldNotSpawn { pu...
rust
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_rad.rs
src/tools/clippy/tests/ui/floating_point_rad.rs
#![warn(clippy::suboptimal_flops)] /// Allow suboptimal_flops in constant context pub const fn const_context() { let x = 3f32; let _ = x * 180f32 / std::f32::consts::PI; } pub fn issue9391(degrees: i64) { let _ = degrees as f64 * std::f64::consts::PI / 180.0; //~^ suboptimal_flops let _ = degrees ...
rust
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/impl_hash_with_borrow_str_and_bytes.rs
src/tools/clippy/tests/ui/impl_hash_with_borrow_str_and_bytes.rs
#![warn(clippy::impl_hash_borrow_with_str_and_bytes)] use std::borrow::Borrow; use std::hash::{Hash, Hasher}; struct ExampleType { data: String, } impl Hash for ExampleType { //~^ ERROR: can't fn hash<H: Hasher>(&self, state: &mut H) { self.data.hash(state); } } impl Borrow<str> for ExampleT...
rust
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_closure_call_late.rs
src/tools/clippy/tests/ui/redundant_closure_call_late.rs
// non rustfixable, see redundant_closure_call_fixable.rs #![warn(clippy::redundant_closure_call)] #![allow(clippy::needless_late_init)] fn main() { let mut i = 1; // don't lint here, the closure is used more than once let closure = |i| i + 1; i = closure(3); i = closure(4); // lint here ...
rust
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/return_and_then.rs
src/tools/clippy/tests/ui/return_and_then.rs
#![warn(clippy::return_and_then)] fn main() { fn test_opt_block(opt: Option<i32>) -> Option<i32> { opt.and_then(|n| { //~^ return_and_then let mut ret = n + 1; ret += n; if n > 1 { Some(ret) } else { None } }) } fn test_opt_func(opt: Option<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/redundant_async_block.rs
src/tools/clippy/tests/ui/redundant_async_block.rs
#![allow(unused, clippy::manual_async_fn)] #![warn(clippy::redundant_async_block)] use std::future::{Future, IntoFuture}; async fn func1(n: usize) -> usize { n + 1 } async fn func2() -> String { let s = String::from("some string"); let f = async { (*s).to_owned() }; let x = async { f.await }; //~...
rust
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/ignore_without_reason.rs
src/tools/clippy/tests/ui/ignore_without_reason.rs
#![warn(clippy::ignore_without_reason)] fn main() {} #[test] fn unignored_test() {} #[test] #[ignore = "Some good reason"] fn ignored_with_reason() {} #[test] #[ignore] //~ ignore_without_reason fn ignored_without_reason() {}
rust
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/non_send_fields_in_send_ty.rs
src/tools/clippy/tests/ui/non_send_fields_in_send_ty.rs
#![warn(clippy::non_send_fields_in_send_ty)] #![feature(extern_types)] use std::cell::UnsafeCell; use std::ptr::NonNull; use std::rc::Rc; use std::sync::{Arc, Mutex, MutexGuard}; // disrustor / RUSTSEC-2020-0150 pub struct RingBuffer<T> { data: Vec<UnsafeCell<T>>, capacity: usize, mask: usize, } unsafe 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/rc_buffer_redefined_string.rs
src/tools/clippy/tests/ui/rc_buffer_redefined_string.rs
//@ check-pass #![warn(clippy::rc_buffer)] use std::rc::Rc; struct String; struct S { // does not trigger lint good1: Rc<String>, } 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/vec_box_sized.rs
src/tools/clippy/tests/ui/vec_box_sized.rs
//@no-rustfix #![allow(dead_code)] #![feature(allocator_api)] use std::alloc::{AllocError, Allocator, Layout}; use std::ptr::NonNull; struct SizedStruct(i32); struct UnsizedStruct([i32]); struct BigStruct([i32; 10000]); struct DummyAllocator; unsafe impl Allocator for DummyAllocator { fn allocate(&self, layout:...
rust
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_join.rs
src/tools/clippy/tests/ui/unnecessary_join.rs
#![warn(clippy::unnecessary_join)] #![allow(clippy::uninlined_format_args, clippy::useless_vec)] fn main() { // should be linted let vector = vec!["hello", "world"]; let output = vector .iter() .map(|item| item.to_uppercase()) .collect::<Vec<String>>() //~^ unnecessary_join ...
rust
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/ignored_unit_patterns.rs
src/tools/clippy/tests/ui/ignored_unit_patterns.rs
//@aux-build:proc_macro_derive.rs #![warn(clippy::ignored_unit_patterns)] #![allow( clippy::let_unit_value, clippy::redundant_pattern_matching, clippy::single_match, clippy::needless_borrow )] fn foo() -> Result<(), ()> { unimplemented!() } fn main() { match foo() { Ok(_) => {}, //~ 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/strlen_on_c_strings.rs
src/tools/clippy/tests/ui/strlen_on_c_strings.rs
#![warn(clippy::strlen_on_c_strings)] #![allow(dead_code, clippy::manual_c_str_literals)] #[allow(unused)] use libc::strlen; use std::ffi::{CStr, CString}; fn main() { // CString let cstring = CString::new("foo").expect("CString::new failed"); let _ = unsafe { libc::strlen(cstring.as_ptr()) }; //~^ st...
rust
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/as_ptr_cast_mut.rs
src/tools/clippy/tests/ui/as_ptr_cast_mut.rs
#![allow(unused)] #![warn(clippy::as_ptr_cast_mut)] #![allow(clippy::wrong_self_convention, clippy::unnecessary_cast)] struct MutPtrWrapper(Vec<u8>); impl MutPtrWrapper { fn as_ptr(&mut self) -> *const u8 { self.0.as_mut_ptr() as *const u8 } } struct Covariant<T>(*const T); impl<T> Covariant<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/fn_to_numeric_cast_any.rs
src/tools/clippy/tests/ui/fn_to_numeric_cast_any.rs
#![warn(clippy::fn_to_numeric_cast_any)] #![allow(clippy::fn_to_numeric_cast, clippy::fn_to_numeric_cast_with_truncation)] #![allow(function_casts_as_integer)] //@no-rustfix fn foo() -> u8 { 0 } fn generic_foo<T>(x: T) -> T { x } trait Trait { fn static_method() -> u32 { 2 } } struct Struct; ...
rust
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/multiple_bound_locations.rs
src/tools/clippy/tests/ui/multiple_bound_locations.rs
#![warn(clippy::multiple_bound_locations)] fn ty<F: std::fmt::Debug>(a: F) //~^ multiple_bound_locations where F: Sized, { } fn lifetime<'a, 'b: 'a, 'c>(a: &'b str, b: &'a str, c: &'c str) //~^ multiple_bound_locations where 'b: 'c, { } fn ty_pred<F: Sized>() //~^ multiple_bound_locations where for<'a> 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/useless_attribute.rs
src/tools/clippy/tests/ui/useless_attribute.rs
//@aux-build:proc_macro_derive.rs #![allow(unused, clippy::duplicated_attributes)] #![warn(clippy::useless_attribute)] #![warn(unreachable_pub)] #![feature(rustc_private)] #[allow(dead_code)] //~^ useless_attribute #[cfg_attr(clippy, allow(dead_code))] //~^ useless_attribute #[rustfmt::skip] #[allow(unused_imports)] ...
rust
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/double_must_use.rs
src/tools/clippy/tests/ui/double_must_use.rs
#![warn(clippy::double_must_use)] #![allow(clippy::result_unit_err)] #[must_use] pub fn must_use_result() -> Result<(), ()> { //~^ double_must_use unimplemented!(); } #[must_use] pub fn must_use_tuple() -> (Result<(), ()>, u8) { //~^ double_must_use unimplemented!(); } #[must_use] pub fn must_use_a...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/overly_complex_bool_expr.rs
src/tools/clippy/tests/ui/overly_complex_bool_expr.rs
#![allow(unused, clippy::diverging_sub_expression)] #![warn(clippy::overly_complex_bool_expr)] fn main() { let a: bool = unimplemented!(); let b: bool = unimplemented!(); let c: bool = unimplemented!(); let d: bool = unimplemented!(); let e: bool = unimplemented!(); let _ = a && b || a; //~...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/range_contains.rs
src/tools/clippy/tests/ui/range_contains.rs
#![warn(clippy::manual_range_contains)] #![allow(unused)] #![allow(clippy::no_effect)] #![allow(clippy::short_circuit_statement)] #![allow(clippy::unnecessary_operation)] #![allow(clippy::impossible_comparisons)] #![allow(clippy::redundant_comparisons)] fn main() { let x = 9_i32; // order shouldn't matter ...
rust
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/if_same_then_else.rs
src/tools/clippy/tests/ui/if_same_then_else.rs
#![warn(clippy::if_same_then_else)] #![allow( clippy::disallowed_names, clippy::eq_op, clippy::never_loop, clippy::no_effect, clippy::unused_unit, clippy::zero_divided_by_zero, clippy::branches_sharing_code, dead_code, unreachable_code )] struct Foo { bar: u8, } fn foo() -> boo...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/string_lit_as_bytes.rs
src/tools/clippy/tests/ui/string_lit_as_bytes.rs
//@aux-build:macro_rules.rs #![allow(clippy::needless_raw_string_hashes, dead_code, unused_variables)] #![warn(clippy::string_lit_as_bytes)] #[macro_use] extern crate macro_rules; macro_rules! b { ($b:literal) => { const B: &[u8] = $b.as_bytes(); //~^ string_lit_as_bytes }; } fn str_lit_as_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/open_options_fixable.rs
src/tools/clippy/tests/ui/open_options_fixable.rs
use std::fs::OpenOptions; #[allow(unused_must_use)] #[warn(clippy::suspicious_open_options)] fn main() { OpenOptions::new().create(true).open("foo.txt"); //~^ suspicious_open_options }
rust
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_raw_with_void_ptr.rs
src/tools/clippy/tests/ui/from_raw_with_void_ptr.rs
#![warn(clippy::from_raw_with_void_ptr)] #![allow(clippy::unnecessary_cast)] use std::ffi::c_void; use std::rc::Rc; use std::sync::Arc; fn main() { // must lint let ptr = Box::into_raw(Box::new(42usize)) as *mut c_void; let _ = unsafe { Box::from_raw(ptr) }; //~^ from_raw_with_void_ptr // shouldn...
rust
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/new_ret_no_self_overflow.rs
src/tools/clippy/tests/ui/new_ret_no_self_overflow.rs
#![feature(type_alias_impl_trait)] #![warn(clippy::new_ret_no_self)] mod issue10041 { struct Bomb; impl Bomb { // Hidden <Rhs = Self> default generic parameter. pub fn new() -> impl PartialOrd { 0i32 } } // TAIT with self-referencing bounds type X = impl 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/upper_case_acronyms.rs
src/tools/clippy/tests/ui/upper_case_acronyms.rs
#![warn(clippy::upper_case_acronyms)] struct HTTPResponse; // not linted by default, but with cfg option struct CString; // not linted enum Flags { NS, // not linted CWR, //~^ upper_case_acronyms ECE, //~^ upper_case_acronyms URG, //~^ upper_case_acronyms ACK, //~^ upper_case_acro...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false