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/format_push_string_no_std_unfixable.rs
src/tools/clippy/tests/ui/format_push_string_no_std_unfixable.rs
//@no-rustfix #![warn(clippy::format_push_string)] #![no_std] extern crate alloc; use alloc::format; use alloc::string::String; fn foo(string: &mut String) { string.push_str(&format!("{:?}", 1234)); //~^ format_push_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/bytecount.rs
src/tools/clippy/tests/ui/bytecount.rs
//@no-rustfix: suggests external crate #![allow(clippy::needless_borrow, clippy::useless_vec)] #[deny(clippy::naive_bytecount)] fn main() { let x = vec![0_u8; 16]; // naive byte count let _ = x.iter().filter(|&&a| a == 0).count(); //~^ naive_bytecount // naive byte count let _ = (&x[..]).ite...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/legacy_numeric_constants.rs
src/tools/clippy/tests/ui/legacy_numeric_constants.rs
//@aux-build:proc_macros.rs //@require-annotations-for-level: WARN #![allow(clippy::no_effect, deprecated, unused)] #![allow(clippy::legacy_numeric_constants)] // For imports. #[macro_use] extern crate proc_macros; pub mod a { pub use std::u128; } macro_rules! b { () => { mod b { #[warn(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/as_underscore_unfixable.rs
src/tools/clippy/tests/ui/as_underscore_unfixable.rs
//@no-rustfix #![warn(clippy::as_underscore)] fn main() { // From issue #15282 let f = async || (); let _: Box<dyn FnOnce() -> _> = Box::new(f) as _; //~^ as_underscore let barr = || (|| ()); let _: Box<dyn Fn() -> _> = Box::new(barr) as _; //~^ as_underscore }
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/forget_non_drop.rs
src/tools/clippy/tests/ui/forget_non_drop.rs
#![warn(clippy::forget_non_drop)] use core::mem::forget; fn forget_generic<T>(t: T) { // Don't lint forget(t) } fn main() { struct Foo; // Lint forget(Foo); //~^ forget_non_drop struct Bar; impl Drop for Bar { fn drop(&mut self) {} } // Don't lint forget(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/unnecessary_literal_unwrap.rs
src/tools/clippy/tests/ui/unnecessary_literal_unwrap.rs
#![warn(clippy::unnecessary_literal_unwrap)] #![allow(unreachable_code)] #![allow( clippy::unnecessary_lazy_evaluations, clippy::diverging_sub_expression, clippy::let_unit_value, clippy::no_effect )] fn unwrap_option_some() { let _val = Some(1).unwrap(); //~^ unnecessary_literal_unwrap 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/collapsible_match2.rs
src/tools/clippy/tests/ui/collapsible_match2.rs
#![warn(clippy::collapsible_match)] #![allow( clippy::needless_return, clippy::no_effect, clippy::single_match, clippy::needless_borrow )] fn lint_cases(opt_opt: Option<Option<u32>>, res_opt: Result<Option<u32>, String>) { // if guards on outer match { match res_opt { Ok(val...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/path_ends_with_ext.rs
src/tools/clippy/tests/ui/path_ends_with_ext.rs
#![warn(clippy::path_ends_with_ext)] use std::path::Path; macro_rules! arg { () => { ".md" }; } fn test(path: &Path) { path.ends_with(".md"); //~^ path_ends_with_ext // some "extensions" are allowed by default path.ends_with(".git"); // most legitimate "dotfiles" are longer than ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/infallible_destructuring_match.rs
src/tools/clippy/tests/ui/infallible_destructuring_match.rs
#![feature(exhaustive_patterns, never_type)] #![allow(dead_code, unreachable_code, unused_variables)] #![allow(clippy::let_and_return, clippy::uninhabited_references)] enum SingleVariantEnum { Variant(i32), } struct TupleStruct(i32); struct NonCopy; struct TupleStructWithNonCopy(NonCopy); enum EmptyEnum {} mac...
rust
Apache-2.0
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_async.rs
src/tools/clippy/tests/ui/unused_async.rs
#![warn(clippy::unused_async)] #![allow(incomplete_features)] use std::future::Future; use std::pin::Pin; mod issue10800 { #![allow(dead_code, unused_must_use, clippy::no_effect)] use std::future::ready; async fn async_block_await() { //~^ unused_async async { ready(()).awai...
rust
Apache-2.0
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_late_init.rs
src/tools/clippy/tests/ui/needless_late_init.rs
//@aux-build:proc_macros.rs #![allow( clippy::assign_op_pattern, clippy::blocks_in_conditions, clippy::let_and_return, clippy::let_unit_value, clippy::nonminimal_bool, clippy::uninlined_format_args, clippy::useless_vec )] extern crate proc_macros; use std::collections::{BTreeMap, BTreeSet,...
rust
Apache-2.0
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_ne_impl.rs
src/tools/clippy/tests/ui/partialeq_ne_impl.rs
#![allow(dead_code)] struct Foo; impl PartialEq for Foo { fn eq(&self, _: &Foo) -> bool { true } fn ne(&self, _: &Foo) -> bool { //~^ partialeq_ne_impl false } } struct Bar; impl PartialEq for Bar { fn eq(&self, _: &Bar) -> bool { true } #[allow(clippy::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/trim_split_whitespace.rs
src/tools/clippy/tests/ui/trim_split_whitespace.rs
#![warn(clippy::trim_split_whitespace)] #![allow(clippy::let_unit_value)] struct Custom; impl Custom { fn trim(self) -> Self { self } fn split_whitespace(self) {} } struct DerefStr(&'static str); impl std::ops::Deref for DerefStr { type Target = str; fn deref(&self) -> &Self::Target { ...
rust
Apache-2.0
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_without_into_iter.rs
src/tools/clippy/tests/ui/iter_without_into_iter.rs
//@no-rustfix //@aux-build:proc_macros.rs #![warn(clippy::iter_without_into_iter)] #![allow(clippy::needless_lifetimes)] extern crate proc_macros; pub struct S1; impl S1 { pub fn iter(&self) -> std::slice::Iter<'_, u8> { //~^ iter_without_into_iter [].iter() } pub fn iter_mut(&mut self) -> ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.rs
src/tools/clippy/tests/ui/non_canonical_partial_ord_impl_fully_qual.rs
// This test's filename is... a bit verbose. But it ensures we suggest the correct code when `Ord` // is not in scope. #![no_main] #![no_implicit_prelude] //@no-rustfix extern crate std; use std::cmp::{self, Eq, Ordering, PartialEq, PartialOrd}; use std::option::Option::{self, Some}; use std::todo; // lint #[derive(...
rust
Apache-2.0
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_field_names.rs
src/tools/clippy/tests/ui/redundant_field_names.rs
//@aux-build:proc_macros.rs #![warn(clippy::redundant_field_names)] #![allow(clippy::extra_unused_type_parameters, clippy::no_effect, dead_code, unused_variables)] #[macro_use] extern crate proc_macros; use std::ops::{Range, RangeFrom, RangeInclusive, RangeTo, RangeToInclusive}; mod foo { pub const BAR: u8 = 0; ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/similar_names.rs
src/tools/clippy/tests/ui/similar_names.rs
#![warn(clippy::similar_names)] #![allow( unused, clippy::println_empty_string, clippy::empty_loop, clippy::never_loop, clippy::diverging_sub_expression, clippy::let_unit_value )] struct Foo { apple: i32, bpple: i32, } fn main() { let specter: i32; let spectre: i32; // 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/needless_pass_by_ref_mut.rs
src/tools/clippy/tests/ui/needless_pass_by_ref_mut.rs
#![allow( clippy::if_same_then_else, clippy::no_effect, clippy::ptr_arg, clippy::redundant_closure_call, clippy::uninlined_format_args )] #![warn(clippy::needless_pass_by_ref_mut)] //@no-rustfix use std::ptr::NonNull; fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) { //~^ needless_pass_by_ref_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/author.rs
src/tools/clippy/tests/ui/author.rs
//@ check-pass fn main() { #[clippy::author] let x: char = 0x45 as char; }
rust
Apache-2.0
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_fold.rs
src/tools/clippy/tests/ui/unnecessary_fold.rs
#![allow(dead_code)] fn is_any(acc: bool, x: usize) -> bool { acc || x > 2 } /// Calls which should trigger the `UNNECESSARY_FOLD` lint fn unnecessary_fold() { use std::ops::{Add, Mul}; // Can be replaced by .any let _ = (0..3).fold(false, |acc, x| acc || x > 2); //~^ unnecessary_fold // Can...
rust
Apache-2.0
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_trait_in_params.rs
src/tools/clippy/tests/ui/impl_trait_in_params.rs
#![allow(unused)] #![warn(clippy::impl_trait_in_params)] //@no-rustfix: has placeholders pub trait Trait {} pub trait AnotherTrait<T> {} // Should warn pub fn a(_: impl Trait) {} //~^ impl_trait_in_params pub fn c<C: Trait>(_: C, _: impl Trait) {} //~^ impl_trait_in_params // Shouldn't warn pub fn b<B: Trait>(_: 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/search_is_some_fixable_none_2021.rs
src/tools/clippy/tests/ui/search_is_some_fixable_none_2021.rs
//@edition: 2021 #![warn(clippy::search_is_some)] fn main() { fn ref_bindings() { let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().find(|(&x, y)| x == *y).is_none(); //~^ search_is_some let _ = [&(&1, 2), &(&3, 4), &(&5, 4)].iter().find(|&(&x, y)| x == *y).is_none(); //~^ search_is_som...
rust
Apache-2.0
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_lifetimes.rs
src/tools/clippy/tests/ui/needless_lifetimes.rs
//@aux-build:proc_macros.rs #![warn(clippy::needless_lifetimes, clippy::elidable_lifetime_names)] #![allow( unused, clippy::boxed_local, clippy::extra_unused_type_parameters, clippy::needless_pass_by_value, clippy::redundant_allocation, clippy::unnecessary_wraps, dyn_drop, clippy::get_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/option_map_or_none.rs
src/tools/clippy/tests/ui/option_map_or_none.rs
#![allow(clippy::bind_instead_of_map)] fn main() { let opt = Some(1); let r: Result<i32, i32> = Ok(1); let bar = |_| Some(1); // Check `OPTION_MAP_OR_NONE`. // Single line case. let _: Option<i32> = opt.map_or(None, |x| Some(x + 1)); //~^ option_map_or_none // Multi-line case. #[ru...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/format_push_string_unfixable.rs
src/tools/clippy/tests/ui/format_push_string_unfixable.rs
//@no-rustfix #![warn(clippy::format_push_string)] mod issue9493 { pub fn u8vec_to_hex(vector: &Vec<u8>, upper: bool) -> String { let mut hex = String::with_capacity(vector.len() * 2); for byte in vector { hex += &(if upper { format!("{byte:02X}") //~^ 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/print_in_format_impl.rs
src/tools/clippy/tests/ui/print_in_format_impl.rs
#![allow(unused, clippy::print_literal, clippy::write_literal)] #![warn(clippy::print_in_format_impl)] use std::fmt::{Debug, Display, Error, Formatter}; //@no-rustfix macro_rules! indirect { () => {{ println!() }}; } macro_rules! nested { ($($tt:tt)*) => { $($tt)* }; } struct Foo; impl Debug for 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/unused_rounding.rs
src/tools/clippy/tests/ui/unused_rounding.rs
// FIXME(f16_f128): add tests when math functions are available #![warn(clippy::unused_rounding)] fn main() { let _ = 1f32.ceil(); //~^ unused_rounding let _ = 1.0f64.floor(); //~^ unused_rounding let _ = 1.00f32.round(); //~^ unused_rounding let _ = 2e-54f64.floor(); // issue9866 ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/cfg_attr_rustfmt.rs
src/tools/clippy/tests/ui/cfg_attr_rustfmt.rs
#![feature(stmt_expr_attributes)] #![allow(unused, clippy::no_effect, clippy::unnecessary_operation)] #![warn(clippy::deprecated_cfg_attr)] // This doesn't get linted, see known problems #![cfg_attr(rustfmt, rustfmt_skip)] #[rustfmt::skip] trait Foo { fn foo( ); } fn skip_on_statements() { #[cfg_attr(rustfmt, ...
rust
Apache-2.0
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_literal.rs
src/tools/clippy/tests/ui/print_literal.rs
#![warn(clippy::print_literal)] #![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_args)] fn main() { // these should be fine print!("Hello"); println!("Hello"); let world = "world"; println!("Hello {}", world); println!("Hello {world}", world = world); println!(...
rust
Apache-2.0
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_fixable.rs
src/tools/clippy/tests/ui/reversed_empty_ranges_fixable.rs
#![warn(clippy::reversed_empty_ranges)] #![allow(clippy::uninlined_format_args)] const ANSWER: i32 = 42; fn main() { // These should be linted: (42..=21).for_each(|x| println!("{}", x)); //~^ reversed_empty_ranges let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>(); //~^ reve...
rust
Apache-2.0
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_io_amount.rs
src/tools/clippy/tests/ui/unused_io_amount.rs
#![allow(dead_code, clippy::needless_pass_by_ref_mut)] #![allow(clippy::redundant_pattern_matching)] #![warn(clippy::unused_io_amount)] extern crate futures; use futures::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use std::io::{self, Read}; fn question_mark<T: io::Read + io::Write>(s: &mut T) -> io::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/coerce_container_to_any.rs
src/tools/clippy/tests/ui/coerce_container_to_any.rs
#![warn(clippy::coerce_container_to_any)] use std::any::Any; fn main() { let mut x: Box<dyn Any> = Box::new(()); let ref_x = &x; f(&x); //~^ coerce_container_to_any f(ref_x); //~^ coerce_container_to_any let _: &dyn Any = &x; //~^ coerce_container_to_any let _: &dyn Any = &mut ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/ptr_eq_no_std.rs
src/tools/clippy/tests/ui/ptr_eq_no_std.rs
#![warn(clippy::ptr_eq)] #![no_std] #![feature(lang_items)] use core::panic::PanicInfo; #[lang = "eh_personality"] extern "C" fn eh_personality() {} #[panic_handler] fn panic(info: &PanicInfo) -> ! { loop {} } macro_rules! mac { ($a:expr, $b:expr) => { $a as *const _ as usize == $b as *const _ as us...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/manual_is_multiple_of.rs
src/tools/clippy/tests/ui/manual_is_multiple_of.rs
//@aux-build: proc_macros.rs #![warn(clippy::manual_is_multiple_of)] fn main() {} #[clippy::msrv = "1.87"] fn f(a: u64, b: u64) { let _ = a % b == 0; //~ manual_is_multiple_of let _ = (a + 1) % (b + 1) == 0; //~ manual_is_multiple_of let _ = a % b != 0; //~ manual_is_multiple_of let _ = (a + 1) % (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/join_absolute_paths.rs
src/tools/clippy/tests/ui/join_absolute_paths.rs
//@no-rustfix #![allow(clippy::needless_raw_string_hashes)] #![warn(clippy::join_absolute_paths)] use std::path::{Path, PathBuf}; fn main() { let path = Path::new("/bin"); path.join("/sh"); //~^ join_absolute_paths let path = Path::new("C:\\Users"); path.join("\\user"); //~^ join_absolute_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/manual_option_as_slice.rs
src/tools/clippy/tests/ui/manual_option_as_slice.rs
#![warn(clippy::manual_option_as_slice)] #![allow(clippy::redundant_closure, clippy::unwrap_or_default)] fn check(x: Option<u32>) { _ = match x.as_ref() { //~^ manual_option_as_slice Some(f) => std::slice::from_ref(f), None => &[], }; _ = if let Some(f) = x.as_ref() { //~^ ...
rust
Apache-2.0
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_interior_mutable_const.rs
src/tools/clippy/tests/ui/borrow_interior_mutable_const.rs
//@aux-build:interior_mutable_const.rs #![deny(clippy::borrow_interior_mutable_const)] #![allow( clippy::declare_interior_mutable_const, clippy::out_of_bounds_indexing, const_item_interior_mutations, const_item_mutation, unconditional_panic )] use core::cell::{Cell, UnsafeCell}; use core::ops::{De...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/unknown_clippy_lints.rs
src/tools/clippy/tests/ui/unknown_clippy_lints.rs
#![warn(clippy::pedantic)] // Should suggest lowercase #![allow(clippy::All)] //~^ ERROR: unknown lint #![warn(clippy::CMP_OWNED)] //~^ ERROR: unknown lint // Should suggest similar clippy lint name #[warn(clippy::if_not_els)] //~^ ERROR: unknown lint #[warn(clippy::UNNecsaRy_cAst)] //~^ ERROR: unknown lint #[warn(cli...
rust
Apache-2.0
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_on_single_items.rs
src/tools/clippy/tests/ui/iter_on_single_items.rs
#![warn(clippy::iter_on_single_items)] #![allow(clippy::iter_next_slice, clippy::redundant_clone)] fn array() { assert_eq!([123].into_iter().next(), Some(123)); //~^ iter_on_single_items assert_eq!([123].iter_mut().next(), Some(&mut 123)); //~^ iter_on_single_items assert_eq!([123].iter().next(), S...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/match_single_binding.rs
src/tools/clippy/tests/ui/match_single_binding.rs
#![warn(clippy::match_single_binding)] #![allow( unused, clippy::let_unit_value, clippy::no_effect, clippy::toplevel_ref_arg, clippy::useless_vec )] struct Point { x: i32, y: i32, } fn coords() -> Point { Point { x: 1, y: 2 } } macro_rules! foo { ($param:expr) => { 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/manual_bits.rs
src/tools/clippy/tests/ui/manual_bits.rs
#![warn(clippy::manual_bits)] #![allow( clippy::no_effect, clippy::useless_conversion, path_statements, unused_must_use, clippy::unnecessary_operation, clippy::unnecessary_cast )] use std::mem::{size_of, size_of_val}; fn main() { size_of::<i8>() * 8; //~^ manual_bits size_of::<i16>...
rust
Apache-2.0
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_or.rs
src/tools/clippy/tests/ui/unwrap_or.rs
#![warn(clippy::or_fun_call)] #![allow(clippy::unnecessary_literal_unwrap)] fn main() { let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len(); //~^ or_fun_call } fn new_lines() { let s = Some(String::from("test string")).unwrap_or("Fail".to_string()).len(); //~^ or_fun_call }
rust
Apache-2.0
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_replace_macro.rs
src/tools/clippy/tests/ui/mem_replace_macro.rs
//@aux-build:proc_macros.rs #![warn(clippy::mem_replace_with_default)] extern crate proc_macros; use proc_macros::{external, inline_macros}; #[inline_macros] fn main() { let s = &mut String::from("foo"); let _ = inline!(std::mem::replace($s, Default::default())); //~^ mem_replace_with_default 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/attrs.rs
src/tools/clippy/tests/ui/attrs.rs
#![warn(clippy::inline_always, clippy::deprecated_semver)] #![allow(clippy::assertions_on_constants)] #![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)] #[inline(always)] //~^ inline_always fn test_attr_lint() { assert!(true) } #[inline(always)] fn false_positive_expr() { unr...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/derivable_impls_derive_const.rs
src/tools/clippy/tests/ui/derivable_impls_derive_const.rs
#![allow(dead_code)] #![feature(const_trait_impl)] #![feature(const_default)] #![feature(derive_const)] mod issue15493 { #[derive(Copy, Clone)] #[repr(transparent)] struct Foo(u64); impl const Default for Foo { //~^ derivable_impls fn default() -> Self { Self(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/unnecessary_map_on_constructor.rs
src/tools/clippy/tests/ui/unnecessary_map_on_constructor.rs
#![allow(unused)] #![warn(clippy::unnecessary_map_on_constructor)] use std::ffi::OsStr; fn fun(t: i32) -> i32 { t } fn notfun(e: SimpleError) -> SimpleError { e } macro_rules! expands_to_fun { () => { fun }; } #[derive(Copy, Clone)] struct SimpleError {} type SimpleResult = std::result::Res...
rust
Apache-2.0
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_overlapping_arm.rs
src/tools/clippy/tests/ui/match_overlapping_arm.rs
#![warn(clippy::match_overlapping_arm)] #![allow(clippy::redundant_pattern_matching)] #![allow(clippy::if_same_then_else, clippy::equatable_if_let, clippy::needless_ifs)] fn overlapping() { const FOO: u64 = 2; match 42 { 0..=10 => println!("0..=10"), //~^ match_overlapping_arm 0..=11 =...
rust
Apache-2.0
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_identity.rs
src/tools/clippy/tests/ui/map_identity.rs
//@require-annotations-for-level: ERROR #![warn(clippy::map_identity)] #![allow(clippy::needless_return, clippy::disallowed_names)] fn main() { let x: [u16; 3] = [1, 2, 3]; // should lint let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect(); //~^ map_identity let _: Vec<_> = x.ite...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/path_buf_push_overwrite.rs
src/tools/clippy/tests/ui/path_buf_push_overwrite.rs
use std::path::PathBuf; #[warn(clippy::path_buf_push_overwrite)] #[allow(clippy::pathbuf_init_then_push)] fn main() { let mut x = PathBuf::from("/foo"); x.push("/bar"); //~^ path_buf_push_overwrite }
rust
Apache-2.0
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.rs
src/tools/clippy/tests/ui/manual_strip.rs
#![warn(clippy::manual_strip)] //@no-rustfix fn main() { let s = "abc"; if s.starts_with("ab") { str::to_string(&s["ab".len()..]); //~^ manual_strip s["ab".len()..].to_string(); str::to_string(&s[2..]); s[2..].to_string(); } if s.ends_with("bc") { 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/collapsible_match.rs
src/tools/clippy/tests/ui/collapsible_match.rs
#![warn(clippy::collapsible_match)] #![allow( clippy::collapsible_if, clippy::equatable_if_let, clippy::needless_return, clippy::no_effect, clippy::single_match, clippy::uninlined_format_args, clippy::let_unit_value )] fn lint_cases(opt_opt: Option<Option<u32>>, res_opt: Result<Option<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/useless_asref.rs
src/tools/clippy/tests/ui/useless_asref.rs
#![deny(clippy::useless_asref)] #![allow( clippy::explicit_auto_deref, clippy::uninlined_format_args, clippy::map_clone, clippy::needless_pass_by_ref_mut, clippy::redundant_closure )] use std::fmt::Debug; use std::ops::Deref; use std::rc::{Rc, Weak as RcWeak}; use std::sync::{Arc, Weak as ArcWeak};...
rust
Apache-2.0
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_arc.rs
src/tools/clippy/tests/ui/rc_buffer_arc.rs
#![warn(clippy::rc_buffer)] use std::ffi::OsString; use std::path::PathBuf; use std::sync::{Arc, Mutex}; struct S { // triggers lint bad1: Arc<String>, //~^ rc_buffer bad2: Arc<PathBuf>, //~^ rc_buffer bad3: Arc<Vec<u8>>, //~^ rc_buffer bad4: Arc<OsString>, //~^ rc_buffer // do...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/wildcard_imports.rs
src/tools/clippy/tests/ui/wildcard_imports.rs
//@edition:2015 //@aux-build:wildcard_imports_helper.rs // the 2015 edition here is needed because edition 2018 changed the module system // (see https://doc.rust-lang.org/edition-guide/rust-2018/path-changes.html) which means the lint // no longer detects some of the cases starting with Rust 2018. #![warn(clippy::w...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/same_name_method.rs
src/tools/clippy/tests/ui/same_name_method.rs
#![warn(clippy::same_name_method)] #![allow(dead_code, non_camel_case_types)] trait T1 { fn foo() {} } trait T2 { fn foo() {} } mod should_lint { mod test_basic_case { use crate::T1; struct S; impl S { fn foo() {} //~^ same_name_method } ...
rust
Apache-2.0
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_as_bytes.rs
src/tools/clippy/tests/ui/needless_as_bytes.rs
#![warn(clippy::needless_as_bytes)] #![allow(clippy::const_is_empty)] #![feature(exact_size_is_empty)] struct S; impl S { fn as_bytes(&self) -> &[u8] { &[] } fn bytes(&self) -> &[u8] { &[] } } fn main() { if "some string".as_bytes().is_empty() { //~^ needless_as_bytes ...
rust
Apache-2.0
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_map_or_into_option.rs
src/tools/clippy/tests/ui/result_map_or_into_option.rs
#![warn(clippy::result_map_or_into_option)] fn main() { let opt: Result<u32, &str> = Ok(1); let _ = opt.map_or(None, Some); //~^ result_map_or_into_option let _ = opt.map_or_else(|_| None, Some); //~^ result_map_or_into_option #[rustfmt::skip] let _ = opt.map_or_else(|_| { None }, 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/recursive_format_impl.rs
src/tools/clippy/tests/ui/recursive_format_impl.rs
#![warn(clippy::recursive_format_impl)] #![allow( clippy::borrow_deref_ref, clippy::deref_addrof, clippy::inherent_to_string_shadow_display, clippy::to_string_in_format_args, clippy::uninlined_format_args )] use std::fmt; struct A; impl A { fn fmt(&self) { self.to_string(); } } tr...
rust
Apache-2.0
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.rs
src/tools/clippy/tests/ui/fn_to_numeric_cast.rs
//@revisions: r32bit r64bit //@[r32bit]ignore-bitwidth: 64 //@[r64bit]ignore-bitwidth: 32 //@no-rustfix #![warn(clippy::fn_to_numeric_cast, clippy::fn_to_numeric_cast_with_truncation)] #![allow(function_casts_as_integer)] fn foo() -> String { String::new() } fn test_function_to_numeric_cast() { let _ = foo 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/unneeded_field_pattern.rs
src/tools/clippy/tests/ui/unneeded_field_pattern.rs
//@aux-build:proc_macros.rs #![warn(clippy::unneeded_field_pattern)] #![allow(dead_code, unused, clippy::single_match)] #[macro_use] extern crate proc_macros; struct Foo { a: i32, b: i32, c: i32, } fn main() { let f = Foo { a: 0, b: 0, c: 0 }; match f { Foo { a: _, b: 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/char_indices_as_byte_indices.rs
src/tools/clippy/tests/ui/char_indices_as_byte_indices.rs
#![warn(clippy::char_indices_as_byte_indices)] trait StrExt { fn use_index(&self, _: usize); } impl StrExt for str { fn use_index(&self, _: usize) {} } fn bad(prim: &str, string: String) { for (idx, _) in prim.chars().enumerate() { let _ = prim[..idx]; //~^ char_indices_as_byte_indices ...
rust
Apache-2.0
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_div_ceil_with_feature.rs
src/tools/clippy/tests/ui/manual_div_ceil_with_feature.rs
#![warn(clippy::manual_div_ceil)] #![feature(int_roundings)] fn main() { let x = 7_i32; let y = 4_i32; let z = 3_i32; let z_u: u32 = 11; // Lint. let _ = (x + (y - 1)) / y; //~^ manual_div_ceil let _ = ((y - 1) + x) / y; //~^ manual_div_ceil let _ = (x + y - 1) / y; //~^ ma...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/let_underscore_lock.rs
src/tools/clippy/tests/ui/let_underscore_lock.rs
#![warn(clippy::let_underscore_lock)] extern crate parking_lot; fn main() { use parking_lot::lock_api::RawMutex; use parking_lot::{Mutex, RwLock}; let p_m: Mutex<()> = Mutex::const_new(RawMutex::INIT, ()); let _ = p_m.lock(); //~^ ERROR: non-binding `let` on a synchronization lock let p_m1 =...
rust
Apache-2.0
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_slicing.rs
src/tools/clippy/tests/ui/redundant_slicing.rs
#![allow(unused, clippy::deref_by_slicing)] #![warn(clippy::redundant_slicing)] use std::io::Read; fn main() { let slice: &[u32] = &[0]; let _ = &slice[..]; // Redundant slice // //~^^ redundant_slicing let v = vec![0]; let _ = &v[..]; // Ok, results in `&[_]` let _ = &(&*v)[..]; // Outer...
rust
Apache-2.0
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_ref_to_ref_no_std.rs
src/tools/clippy/tests/ui/transmute_ref_to_ref_no_std.rs
//@no-rustfix #![deny(clippy::transmute_ptr_to_ptr)] #![allow(dead_code, clippy::missing_transmute_annotations)] #![feature(lang_items)] #![no_std] use core::panic::PanicInfo; #[lang = "eh_personality"] extern "C" fn eh_personality() {} #[panic_handler] fn panic(info: &PanicInfo) -> ! { loop {} } 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/iter_nth_zero.rs
src/tools/clippy/tests/ui/iter_nth_zero.rs
#![warn(clippy::iter_nth_zero)] use std::collections::HashSet; struct Foo; impl Foo { fn nth(&self, index: usize) -> usize { index + 1 } } fn main() { let f = Foo {}; f.nth(0); // lint does not apply here let mut s = HashSet::new(); s.insert(1); let _x = s.iter().nth(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/zero_offset.rs
src/tools/clippy/tests/ui/zero_offset.rs
#[allow(clippy::borrow_as_ptr, clippy::ptr_offset_by_literal)] fn main() { unsafe { let m = &mut () as *mut (); m.offset(0); //~^ zst_offset m.wrapping_add(0); //~^ zst_offset m.sub(0); //~^ zst_offset m.wrapping_sub(0); //~^ zst_offset ...
rust
Apache-2.0
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_ref_pats.rs
src/tools/clippy/tests/ui/match_ref_pats.rs
#![warn(clippy::match_ref_pats)] #![allow(dead_code, unused_variables)] #![allow( clippy::enum_variant_names, clippy::equatable_if_let, clippy::uninlined_format_args, clippy::empty_loop, clippy::diverging_sub_expression )] fn ref_pats() { { let v = &Some(0); match 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/iter_next_slice.rs
src/tools/clippy/tests/ui/iter_next_slice.rs
#![warn(clippy::iter_next_slice)] #![allow(clippy::useless_vec)] fn main() { // test code goes here let s = [1, 2, 3]; let v = vec![1, 2, 3]; let _ = s.iter().next(); //~^ iter_next_slice // Should be replaced by s.first() let _ = s[2..].iter().next(); //~^ iter_next_slice // Shou...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs
src/tools/clippy/tests/ui/literal_string_with_formatting_arg.rs
#![warn(clippy::literal_string_with_formatting_args)] #![allow(clippy::unnecessary_literal_unwrap)] // Regression test for <https://github.com/rust-lang/rust-clippy/issues/13885>. // It's not supposed to emit the lint in this case (in `assert!` expansion). fn compiler_macro() { fn parse(_: &str) -> Result<(), i32>...
rust
Apache-2.0
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_inception.rs
src/tools/clippy/tests/ui/module_inception.rs
#![warn(clippy::module_inception)] pub mod foo2 { pub mod bar2 { pub mod bar2 { //~^ module_inception pub mod foo2 {} } pub mod foo2 {} } pub mod foo2 { //~^ module_inception pub mod bar2 {} } } mod foo { mod bar { mod 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/zombie_processes.rs
src/tools/clippy/tests/ui/zombie_processes.rs
#![warn(clippy::zombie_processes)] #![allow(clippy::if_same_then_else, clippy::ifs_same_cond, clippy::needless_return)] use std::process::{Child, Command, ExitStatus}; fn main() { { // Check that #[expect] works #[expect(clippy::zombie_processes)] let mut x = Command::new("").spawn().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/reversed_empty_ranges_loops_unfixable.rs
src/tools/clippy/tests/ui/reversed_empty_ranges_loops_unfixable.rs
#![warn(clippy::reversed_empty_ranges)] #![allow(clippy::uninlined_format_args)] fn main() { for i in 5..5 { //~^ reversed_empty_ranges println!("{}", i); } for i in (5 + 2)..(8 - 1) { //~^ reversed_empty_ranges println!("{}", 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_hasher.rs
src/tools/clippy/tests/ui/implicit_hasher.rs
//@aux-build:proc_macros.rs #![deny(clippy::implicit_hasher)] #[macro_use] extern crate proc_macros; use std::cmp::Eq; use std::collections::{HashMap, HashSet}; use std::hash::{BuildHasher, Hash}; pub trait Foo<T>: Sized { fn make() -> (Self, Self); } impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> { //~^ 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/init_numbered_fields.rs
src/tools/clippy/tests/ui/init_numbered_fields.rs
#![warn(clippy::init_numbered_fields)] #[derive(Default)] struct TupleStruct(u32, u32, u8); // This shouldn't lint because it's in a macro macro_rules! tuple_struct_init { () => { TupleStruct { 0: 0, 1: 1, 2: 2 } }; } fn main() { let tuple_struct = TupleStruct::default(); // This should lint...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/trailing_empty_array.rs
src/tools/clippy/tests/ui/trailing_empty_array.rs
#![warn(clippy::trailing_empty_array)] #![allow(clippy::repr_packed_without_abi)] // Do lint: struct RarelyUseful { //~^ trailing_empty_array field: i32, last: [usize; 0], } struct OnlyField { //~^ trailing_empty_array first_and_last: [usize; 0], } struct GenericArrayType<T> { //~^ trailing_...
rust
Apache-2.0
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_component_path_imports.rs
src/tools/clippy/tests/ui/single_component_path_imports.rs
#![warn(clippy::single_component_path_imports)] #![allow(unused_imports)] use core; use regex; //~^ single_component_path_imports use serde as edres; pub use serde; use std; macro_rules! m { () => { use regex; }; } fn main() { regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap(); // False ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/repeat_vec_with_capacity_nostd.rs
src/tools/clippy/tests/ui/repeat_vec_with_capacity_nostd.rs
#![warn(clippy::repeat_vec_with_capacity)] #![allow(clippy::manual_repeat_n)] #![no_std] use core::iter; extern crate alloc; use alloc::vec::Vec; fn nostd() { let _: Vec<Vec<u8>> = iter::repeat(Vec::with_capacity(42)).take(123).collect(); //~^ repeat_vec_with_capacity }
rust
Apache-2.0
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_minimal_cfg.rs
src/tools/clippy/tests/ui/non_minimal_cfg.rs
#![allow(unused)] #[cfg(all(windows))] //~^ non_minimal_cfg fn hermit() {} #[cfg(any(windows))] //~^ non_minimal_cfg fn wasi() {} #[cfg(all(any(unix), all(not(windows))))] //~^ non_minimal_cfg //~| non_minimal_cfg fn the_end() {} #[cfg(any())] fn any() {} 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/issue-7447.rs
src/tools/clippy/tests/ui/issue-7447.rs
use std::borrow::Cow; use std::collections::BTreeMap; use std::marker::PhantomData; use std::sync::Arc; fn byte_view<'a>(s: &'a ByteView<'_>) -> BTreeMap<&'a str, ByteView<'a>> { panic!() } fn group_entries(s: &()) -> BTreeMap<Cow<'_, str>, Vec<Cow<'_, str>>> { todo!() } struct Mmap; enum ByteViewBacking<'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/set_contains_or_insert.rs
src/tools/clippy/tests/ui/set_contains_or_insert.rs
#![allow(unused)] #![allow(clippy::nonminimal_bool)] #![allow(clippy::needless_borrow)] #![warn(clippy::set_contains_or_insert)] use std::collections::{BTreeSet, HashSet}; fn should_warn_hashset() { let mut set = HashSet::new(); let value = 5; if !set.contains(&value) { //~^ set_contains_or_inser...
rust
Apache-2.0
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_allocation_fixable.rs
src/tools/clippy/tests/ui/redundant_allocation_fixable.rs
#![allow(clippy::boxed_local, clippy::needless_pass_by_value)] #![allow(clippy::disallowed_names)] pub struct MyStruct; pub struct SubT<T> { foo: T, } pub enum MyEnum { One, Two, } mod outer_box { use crate::{MyEnum, MyStruct, SubT}; use std::boxed::Box; use std::rc::Rc; use std::sync::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/unsafe_removed_from_name.rs
src/tools/clippy/tests/ui/unsafe_removed_from_name.rs
#![allow(unused_imports)] #![allow(dead_code)] #![warn(clippy::unsafe_removed_from_name)] use std::cell::UnsafeCell as TotallySafeCell; //~^ unsafe_removed_from_name use std::cell::UnsafeCell as TotallySafeCellAgain; //~^ unsafe_removed_from_name // Shouldn't error use std::cell::RefCell as ProbablyNotUnsafe; use s...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/mem_replace.rs
src/tools/clippy/tests/ui/mem_replace.rs
#![allow(unused, clippy::needless_lifetimes)] #![warn( clippy::style, clippy::mem_replace_option_with_none, clippy::mem_replace_with_default )] use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, LinkedList, VecDeque}; use std::mem; fn replace_option_with_none() { let mut an_optio...
rust
Apache-2.0
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.rs
src/tools/clippy/tests/ui/range.rs
#![allow(clippy::useless_vec)] #[warn(clippy::range_zip_with_len)] fn main() { let v1: Vec<u64> = vec![1, 2, 3]; let v2: Vec<u64> = vec![4, 5]; let _x = v1.iter().zip(0..v1.len()); //~^ range_zip_with_len //~v range_zip_with_len for (e, i) in v1.iter().zip(0..v1.len()) { let _: &u64 = 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/entry_unfixable.rs
src/tools/clippy/tests/ui/entry_unfixable.rs
#![allow(clippy::needless_pass_by_value, clippy::collapsible_if)] #![warn(clippy::map_entry)] use std::collections::HashMap; use std::hash::Hash; macro_rules! m { ($e:expr) => {{ $e }}; } macro_rules! insert { ($map:expr, $key:expr, $val:expr) => { $map.insert($key, $val) }; } mod issue13306 { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/int_plus_one.rs
src/tools/clippy/tests/ui/int_plus_one.rs
#[allow(clippy::no_effect, clippy::unnecessary_operation)] #[warn(clippy::int_plus_one)] fn main() { let x = 1i32; let y = 0i32; let _ = x >= y + 1; //~^ int_plus_one let _ = y + 1 <= x; //~^ int_plus_one let _ = x - 1 >= y; //~^ int_plus_one let _ = y <= x - 1; //~^ int_plus_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/unnecessary_operation.rs
src/tools/clippy/tests/ui/unnecessary_operation.rs
#![allow( clippy::deref_addrof, clippy::no_effect, clippy::uninlined_format_args, clippy::unnecessary_struct_initialization, dead_code, unused )] #![warn(clippy::unnecessary_operation)] use std::fmt::Display; use std::ops::Shl; struct Tuple(i32); struct Struct { field: i32, } enum Enum { ...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/{literal_string_with_formatting_args}.rs
src/tools/clippy/tests/ui/{literal_string_with_formatting_args}.rs
//@check-pass // Regression test for <https://github.com/rust-lang/rust-clippy/issues/13885>. // The `dbg` macro generates a literal with the name of the current file, so // we need to ensure the lint is not emitted in this case. // Clippy sets `-Zflatten_format_args=no`, which changes the default behavior of how for...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false
rust-lang/rust
https://github.com/rust-lang/rust/blob/f8b1d59a81c700cb7aa25cf69e3032b3ce333150/src/tools/clippy/tests/ui/unnecessary_fallible_conversions.rs
src/tools/clippy/tests/ui/unnecessary_fallible_conversions.rs
#![warn(clippy::unnecessary_fallible_conversions)] fn main() { // --- TryFromMethod `T::try_from(u)` --- let _: i64 = 0i32.try_into().unwrap(); //~^ unnecessary_fallible_conversions let _: i64 = 0i32.try_into().expect("can't happen"); //~^ unnecessary_fallible_conversions // --- TryFromFunct...
rust
Apache-2.0
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.rs
src/tools/clippy/tests/ui/clone_on_copy.rs
#![warn(clippy::clone_on_copy)] #![allow( clippy::redundant_clone, clippy::deref_addrof, clippy::no_effect, clippy::unnecessary_operation, clippy::toplevel_ref_arg, clippy::needless_borrow )] use std::cell::RefCell; fn main() { 42.clone(); //~^ clone_on_copy vec![1].clone(); // 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/len_zero_ranges.rs
src/tools/clippy/tests/ui/len_zero_ranges.rs
#![warn(clippy::len_zero)] #![allow(unused)] // Now that `Range(Inclusive)::is_empty` is stable (1.47), we can always suggest this mod issue_3807 { fn suggestion_is_fine_range() { let _ = (0..42).len() == 0; //~^ len_zero } fn suggestion_is_fine_range_inclusive() { let _ = (0_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/decimal_literal_representation.rs
src/tools/clippy/tests/ui/decimal_literal_representation.rs
#[warn(clippy::decimal_literal_representation)] #[allow(unused_variables)] #[rustfmt::skip] fn main() { let good = ( // Hex: 127, // 0x7F 256, // 0x100 511, // 0x1FF 2048, // 0x800 4090, // 0xFFA 16_371, // ...
rust
Apache-2.0
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.rs
src/tools/clippy/tests/ui/doc_suspicious_footnotes.rs
#![warn(clippy::doc_suspicious_footnotes)] #![allow(clippy::needless_raw_string_hashes)] //! This is not a footnote[^1]. //~^ doc_suspicious_footnotes //! //! This is not a footnote[^either], but it doesn't warn. //! //! This is not a footnote\[^1], but it also doesn't warn. //! //! This is not a footnote[^1\], but 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/if_not_else_bittest.rs
src/tools/clippy/tests/ui/if_not_else_bittest.rs
//@ check-pass #![deny(clippy::if_not_else)] fn show_permissions(flags: u32) { if flags & 0x0F00 != 0 { println!("Has the 0x0F00 permission."); } else { println!("The 0x0F00 permission is missing."); } } 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/flat_map_identity.rs
src/tools/clippy/tests/ui/flat_map_identity.rs
#![allow(unused_imports, clippy::needless_return)] #![warn(clippy::flat_map_identity)] use std::convert; fn main() { let iterator = [[0, 1], [2, 3], [4, 5]].iter(); let _ = iterator.flat_map(|x| x); //~^ flat_map_identity let iterator = [[0, 1], [2, 3], [4, 5]].iter(); let _ = iterator.flat_map(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/unnecessary_get_then_check.rs
src/tools/clippy/tests/ui/unnecessary_get_then_check.rs
#![warn(clippy::unnecessary_get_then_check)] use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; fn main() { let s: HashSet<String> = HashSet::new(); let _ = s.get("a").is_some(); //~^ unnecessary_get_then_check let _ = s.get("a").is_none(); //~^ unnecessary_get_then_check let s: Ha...
rust
Apache-2.0
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_async_fn.rs
src/tools/clippy/tests/ui/manual_async_fn.rs
#![warn(clippy::manual_async_fn)] #![allow(clippy::needless_pub_self, unused)] use std::future::Future; fn fut() -> impl Future<Output = i32> { //~^ manual_async_fn async { 42 } } #[rustfmt::skip] fn fut2() ->impl Future<Output = i32> { //~^ manual_async_fn async { 42 } } #[rustfmt::skip] fn fut3()-> im...
rust
Apache-2.0
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_unit.rs
src/tools/clippy/tests/ui/must_use_unit.rs
//@aux-build:proc_macros.rs #![warn(clippy::must_use_unit)] #![allow(clippy::unused_unit)] extern crate proc_macros; use proc_macros::external; #[must_use] pub fn must_use_default() {} //~^ must_use_unit #[must_use] pub fn must_use_unit() -> () {} //~^ must_use_unit #[must_use = "With note"] pub fn must_use_with_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/useless_conversion_try.rs
src/tools/clippy/tests/ui/useless_conversion_try.rs
#![deny(clippy::useless_conversion)] #![allow( clippy::needless_ifs, clippy::unnecessary_fallible_conversions, clippy::manual_unwrap_or_default )] fn test_generic<T: Copy>(val: T) -> T { let _ = T::try_from(val).unwrap(); //~^ useless_conversion val.try_into().unwrap() //~^ useless_convers...
rust
Apache-2.0
f8b1d59a81c700cb7aa25cf69e3032b3ce333150
2026-01-04T15:31:58.503980Z
false