From e6db4b07c094ed467b72c3de321d59ed9c411235 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 15:35:46 +0100 Subject: [PATCH 1/8] Add clippy-specific rustfix test runner! This will 1. take the files from the new clippy_tests' crate's examples dir 2. use `cargo check` (with clippy-driver as rustc) to compile them 3. apply the suggested fixes 4. compile the fixed file By default, it only logs which files failed one of the steps. Set `RUST_LOG=clippy_test=info` (or `debug`) to get more information. You can also set `RUSTFIX_PLS_FIX_AND_RECORD_MY_CODE=true` to have it write the recored fixes to `examples/$originalName--recorded.rs`. (Needs to be separated with `--` instead of `.` because it needs to be a valid crate name for cargo to compile it as an example.) PS: Because we have a lot of examples, I took the liberty of using rayon to have as many cargos as possible running at the same time. I'm not sure how much of a speedup this is going to get us, but it was definitely faster than without it, and was quite easy to do. --- clippy_tests/.gitignore | 1 + clippy_tests/Cargo.toml | 17 ++++ clippy_tests/examples/.gitignore | 1 + clippy_tests/src/compile.rs | 52 +++++++++++ clippy_tests/src/fix.rs | 44 ++++++++++ clippy_tests/src/main.rs | 145 +++++++++++++++++++++++++++++++ 6 files changed, 260 insertions(+) create mode 100644 clippy_tests/.gitignore create mode 100644 clippy_tests/Cargo.toml create mode 100644 clippy_tests/examples/.gitignore create mode 100644 clippy_tests/src/compile.rs create mode 100644 clippy_tests/src/fix.rs create mode 100644 clippy_tests/src/main.rs diff --git a/clippy_tests/.gitignore b/clippy_tests/.gitignore new file mode 100644 index 000000000000..eb5a316cbd19 --- /dev/null +++ b/clippy_tests/.gitignore @@ -0,0 +1 @@ +target diff --git a/clippy_tests/Cargo.toml b/clippy_tests/Cargo.toml new file mode 100644 index 000000000000..8ee55c5ccdc9 --- /dev/null +++ b/clippy_tests/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "clippy_tests" +version = "0.1.0" +authors = ["Pascal Hertleif "] + +[dependencies] +duct = "0.8.2" +env_logger = "0.5.0-rc.1" +failure = "0.1.1" +failure_derive = "0.1.1" +log = "0.4.1" +pretty_assertions = "0.4.1" +# rustfix = { git = "https://github.com/killercup/rustfix" } +rustfix = { path = '../../../rustfix' } +serde_json = "1.0" +tempdir = "0.3.5" +rayon = "0.9.0" diff --git a/clippy_tests/examples/.gitignore b/clippy_tests/examples/.gitignore new file mode 100644 index 000000000000..e900cc622c46 --- /dev/null +++ b/clippy_tests/examples/.gitignore @@ -0,0 +1 @@ +*--recorded.rs diff --git a/clippy_tests/src/compile.rs b/clippy_tests/src/compile.rs new file mode 100644 index 000000000000..2721ab9bd527 --- /dev/null +++ b/clippy_tests/src/compile.rs @@ -0,0 +1,52 @@ +use std::path::Path; +use failure::{Error, err_msg}; +use std::process::Output; + +pub fn compile(file: &Path) -> Result { + let example_name = file.file_stem() + .ok_or_else(|| err_msg(format!("Couldn't get file name from {:?}", file)))?; + + let better_call_clippy = cmd!( + "cargo", "check", + "--example", example_name, + "--message-format=json", "--quiet" + ); + let res = better_call_clippy + .env("RUSTC_WRAPPER", "clippy-driver") + .env("CLIPPY_DISABLE_DOCS_LINKS", "true") + .stdout_capture() + .stderr_capture() + .unchecked() + .run()?; + + Ok(res) +} + +pub fn compile_and_get_json_errors(file: &Path) -> Result { + let res = compile(file)?; + let stderr = String::from_utf8(res.stderr)?; + + match res.status.code() { + Some(0) | Some(1) | Some(101) => Ok(stderr), + _ => Err(err_msg( + format!("failed with status {:?}: {}", res.status.code(), stderr), + )) + } +} + +pub fn compiles_without_errors(file: &Path) -> Result<(), Error> { + let res = compile(file)?; + + match res.status.code() { + Some(0) => Ok(()), + _ => { + debug!("file {:?} failed to compile:\n{}\n{}", + file, String::from_utf8(res.stdout)?, String::from_utf8(res.stderr)? + ); + Err(err_msg(format!( + "failed with status {:?} (`env RUST_LOG=clippy_test=info` for more info)", + res.status.code(), + ))) + } + } +} diff --git a/clippy_tests/src/fix.rs b/clippy_tests/src/fix.rs new file mode 100644 index 000000000000..934cac8dccb7 --- /dev/null +++ b/clippy_tests/src/fix.rs @@ -0,0 +1,44 @@ +use rustfix::Replacement; +use failure::Error; + +pub fn apply_suggestion(file_content: &mut String, suggestion: &Replacement) -> Result { + use std::cmp::max; + + let mut new_content = String::new(); + + // Add the lines before the section we want to replace + new_content.push_str(&file_content.lines() + .take(max(suggestion.snippet.line_range.start.line - 1, 0) as usize) + .collect::>() + .join("\n")); + new_content.push_str("\n"); + + // Parts of line before replacement + new_content.push_str(&file_content.lines() + .nth(suggestion.snippet.line_range.start.line - 1) + .unwrap_or("") + .chars() + .take(suggestion.snippet.line_range.start.column - 1) + .collect::()); + + // Insert new content! Finally! + new_content.push_str(&suggestion.replacement); + + // Parts of line after replacement + new_content.push_str(&file_content.lines() + .nth(suggestion.snippet.line_range.end.line - 1) + .unwrap_or("") + .chars() + .skip(suggestion.snippet.line_range.end.column - 1) + .collect::()); + + // Add the lines after the section we want to replace + new_content.push_str("\n"); + new_content.push_str(&file_content.lines() + .skip(suggestion.snippet.line_range.end.line as usize) + .collect::>() + .join("\n")); + new_content.push_str("\n"); + + Ok(new_content) +} diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs new file mode 100644 index 000000000000..660e45d7a194 --- /dev/null +++ b/clippy_tests/src/main.rs @@ -0,0 +1,145 @@ +extern crate serde_json; +#[macro_use] extern crate failure_derive; +extern crate failure; +#[macro_use] extern crate log; +#[macro_use] extern crate duct; +#[macro_use] extern crate pretty_assertions; +extern crate tempdir; +extern crate env_logger; +extern crate rayon; +extern crate rustfix; + +use std::fs; +use std::path::{Path, PathBuf}; +use std::collections::HashSet; +use failure::{Error, ResultExt, err_msg}; +use rayon::prelude::*; + +mod compile; +use compile::*; +mod fix; + +fn read_file(path: &Path) -> Result { + use std::io::Read; + + let mut buffer = String::new(); + let mut file = fs::File::open(path)?; + file.read_to_string(&mut buffer)?; + Ok(buffer) +} + +fn rename(file: &Path, suffix: &str) -> Result { + let name = file.file_stem() + .ok_or_else(|| err_msg(format!("Couldn't get file stem from {:?}", file)))? + .to_str() + .ok_or_else(|| err_msg(format!("Couldn't parse file stem from {:?}", file)))?; + + Ok(file.with_file_name(&format!("{}--{}.rs", name, suffix))) +} + +#[derive(Fail, Debug)] +#[fail(display = "Could not test suggestions, there was no assertion file")] +pub struct NoSuggestionsTestFile; + +#[derive(Fail, Debug)] +#[fail(display = "Could not test human readable error messages, there was no assertion file")] +pub struct NoUiTestFile; + +fn test_rustfix_with_file>(file: P) -> Result<(), Error> { + let file: &Path = file.as_ref(); + let fixed_file = rename(file, "fixed")?; + + debug!("testing: {:?}", file); + + let code = read_file(file)?; + debug!("compiling... {:?}", file); + let errors = compile_and_get_json_errors(file)?; + debug!("collecting suggestions for {:?}", file); + let suggestions = rustfix::get_suggestions_from_json(&errors, &HashSet::new()); + + let mut fixed = code.clone(); + + debug!("applying suggestions for {:?}", file); + for sug in suggestions.into_iter().rev() { + trace!("{:?}", sug); + for sol in sug.solutions { + trace!("{:?}", sol); + for r in sol.replacements { + debug!("replaced."); + trace!("{:?}", r); + fixed = fix::apply_suggestion(&mut fixed, &r)?; + } + } + } + + if std::env::var("RUSTFIX_PLS_FIX_AND_RECORD_MY_CODE").is_ok() { + use std::io::Write; + let fixes_recording = rename(file, "recorded")?; + let mut recorded_rust = fs::File::create(&fixes_recording)?; + recorded_rust.write_all(fixed.as_bytes())?; + debug!("wrote recorded fixes for {:?} to {:?}", file, fixes_recording); + } + + let expected_fixed = read_file(&fixed_file).map_err(|_| NoSuggestionsTestFile)?; + assert_eq!(fixed.trim(), expected_fixed.trim(), "file doesn't look fixed"); + + debug!("compiling fixed file {:?}", fixed_file); + compiles_without_errors(&fixed_file)?; + + Ok(()) +} + +fn get_fixture_files() -> Result, Error> { + Ok(fs::read_dir("./examples").context("couldn't read examples dir")? + .into_iter() + .map(|e| e.unwrap().path()) + .filter(|p| p.is_file()) + .filter(|p| { + let x = p.to_string_lossy(); + x.ends_with(".rs") && !x.ends_with("--fixed.rs") && !x.ends_with("--recorded.rs") + }) + .collect()) +} + +fn main() { + use std::sync::atomic::{AtomicUsize, Ordering}; + + env_logger::init(); + let files = get_fixture_files().unwrap(); + + let passed = AtomicUsize::new(0); + let failed = AtomicUsize::new(0); + let ignored = AtomicUsize::new(0); + + files.par_iter().for_each(|file| { + match test_rustfix_with_file(&file) { + Ok(_) => { + info!("passed: {:?}", file); + passed.fetch_add(1, Ordering::SeqCst); + }, + Err(e) => { + match e.downcast::() { + Ok(e) => { + info!("ignored: {:?} (no fixed file)", file); + debug!("{:?}", e); + ignored.fetch_add(1, Ordering::SeqCst); + }, + Err(e) => { + warn!("failed: {:?}", file); + debug!("{:?}", e); + failed.fetch_add(1, Ordering::SeqCst); + } + } + } + } + }); + + let passed = passed.into_inner(); + let failed = failed.into_inner(); + let ignored = ignored.into_inner(); + let res = if failed > 0 { "failed" } else { "ok" }; + println!( + "test result: {}. {} passed; {} failed; {} ignored;", + res, passed, failed, ignored, + ); +} From b476a9bc3e93816a22b1e4cdcdeb429be6b60997 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 15:45:08 +0100 Subject: [PATCH 2/8] Move UI tests to new test crate Running `cargo run` in `clippy_test/` will now output: test result: ok. 0 passed; 0 failed; 174 ignored; This is expected. There are no `--fixed.rs` files, so we don't try to make any assertions on the applied suggestions. Furthermore, we haven't implemented tests for the human-readable diagnostics, so we don't care about those `.stderr` files at all for now. --- {tests/ui => clippy_tests/examples}/absurd-extreme-comparisons.rs | 0 .../examples}/absurd-extreme-comparisons.stderr | 0 {tests/ui => clippy_tests/examples}/approx_const.rs | 0 {tests/ui => clippy_tests/examples}/approx_const.stderr | 0 {tests/ui => clippy_tests/examples}/arithmetic.rs | 0 {tests/ui => clippy_tests/examples}/arithmetic.stderr | 0 {tests/ui => clippy_tests/examples}/array_indexing.rs | 0 {tests/ui => clippy_tests/examples}/array_indexing.stderr | 0 {tests/ui => clippy_tests/examples}/assign_ops.rs | 0 {tests/ui => clippy_tests/examples}/assign_ops.stderr | 0 {tests/ui => clippy_tests/examples}/assign_ops2.rs | 0 {tests/ui => clippy_tests/examples}/assign_ops2.stderr | 0 {tests/ui => clippy_tests/examples}/attrs.rs | 0 {tests/ui => clippy_tests/examples}/attrs.stderr | 0 {tests/ui => clippy_tests/examples}/bit_masks.rs | 0 {tests/ui => clippy_tests/examples}/bit_masks.stderr | 0 {tests/ui => clippy_tests/examples}/blacklisted_name.rs | 0 {tests/ui => clippy_tests/examples}/blacklisted_name.stderr | 0 {tests/ui => clippy_tests/examples}/block_in_if_condition.rs | 0 {tests/ui => clippy_tests/examples}/block_in_if_condition.stderr | 0 {tests/ui => clippy_tests/examples}/bool_comparison.rs | 0 {tests/ui => clippy_tests/examples}/bool_comparison.stderr | 0 {tests/ui => clippy_tests/examples}/booleans.rs | 0 {tests/ui => clippy_tests/examples}/booleans.stderr | 0 {tests/ui => clippy_tests/examples}/borrow_box.rs | 0 {tests/ui => clippy_tests/examples}/borrow_box.stderr | 0 {tests/ui => clippy_tests/examples}/box_vec.rs | 0 {tests/ui => clippy_tests/examples}/box_vec.stderr | 0 {tests/ui => clippy_tests/examples}/builtin-type-shadow.rs | 0 {tests/ui => clippy_tests/examples}/builtin-type-shadow.stderr | 0 {tests/ui => clippy_tests/examples}/bytecount.rs | 0 {tests/ui => clippy_tests/examples}/bytecount.stderr | 0 {tests/ui => clippy_tests/examples}/cast.rs | 0 {tests/ui => clippy_tests/examples}/cast.stderr | 0 {tests/ui => clippy_tests/examples}/cast_lossless_float.rs | 0 {tests/ui => clippy_tests/examples}/cast_lossless_float.stderr | 0 {tests/ui => clippy_tests/examples}/cast_lossless_integer.rs | 0 {tests/ui => clippy_tests/examples}/cast_lossless_integer.stderr | 0 {tests/ui => clippy_tests/examples}/cast_size.rs | 0 {tests/ui => clippy_tests/examples}/cast_size.stderr | 0 {tests/ui => clippy_tests/examples}/char_lit_as_u8.rs | 0 {tests/ui => clippy_tests/examples}/char_lit_as_u8.stderr | 0 {tests/ui => clippy_tests/examples}/clone_on_copy_impl.rs | 0 {tests/ui => clippy_tests/examples}/clone_on_copy_mut.rs | 0 {tests/ui => clippy_tests/examples}/cmp_nan.rs | 0 {tests/ui => clippy_tests/examples}/cmp_nan.stderr | 0 {tests/ui => clippy_tests/examples}/cmp_null.rs | 0 {tests/ui => clippy_tests/examples}/cmp_null.stderr | 0 {tests/ui => clippy_tests/examples}/cmp_owned.rs | 0 {tests/ui => clippy_tests/examples}/cmp_owned.stderr | 0 {tests/ui => clippy_tests/examples}/collapsible_if.rs | 0 {tests/ui => clippy_tests/examples}/collapsible_if.stderr | 0 {tests/ui => clippy_tests/examples}/complex_types.rs | 0 {tests/ui => clippy_tests/examples}/complex_types.stderr | 0 {tests/ui => clippy_tests/examples}/conf_bad_arg.rs | 0 {tests/ui => clippy_tests/examples}/conf_bad_arg.stderr | 0 {tests/ui => clippy_tests/examples}/conf_bad_toml.rs | 0 {tests/ui => clippy_tests/examples}/conf_bad_toml.stderr | 0 {tests/ui => clippy_tests/examples}/conf_bad_toml.toml | 0 {tests/ui => clippy_tests/examples}/conf_bad_type.rs | 0 {tests/ui => clippy_tests/examples}/conf_bad_type.stderr | 0 {tests/ui => clippy_tests/examples}/conf_bad_type.toml | 0 .../ui => clippy_tests/examples}/conf_french_blacklisted_name.rs | 0 .../examples}/conf_french_blacklisted_name.stderr | 0 {tests/ui => clippy_tests/examples}/conf_path_non_string.rs | 0 {tests/ui => clippy_tests/examples}/conf_path_non_string.stderr | 0 {tests/ui => clippy_tests/examples}/conf_unknown_key.rs | 0 {tests/ui => clippy_tests/examples}/conf_unknown_key.stderr | 0 {tests/ui => clippy_tests/examples}/const_static_lifetime.rs | 0 {tests/ui => clippy_tests/examples}/const_static_lifetime.stderr | 0 {tests/ui => clippy_tests/examples}/copies.rs | 0 {tests/ui => clippy_tests/examples}/copies.stderr | 0 {tests/ui => clippy_tests/examples}/cstring.rs | 0 {tests/ui => clippy_tests/examples}/cstring.stderr | 0 {tests/ui => clippy_tests/examples}/cyclomatic_complexity.rs | 0 {tests/ui => clippy_tests/examples}/cyclomatic_complexity.stderr | 0 .../examples}/cyclomatic_complexity_attr_used.rs | 0 .../examples}/cyclomatic_complexity_attr_used.stderr | 0 {tests/ui => clippy_tests/examples}/deprecated.rs | 0 {tests/ui => clippy_tests/examples}/deprecated.stderr | 0 {tests/ui => clippy_tests/examples}/derive.rs | 0 {tests/ui => clippy_tests/examples}/derive.stderr | 0 {tests/ui => clippy_tests/examples}/diverging_sub_expression.rs | 0 .../ui => clippy_tests/examples}/diverging_sub_expression.stderr | 0 {tests/ui => clippy_tests/examples}/dlist.rs | 0 {tests/ui => clippy_tests/examples}/dlist.stderr | 0 {tests/ui => clippy_tests/examples}/doc.rs | 0 {tests/ui => clippy_tests/examples}/doc.stderr | 0 {tests/ui => clippy_tests/examples}/double_neg.rs | 0 {tests/ui => clippy_tests/examples}/double_neg.stderr | 0 {tests/ui => clippy_tests/examples}/double_parens.rs | 0 {tests/ui => clippy_tests/examples}/double_parens.stderr | 0 {tests/ui => clippy_tests/examples}/drop_forget_copy.rs | 0 {tests/ui => clippy_tests/examples}/drop_forget_copy.stderr | 0 {tests/ui => clippy_tests/examples}/drop_forget_ref.rs | 0 {tests/ui => clippy_tests/examples}/drop_forget_ref.stderr | 0 .../ui => clippy_tests/examples}/duplicate_underscore_argument.rs | 0 .../examples}/duplicate_underscore_argument.stderr | 0 {tests/ui => clippy_tests/examples}/else_if_without_else.rs | 0 {tests/ui => clippy_tests/examples}/else_if_without_else.stderr | 0 {tests/ui => clippy_tests/examples}/empty_enum.rs | 0 {tests/ui => clippy_tests/examples}/empty_enum.stderr | 0 {tests/ui => clippy_tests/examples}/entry.rs | 0 {tests/ui => clippy_tests/examples}/entry.stderr | 0 {tests/ui => clippy_tests/examples}/enum_glob_use.rs | 0 {tests/ui => clippy_tests/examples}/enum_glob_use.stderr | 0 {tests/ui => clippy_tests/examples}/enum_variants.rs | 0 {tests/ui => clippy_tests/examples}/enum_variants.stderr | 0 {tests/ui => clippy_tests/examples}/enums_clike.rs | 0 {tests/ui => clippy_tests/examples}/enums_clike.stderr | 0 {tests/ui => clippy_tests/examples}/eq_op.rs | 0 {tests/ui => clippy_tests/examples}/eq_op.stderr | 0 {tests/ui => clippy_tests/examples}/erasing_op.rs | 0 {tests/ui => clippy_tests/examples}/erasing_op.stderr | 0 {tests/ui => clippy_tests/examples}/escape_analysis.rs | 0 {tests/ui => clippy_tests/examples}/escape_analysis.stderr | 0 {tests/ui => clippy_tests/examples}/eta.rs | 0 {tests/ui => clippy_tests/examples}/eta.stderr | 0 {tests/ui => clippy_tests/examples}/eval_order_dependence.rs | 0 {tests/ui => clippy_tests/examples}/eval_order_dependence.stderr | 0 {tests/ui => clippy_tests/examples}/explicit_write.rs | 0 {tests/ui => clippy_tests/examples}/explicit_write.stderr | 0 {tests/ui => clippy_tests/examples}/fallible_impl_from.rs | 0 {tests/ui => clippy_tests/examples}/fallible_impl_from.stderr | 0 {tests/ui => clippy_tests/examples}/filter_methods.rs | 0 {tests/ui => clippy_tests/examples}/filter_methods.stderr | 0 {tests/ui => clippy_tests/examples}/float_cmp.rs | 0 {tests/ui => clippy_tests/examples}/float_cmp.stderr | 0 {tests/ui => clippy_tests/examples}/float_cmp_const.rs | 0 {tests/ui => clippy_tests/examples}/float_cmp_const.stderr | 0 {tests/ui => clippy_tests/examples}/for_loop.rs | 0 {tests/ui => clippy_tests/examples}/for_loop.stderr | 0 {tests/ui => clippy_tests/examples}/format.rs | 0 {tests/ui => clippy_tests/examples}/format.stderr | 0 {tests/ui => clippy_tests/examples}/formatting.rs | 0 {tests/ui => clippy_tests/examples}/formatting.stderr | 0 {tests/ui => clippy_tests/examples}/functions.rs | 0 {tests/ui => clippy_tests/examples}/functions.stderr | 0 {tests/ui => clippy_tests/examples}/get_unwrap.rs | 0 {tests/ui => clippy_tests/examples}/get_unwrap.stderr | 0 {tests/ui => clippy_tests/examples}/identity_conversion.rs | 0 {tests/ui => clippy_tests/examples}/identity_conversion.stderr | 0 {tests/ui => clippy_tests/examples}/identity_op.rs | 0 {tests/ui => clippy_tests/examples}/identity_op.stderr | 0 .../examples}/if_let_redundant_pattern_matching.rs | 0 .../examples}/if_let_redundant_pattern_matching.stderr | 0 {tests/ui => clippy_tests/examples}/if_not_else.rs | 0 {tests/ui => clippy_tests/examples}/if_not_else.stderr | 0 {tests/ui => clippy_tests/examples}/implicit_hasher.rs | 0 {tests/ui => clippy_tests/examples}/implicit_hasher.stderr | 0 .../ui => clippy_tests/examples}/inconsistent_digit_grouping.rs | 0 .../examples}/inconsistent_digit_grouping.stderr | 0 {tests/ui => clippy_tests/examples}/infinite_iter.rs | 0 {tests/ui => clippy_tests/examples}/infinite_iter.stderr | 0 {tests/ui => clippy_tests/examples}/inline_fn_without_body.rs | 0 {tests/ui => clippy_tests/examples}/inline_fn_without_body.stderr | 0 {tests/ui => clippy_tests/examples}/int_plus_one.rs | 0 {tests/ui => clippy_tests/examples}/int_plus_one.stderr | 0 {tests/ui => clippy_tests/examples}/invalid_ref.rs | 0 {tests/ui => clippy_tests/examples}/invalid_ref.stderr | 0 {tests/ui => clippy_tests/examples}/invalid_upcast_comparisons.rs | 0 .../examples}/invalid_upcast_comparisons.stderr | 0 {tests/ui => clippy_tests/examples}/item_after_statement.rs | 0 {tests/ui => clippy_tests/examples}/item_after_statement.stderr | 0 {tests/ui => clippy_tests/examples}/large_digit_groups.rs | 0 {tests/ui => clippy_tests/examples}/large_digit_groups.stderr | 0 {tests/ui => clippy_tests/examples}/large_enum_variant.rs | 0 {tests/ui => clippy_tests/examples}/large_enum_variant.stderr | 0 {tests/ui => clippy_tests/examples}/len_zero.rs | 0 {tests/ui => clippy_tests/examples}/len_zero.stderr | 0 {tests/ui => clippy_tests/examples}/let_if_seq.rs | 0 {tests/ui => clippy_tests/examples}/let_if_seq.stderr | 0 {tests/ui => clippy_tests/examples}/let_return.rs | 0 {tests/ui => clippy_tests/examples}/let_return.stderr | 0 {tests/ui => clippy_tests/examples}/let_unit.rs | 0 {tests/ui => clippy_tests/examples}/let_unit.stderr | 0 {tests/ui => clippy_tests/examples}/lifetimes.rs | 0 {tests/ui => clippy_tests/examples}/lifetimes.stderr | 0 {tests/ui => clippy_tests/examples}/lint_pass.rs | 0 {tests/ui => clippy_tests/examples}/lint_pass.stderr | 0 {tests/ui => clippy_tests/examples}/literals.rs | 0 {tests/ui => clippy_tests/examples}/literals.stderr | 0 {tests/ui => clippy_tests/examples}/map_clone.rs | 0 {tests/ui => clippy_tests/examples}/map_clone.stderr | 0 {tests/ui => clippy_tests/examples}/matches.rs | 0 {tests/ui => clippy_tests/examples}/matches.stderr | 0 {tests/ui => clippy_tests/examples}/mem_forget.rs | 0 {tests/ui => clippy_tests/examples}/mem_forget.stderr | 0 {tests/ui => clippy_tests/examples}/methods.rs | 0 {tests/ui => clippy_tests/examples}/methods.stderr | 0 {tests/ui => clippy_tests/examples}/min_max.rs | 0 {tests/ui => clippy_tests/examples}/min_max.stderr | 0 {tests/ui => clippy_tests/examples}/missing-doc.rs | 0 {tests/ui => clippy_tests/examples}/missing-doc.stderr | 0 {tests/ui => clippy_tests/examples}/module_inception.rs | 0 {tests/ui => clippy_tests/examples}/module_inception.stderr | 0 {tests/ui => clippy_tests/examples}/modulo_one.rs | 0 {tests/ui => clippy_tests/examples}/modulo_one.stderr | 0 {tests/ui => clippy_tests/examples}/mut_from_ref.rs | 0 {tests/ui => clippy_tests/examples}/mut_from_ref.stderr | 0 {tests/ui => clippy_tests/examples}/mut_mut.rs | 0 {tests/ui => clippy_tests/examples}/mut_mut.stderr | 0 {tests/ui => clippy_tests/examples}/mut_range_bound.rs | 0 {tests/ui => clippy_tests/examples}/mut_range_bound.stderr | 0 {tests/ui => clippy_tests/examples}/mut_reference.rs | 0 {tests/ui => clippy_tests/examples}/mut_reference.stderr | 0 {tests/ui => clippy_tests/examples}/mutex_atomic.rs | 0 {tests/ui => clippy_tests/examples}/mutex_atomic.stderr | 0 {tests/ui => clippy_tests/examples}/needless_bool.rs | 0 {tests/ui => clippy_tests/examples}/needless_bool.stderr | 0 {tests/ui => clippy_tests/examples}/needless_borrow.rs | 0 {tests/ui => clippy_tests/examples}/needless_borrow.stderr | 0 {tests/ui => clippy_tests/examples}/needless_borrowed_ref.rs | 0 {tests/ui => clippy_tests/examples}/needless_borrowed_ref.stderr | 0 {tests/ui => clippy_tests/examples}/needless_continue.rs | 0 {tests/ui => clippy_tests/examples}/needless_continue.stderr | 0 {tests/ui => clippy_tests/examples}/needless_pass_by_value.rs | 0 {tests/ui => clippy_tests/examples}/needless_pass_by_value.stderr | 0 .../examples}/needless_pass_by_value_proc_macro.rs | 0 {tests/ui => clippy_tests/examples}/needless_range_loop.rs | 0 {tests/ui => clippy_tests/examples}/needless_range_loop.stderr | 0 {tests/ui => clippy_tests/examples}/needless_return.rs | 0 {tests/ui => clippy_tests/examples}/needless_return.stderr | 0 {tests/ui => clippy_tests/examples}/needless_update.rs | 0 {tests/ui => clippy_tests/examples}/needless_update.stderr | 0 {tests/ui => clippy_tests/examples}/neg_multiply.rs | 0 {tests/ui => clippy_tests/examples}/neg_multiply.stderr | 0 {tests/ui => clippy_tests/examples}/never_loop.rs | 0 {tests/ui => clippy_tests/examples}/never_loop.stderr | 0 {tests/ui => clippy_tests/examples}/new_without_default.rs | 0 {tests/ui => clippy_tests/examples}/new_without_default.stderr | 0 {tests/ui => clippy_tests/examples}/no_effect.rs | 0 {tests/ui => clippy_tests/examples}/no_effect.stderr | 0 {tests/ui => clippy_tests/examples}/non_expressive_names.rs | 0 {tests/ui => clippy_tests/examples}/non_expressive_names.stderr | 0 {tests/ui => clippy_tests/examples}/ok_expect.rs | 0 {tests/ui => clippy_tests/examples}/ok_expect.stderr | 0 {tests/ui => clippy_tests/examples}/ok_if_let.rs | 0 {tests/ui => clippy_tests/examples}/ok_if_let.stderr | 0 {tests/ui => clippy_tests/examples}/op_ref.rs | 0 {tests/ui => clippy_tests/examples}/op_ref.stderr | 0 {tests/ui => clippy_tests/examples}/open_options.rs | 0 {tests/ui => clippy_tests/examples}/open_options.stderr | 0 {tests/ui => clippy_tests/examples}/option_option.rs | 0 {tests/ui => clippy_tests/examples}/option_option.stderr | 0 {tests/ui => clippy_tests/examples}/overflow_check_conditional.rs | 0 .../examples}/overflow_check_conditional.stderr | 0 {tests/ui => clippy_tests/examples}/panic.rs | 0 {tests/ui => clippy_tests/examples}/panic.stderr | 0 {tests/ui => clippy_tests/examples}/partialeq_ne_impl.rs | 0 {tests/ui => clippy_tests/examples}/partialeq_ne_impl.stderr | 0 {tests/ui => clippy_tests/examples}/patterns.rs | 0 {tests/ui => clippy_tests/examples}/patterns.stderr | 0 {tests/ui => clippy_tests/examples}/precedence.rs | 0 {tests/ui => clippy_tests/examples}/precedence.stderr | 0 {tests/ui => clippy_tests/examples}/print.rs | 0 {tests/ui => clippy_tests/examples}/print.stderr | 0 {tests/ui => clippy_tests/examples}/print_with_newline.rs | 0 {tests/ui => clippy_tests/examples}/print_with_newline.stderr | 0 {tests/ui => clippy_tests/examples}/println_empty_string.rs | 0 {tests/ui => clippy_tests/examples}/println_empty_string.stderr | 0 {tests/ui => clippy_tests/examples}/ptr_arg.rs | 0 {tests/ui => clippy_tests/examples}/ptr_arg.stderr | 0 {tests/ui => clippy_tests/examples}/range.rs | 0 {tests/ui => clippy_tests/examples}/range.stderr | 0 {tests/ui => clippy_tests/examples}/range_plus_minus_one.rs | 0 {tests/ui => clippy_tests/examples}/range_plus_minus_one.stderr | 0 {tests/ui => clippy_tests/examples}/redundant_closure_call.rs | 0 {tests/ui => clippy_tests/examples}/redundant_closure_call.stderr | 0 {tests/ui => clippy_tests/examples}/reference.rs | 0 {tests/ui => clippy_tests/examples}/reference.stderr | 0 {tests/ui => clippy_tests/examples}/regex.rs | 0 {tests/ui => clippy_tests/examples}/regex.stderr | 0 {tests/ui => clippy_tests/examples}/replace_consts.rs | 0 {tests/ui => clippy_tests/examples}/replace_consts.stderr | 0 {tests/ui => clippy_tests/examples}/serde.rs | 0 {tests/ui => clippy_tests/examples}/serde.stderr | 0 {tests/ui => clippy_tests/examples}/shadow.rs | 0 {tests/ui => clippy_tests/examples}/shadow.stderr | 0 {tests/ui => clippy_tests/examples}/short_circuit_statement.rs | 0 .../ui => clippy_tests/examples}/short_circuit_statement.stderr | 0 {tests/ui => clippy_tests/examples}/single_char_pattern.rs | 0 {tests/ui => clippy_tests/examples}/single_char_pattern.stderr | 0 {tests/ui => clippy_tests/examples}/starts_ends_with.rs | 0 {tests/ui => clippy_tests/examples}/starts_ends_with.stderr | 0 {tests/ui => clippy_tests/examples}/string_extend.rs | 0 {tests/ui => clippy_tests/examples}/string_extend.stderr | 0 {tests/ui => clippy_tests/examples}/strings.rs | 0 {tests/ui => clippy_tests/examples}/strings.stderr | 0 {tests/ui => clippy_tests/examples}/stutter.rs | 0 {tests/ui => clippy_tests/examples}/stutter.stderr | 0 {tests/ui => clippy_tests/examples}/swap.rs | 0 {tests/ui => clippy_tests/examples}/swap.stderr | 0 {tests/ui => clippy_tests/examples}/temporary_assignment.rs | 0 {tests/ui => clippy_tests/examples}/temporary_assignment.stderr | 0 {tests/ui => clippy_tests/examples}/toplevel_ref_arg.rs | 0 {tests/ui => clippy_tests/examples}/toplevel_ref_arg.stderr | 0 {tests/ui => clippy_tests/examples}/trailing_zeros.rs | 0 {tests/ui => clippy_tests/examples}/trailing_zeros.stderr | 0 {tests/ui => clippy_tests/examples}/trailing_zeros.stdout | 0 {tests/ui => clippy_tests/examples}/transmute.rs | 0 {tests/ui => clippy_tests/examples}/transmute.stderr | 0 {tests/ui => clippy_tests/examples}/transmute_32bit.rs | 0 {tests/ui => clippy_tests/examples}/transmute_64bit.rs | 0 {tests/ui => clippy_tests/examples}/transmute_64bit.stderr | 0 {tests/ui => clippy_tests/examples}/ty_fn_sig.rs | 0 {tests/ui => clippy_tests/examples}/types.rs | 0 {tests/ui => clippy_tests/examples}/types.stderr | 0 {tests/ui => clippy_tests/examples}/unicode.rs | 0 {tests/ui => clippy_tests/examples}/unicode.stderr | 0 {tests/ui => clippy_tests/examples}/unit_arg.rs | 0 {tests/ui => clippy_tests/examples}/unit_arg.stderr | 0 {tests/ui => clippy_tests/examples}/unit_cmp.rs | 0 {tests/ui => clippy_tests/examples}/unit_cmp.stderr | 0 {tests/ui => clippy_tests/examples}/unnecessary_clone.rs | 0 {tests/ui => clippy_tests/examples}/unnecessary_clone.stderr | 0 {tests/ui => clippy_tests/examples}/unneeded_field_pattern.rs | 0 {tests/ui => clippy_tests/examples}/unneeded_field_pattern.stderr | 0 {tests/ui => clippy_tests/examples}/unreadable_literal.rs | 0 {tests/ui => clippy_tests/examples}/unreadable_literal.stderr | 0 {tests/ui => clippy_tests/examples}/unsafe_removed_from_name.rs | 0 .../ui => clippy_tests/examples}/unsafe_removed_from_name.stderr | 0 {tests/ui => clippy_tests/examples}/unused_io_amount.rs | 0 {tests/ui => clippy_tests/examples}/unused_io_amount.stderr | 0 {tests/ui => clippy_tests/examples}/unused_labels.rs | 0 {tests/ui => clippy_tests/examples}/unused_labels.stderr | 0 {tests/ui => clippy_tests/examples}/unused_lt.rs | 0 {tests/ui => clippy_tests/examples}/unused_lt.stderr | 0 {tests/ui => clippy_tests/examples}/update-all-references.sh | 0 {tests/ui => clippy_tests/examples}/update-references.sh | 0 {tests/ui => clippy_tests/examples}/use_self.rs | 0 {tests/ui => clippy_tests/examples}/use_self.stderr | 0 {tests/ui => clippy_tests/examples}/used_underscore_binding.rs | 0 .../ui => clippy_tests/examples}/used_underscore_binding.stderr | 0 {tests/ui => clippy_tests/examples}/useless_asref.rs | 0 {tests/ui => clippy_tests/examples}/useless_asref.stderr | 0 {tests/ui => clippy_tests/examples}/useless_attribute.rs | 0 {tests/ui => clippy_tests/examples}/useless_attribute.stderr | 0 {tests/ui => clippy_tests/examples}/vec.rs | 0 {tests/ui => clippy_tests/examples}/vec.stderr | 0 {tests/ui => clippy_tests/examples}/while_loop.rs | 0 {tests/ui => clippy_tests/examples}/while_loop.stderr | 0 {tests/ui => clippy_tests/examples}/wrong_self_convention.rs | 0 {tests/ui => clippy_tests/examples}/wrong_self_convention.stderr | 0 {tests/ui => clippy_tests/examples}/zero_div_zero.rs | 0 {tests/ui => clippy_tests/examples}/zero_div_zero.stderr | 0 {tests/ui => clippy_tests/examples}/zero_ptr.rs | 0 {tests/ui => clippy_tests/examples}/zero_ptr.stderr | 0 348 files changed, 0 insertions(+), 0 deletions(-) rename {tests/ui => clippy_tests/examples}/absurd-extreme-comparisons.rs (100%) rename {tests/ui => clippy_tests/examples}/absurd-extreme-comparisons.stderr (100%) rename {tests/ui => clippy_tests/examples}/approx_const.rs (100%) rename {tests/ui => clippy_tests/examples}/approx_const.stderr (100%) rename {tests/ui => clippy_tests/examples}/arithmetic.rs (100%) rename {tests/ui => clippy_tests/examples}/arithmetic.stderr (100%) rename {tests/ui => clippy_tests/examples}/array_indexing.rs (100%) rename {tests/ui => clippy_tests/examples}/array_indexing.stderr (100%) rename {tests/ui => clippy_tests/examples}/assign_ops.rs (100%) rename {tests/ui => clippy_tests/examples}/assign_ops.stderr (100%) rename {tests/ui => clippy_tests/examples}/assign_ops2.rs (100%) rename {tests/ui => clippy_tests/examples}/assign_ops2.stderr (100%) rename {tests/ui => clippy_tests/examples}/attrs.rs (100%) rename {tests/ui => clippy_tests/examples}/attrs.stderr (100%) rename {tests/ui => clippy_tests/examples}/bit_masks.rs (100%) rename {tests/ui => clippy_tests/examples}/bit_masks.stderr (100%) rename {tests/ui => clippy_tests/examples}/blacklisted_name.rs (100%) rename {tests/ui => clippy_tests/examples}/blacklisted_name.stderr (100%) rename {tests/ui => clippy_tests/examples}/block_in_if_condition.rs (100%) rename {tests/ui => clippy_tests/examples}/block_in_if_condition.stderr (100%) rename {tests/ui => clippy_tests/examples}/bool_comparison.rs (100%) rename {tests/ui => clippy_tests/examples}/bool_comparison.stderr (100%) rename {tests/ui => clippy_tests/examples}/booleans.rs (100%) rename {tests/ui => clippy_tests/examples}/booleans.stderr (100%) rename {tests/ui => clippy_tests/examples}/borrow_box.rs (100%) rename {tests/ui => clippy_tests/examples}/borrow_box.stderr (100%) rename {tests/ui => clippy_tests/examples}/box_vec.rs (100%) rename {tests/ui => clippy_tests/examples}/box_vec.stderr (100%) rename {tests/ui => clippy_tests/examples}/builtin-type-shadow.rs (100%) rename {tests/ui => clippy_tests/examples}/builtin-type-shadow.stderr (100%) rename {tests/ui => clippy_tests/examples}/bytecount.rs (100%) rename {tests/ui => clippy_tests/examples}/bytecount.stderr (100%) rename {tests/ui => clippy_tests/examples}/cast.rs (100%) rename {tests/ui => clippy_tests/examples}/cast.stderr (100%) rename {tests/ui => clippy_tests/examples}/cast_lossless_float.rs (100%) rename {tests/ui => clippy_tests/examples}/cast_lossless_float.stderr (100%) rename {tests/ui => clippy_tests/examples}/cast_lossless_integer.rs (100%) rename {tests/ui => clippy_tests/examples}/cast_lossless_integer.stderr (100%) rename {tests/ui => clippy_tests/examples}/cast_size.rs (100%) rename {tests/ui => clippy_tests/examples}/cast_size.stderr (100%) rename {tests/ui => clippy_tests/examples}/char_lit_as_u8.rs (100%) rename {tests/ui => clippy_tests/examples}/char_lit_as_u8.stderr (100%) rename {tests/ui => clippy_tests/examples}/clone_on_copy_impl.rs (100%) rename {tests/ui => clippy_tests/examples}/clone_on_copy_mut.rs (100%) rename {tests/ui => clippy_tests/examples}/cmp_nan.rs (100%) rename {tests/ui => clippy_tests/examples}/cmp_nan.stderr (100%) rename {tests/ui => clippy_tests/examples}/cmp_null.rs (100%) rename {tests/ui => clippy_tests/examples}/cmp_null.stderr (100%) rename {tests/ui => clippy_tests/examples}/cmp_owned.rs (100%) rename {tests/ui => clippy_tests/examples}/cmp_owned.stderr (100%) rename {tests/ui => clippy_tests/examples}/collapsible_if.rs (100%) rename {tests/ui => clippy_tests/examples}/collapsible_if.stderr (100%) rename {tests/ui => clippy_tests/examples}/complex_types.rs (100%) rename {tests/ui => clippy_tests/examples}/complex_types.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_arg.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_arg.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_toml.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_toml.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_toml.toml (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_type.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_type.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_bad_type.toml (100%) rename {tests/ui => clippy_tests/examples}/conf_french_blacklisted_name.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_french_blacklisted_name.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_path_non_string.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_path_non_string.stderr (100%) rename {tests/ui => clippy_tests/examples}/conf_unknown_key.rs (100%) rename {tests/ui => clippy_tests/examples}/conf_unknown_key.stderr (100%) rename {tests/ui => clippy_tests/examples}/const_static_lifetime.rs (100%) rename {tests/ui => clippy_tests/examples}/const_static_lifetime.stderr (100%) rename {tests/ui => clippy_tests/examples}/copies.rs (100%) rename {tests/ui => clippy_tests/examples}/copies.stderr (100%) rename {tests/ui => clippy_tests/examples}/cstring.rs (100%) rename {tests/ui => clippy_tests/examples}/cstring.stderr (100%) rename {tests/ui => clippy_tests/examples}/cyclomatic_complexity.rs (100%) rename {tests/ui => clippy_tests/examples}/cyclomatic_complexity.stderr (100%) rename {tests/ui => clippy_tests/examples}/cyclomatic_complexity_attr_used.rs (100%) rename {tests/ui => clippy_tests/examples}/cyclomatic_complexity_attr_used.stderr (100%) rename {tests/ui => clippy_tests/examples}/deprecated.rs (100%) rename {tests/ui => clippy_tests/examples}/deprecated.stderr (100%) rename {tests/ui => clippy_tests/examples}/derive.rs (100%) rename {tests/ui => clippy_tests/examples}/derive.stderr (100%) rename {tests/ui => clippy_tests/examples}/diverging_sub_expression.rs (100%) rename {tests/ui => clippy_tests/examples}/diverging_sub_expression.stderr (100%) rename {tests/ui => clippy_tests/examples}/dlist.rs (100%) rename {tests/ui => clippy_tests/examples}/dlist.stderr (100%) rename {tests/ui => clippy_tests/examples}/doc.rs (100%) rename {tests/ui => clippy_tests/examples}/doc.stderr (100%) rename {tests/ui => clippy_tests/examples}/double_neg.rs (100%) rename {tests/ui => clippy_tests/examples}/double_neg.stderr (100%) rename {tests/ui => clippy_tests/examples}/double_parens.rs (100%) rename {tests/ui => clippy_tests/examples}/double_parens.stderr (100%) rename {tests/ui => clippy_tests/examples}/drop_forget_copy.rs (100%) rename {tests/ui => clippy_tests/examples}/drop_forget_copy.stderr (100%) rename {tests/ui => clippy_tests/examples}/drop_forget_ref.rs (100%) rename {tests/ui => clippy_tests/examples}/drop_forget_ref.stderr (100%) rename {tests/ui => clippy_tests/examples}/duplicate_underscore_argument.rs (100%) rename {tests/ui => clippy_tests/examples}/duplicate_underscore_argument.stderr (100%) rename {tests/ui => clippy_tests/examples}/else_if_without_else.rs (100%) rename {tests/ui => clippy_tests/examples}/else_if_without_else.stderr (100%) rename {tests/ui => clippy_tests/examples}/empty_enum.rs (100%) rename {tests/ui => clippy_tests/examples}/empty_enum.stderr (100%) rename {tests/ui => clippy_tests/examples}/entry.rs (100%) rename {tests/ui => clippy_tests/examples}/entry.stderr (100%) rename {tests/ui => clippy_tests/examples}/enum_glob_use.rs (100%) rename {tests/ui => clippy_tests/examples}/enum_glob_use.stderr (100%) rename {tests/ui => clippy_tests/examples}/enum_variants.rs (100%) rename {tests/ui => clippy_tests/examples}/enum_variants.stderr (100%) rename {tests/ui => clippy_tests/examples}/enums_clike.rs (100%) rename {tests/ui => clippy_tests/examples}/enums_clike.stderr (100%) rename {tests/ui => clippy_tests/examples}/eq_op.rs (100%) rename {tests/ui => clippy_tests/examples}/eq_op.stderr (100%) rename {tests/ui => clippy_tests/examples}/erasing_op.rs (100%) rename {tests/ui => clippy_tests/examples}/erasing_op.stderr (100%) rename {tests/ui => clippy_tests/examples}/escape_analysis.rs (100%) rename {tests/ui => clippy_tests/examples}/escape_analysis.stderr (100%) rename {tests/ui => clippy_tests/examples}/eta.rs (100%) rename {tests/ui => clippy_tests/examples}/eta.stderr (100%) rename {tests/ui => clippy_tests/examples}/eval_order_dependence.rs (100%) rename {tests/ui => clippy_tests/examples}/eval_order_dependence.stderr (100%) rename {tests/ui => clippy_tests/examples}/explicit_write.rs (100%) rename {tests/ui => clippy_tests/examples}/explicit_write.stderr (100%) rename {tests/ui => clippy_tests/examples}/fallible_impl_from.rs (100%) rename {tests/ui => clippy_tests/examples}/fallible_impl_from.stderr (100%) rename {tests/ui => clippy_tests/examples}/filter_methods.rs (100%) rename {tests/ui => clippy_tests/examples}/filter_methods.stderr (100%) rename {tests/ui => clippy_tests/examples}/float_cmp.rs (100%) rename {tests/ui => clippy_tests/examples}/float_cmp.stderr (100%) rename {tests/ui => clippy_tests/examples}/float_cmp_const.rs (100%) rename {tests/ui => clippy_tests/examples}/float_cmp_const.stderr (100%) rename {tests/ui => clippy_tests/examples}/for_loop.rs (100%) rename {tests/ui => clippy_tests/examples}/for_loop.stderr (100%) rename {tests/ui => clippy_tests/examples}/format.rs (100%) rename {tests/ui => clippy_tests/examples}/format.stderr (100%) rename {tests/ui => clippy_tests/examples}/formatting.rs (100%) rename {tests/ui => clippy_tests/examples}/formatting.stderr (100%) rename {tests/ui => clippy_tests/examples}/functions.rs (100%) rename {tests/ui => clippy_tests/examples}/functions.stderr (100%) rename {tests/ui => clippy_tests/examples}/get_unwrap.rs (100%) rename {tests/ui => clippy_tests/examples}/get_unwrap.stderr (100%) rename {tests/ui => clippy_tests/examples}/identity_conversion.rs (100%) rename {tests/ui => clippy_tests/examples}/identity_conversion.stderr (100%) rename {tests/ui => clippy_tests/examples}/identity_op.rs (100%) rename {tests/ui => clippy_tests/examples}/identity_op.stderr (100%) rename {tests/ui => clippy_tests/examples}/if_let_redundant_pattern_matching.rs (100%) rename {tests/ui => clippy_tests/examples}/if_let_redundant_pattern_matching.stderr (100%) rename {tests/ui => clippy_tests/examples}/if_not_else.rs (100%) rename {tests/ui => clippy_tests/examples}/if_not_else.stderr (100%) rename {tests/ui => clippy_tests/examples}/implicit_hasher.rs (100%) rename {tests/ui => clippy_tests/examples}/implicit_hasher.stderr (100%) rename {tests/ui => clippy_tests/examples}/inconsistent_digit_grouping.rs (100%) rename {tests/ui => clippy_tests/examples}/inconsistent_digit_grouping.stderr (100%) rename {tests/ui => clippy_tests/examples}/infinite_iter.rs (100%) rename {tests/ui => clippy_tests/examples}/infinite_iter.stderr (100%) rename {tests/ui => clippy_tests/examples}/inline_fn_without_body.rs (100%) rename {tests/ui => clippy_tests/examples}/inline_fn_without_body.stderr (100%) rename {tests/ui => clippy_tests/examples}/int_plus_one.rs (100%) rename {tests/ui => clippy_tests/examples}/int_plus_one.stderr (100%) rename {tests/ui => clippy_tests/examples}/invalid_ref.rs (100%) rename {tests/ui => clippy_tests/examples}/invalid_ref.stderr (100%) rename {tests/ui => clippy_tests/examples}/invalid_upcast_comparisons.rs (100%) rename {tests/ui => clippy_tests/examples}/invalid_upcast_comparisons.stderr (100%) rename {tests/ui => clippy_tests/examples}/item_after_statement.rs (100%) rename {tests/ui => clippy_tests/examples}/item_after_statement.stderr (100%) rename {tests/ui => clippy_tests/examples}/large_digit_groups.rs (100%) rename {tests/ui => clippy_tests/examples}/large_digit_groups.stderr (100%) rename {tests/ui => clippy_tests/examples}/large_enum_variant.rs (100%) rename {tests/ui => clippy_tests/examples}/large_enum_variant.stderr (100%) rename {tests/ui => clippy_tests/examples}/len_zero.rs (100%) rename {tests/ui => clippy_tests/examples}/len_zero.stderr (100%) rename {tests/ui => clippy_tests/examples}/let_if_seq.rs (100%) rename {tests/ui => clippy_tests/examples}/let_if_seq.stderr (100%) rename {tests/ui => clippy_tests/examples}/let_return.rs (100%) rename {tests/ui => clippy_tests/examples}/let_return.stderr (100%) rename {tests/ui => clippy_tests/examples}/let_unit.rs (100%) rename {tests/ui => clippy_tests/examples}/let_unit.stderr (100%) rename {tests/ui => clippy_tests/examples}/lifetimes.rs (100%) rename {tests/ui => clippy_tests/examples}/lifetimes.stderr (100%) rename {tests/ui => clippy_tests/examples}/lint_pass.rs (100%) rename {tests/ui => clippy_tests/examples}/lint_pass.stderr (100%) rename {tests/ui => clippy_tests/examples}/literals.rs (100%) rename {tests/ui => clippy_tests/examples}/literals.stderr (100%) rename {tests/ui => clippy_tests/examples}/map_clone.rs (100%) rename {tests/ui => clippy_tests/examples}/map_clone.stderr (100%) rename {tests/ui => clippy_tests/examples}/matches.rs (100%) rename {tests/ui => clippy_tests/examples}/matches.stderr (100%) rename {tests/ui => clippy_tests/examples}/mem_forget.rs (100%) rename {tests/ui => clippy_tests/examples}/mem_forget.stderr (100%) rename {tests/ui => clippy_tests/examples}/methods.rs (100%) rename {tests/ui => clippy_tests/examples}/methods.stderr (100%) rename {tests/ui => clippy_tests/examples}/min_max.rs (100%) rename {tests/ui => clippy_tests/examples}/min_max.stderr (100%) rename {tests/ui => clippy_tests/examples}/missing-doc.rs (100%) rename {tests/ui => clippy_tests/examples}/missing-doc.stderr (100%) rename {tests/ui => clippy_tests/examples}/module_inception.rs (100%) rename {tests/ui => clippy_tests/examples}/module_inception.stderr (100%) rename {tests/ui => clippy_tests/examples}/modulo_one.rs (100%) rename {tests/ui => clippy_tests/examples}/modulo_one.stderr (100%) rename {tests/ui => clippy_tests/examples}/mut_from_ref.rs (100%) rename {tests/ui => clippy_tests/examples}/mut_from_ref.stderr (100%) rename {tests/ui => clippy_tests/examples}/mut_mut.rs (100%) rename {tests/ui => clippy_tests/examples}/mut_mut.stderr (100%) rename {tests/ui => clippy_tests/examples}/mut_range_bound.rs (100%) rename {tests/ui => clippy_tests/examples}/mut_range_bound.stderr (100%) rename {tests/ui => clippy_tests/examples}/mut_reference.rs (100%) rename {tests/ui => clippy_tests/examples}/mut_reference.stderr (100%) rename {tests/ui => clippy_tests/examples}/mutex_atomic.rs (100%) rename {tests/ui => clippy_tests/examples}/mutex_atomic.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_bool.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_bool.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_borrow.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_borrow.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_borrowed_ref.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_borrowed_ref.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_continue.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_continue.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_pass_by_value.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_pass_by_value.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_pass_by_value_proc_macro.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_range_loop.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_range_loop.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_return.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_return.stderr (100%) rename {tests/ui => clippy_tests/examples}/needless_update.rs (100%) rename {tests/ui => clippy_tests/examples}/needless_update.stderr (100%) rename {tests/ui => clippy_tests/examples}/neg_multiply.rs (100%) rename {tests/ui => clippy_tests/examples}/neg_multiply.stderr (100%) rename {tests/ui => clippy_tests/examples}/never_loop.rs (100%) rename {tests/ui => clippy_tests/examples}/never_loop.stderr (100%) rename {tests/ui => clippy_tests/examples}/new_without_default.rs (100%) rename {tests/ui => clippy_tests/examples}/new_without_default.stderr (100%) rename {tests/ui => clippy_tests/examples}/no_effect.rs (100%) rename {tests/ui => clippy_tests/examples}/no_effect.stderr (100%) rename {tests/ui => clippy_tests/examples}/non_expressive_names.rs (100%) rename {tests/ui => clippy_tests/examples}/non_expressive_names.stderr (100%) rename {tests/ui => clippy_tests/examples}/ok_expect.rs (100%) rename {tests/ui => clippy_tests/examples}/ok_expect.stderr (100%) rename {tests/ui => clippy_tests/examples}/ok_if_let.rs (100%) rename {tests/ui => clippy_tests/examples}/ok_if_let.stderr (100%) rename {tests/ui => clippy_tests/examples}/op_ref.rs (100%) rename {tests/ui => clippy_tests/examples}/op_ref.stderr (100%) rename {tests/ui => clippy_tests/examples}/open_options.rs (100%) rename {tests/ui => clippy_tests/examples}/open_options.stderr (100%) rename {tests/ui => clippy_tests/examples}/option_option.rs (100%) rename {tests/ui => clippy_tests/examples}/option_option.stderr (100%) rename {tests/ui => clippy_tests/examples}/overflow_check_conditional.rs (100%) rename {tests/ui => clippy_tests/examples}/overflow_check_conditional.stderr (100%) rename {tests/ui => clippy_tests/examples}/panic.rs (100%) rename {tests/ui => clippy_tests/examples}/panic.stderr (100%) rename {tests/ui => clippy_tests/examples}/partialeq_ne_impl.rs (100%) rename {tests/ui => clippy_tests/examples}/partialeq_ne_impl.stderr (100%) rename {tests/ui => clippy_tests/examples}/patterns.rs (100%) rename {tests/ui => clippy_tests/examples}/patterns.stderr (100%) rename {tests/ui => clippy_tests/examples}/precedence.rs (100%) rename {tests/ui => clippy_tests/examples}/precedence.stderr (100%) rename {tests/ui => clippy_tests/examples}/print.rs (100%) rename {tests/ui => clippy_tests/examples}/print.stderr (100%) rename {tests/ui => clippy_tests/examples}/print_with_newline.rs (100%) rename {tests/ui => clippy_tests/examples}/print_with_newline.stderr (100%) rename {tests/ui => clippy_tests/examples}/println_empty_string.rs (100%) rename {tests/ui => clippy_tests/examples}/println_empty_string.stderr (100%) rename {tests/ui => clippy_tests/examples}/ptr_arg.rs (100%) rename {tests/ui => clippy_tests/examples}/ptr_arg.stderr (100%) rename {tests/ui => clippy_tests/examples}/range.rs (100%) rename {tests/ui => clippy_tests/examples}/range.stderr (100%) rename {tests/ui => clippy_tests/examples}/range_plus_minus_one.rs (100%) rename {tests/ui => clippy_tests/examples}/range_plus_minus_one.stderr (100%) rename {tests/ui => clippy_tests/examples}/redundant_closure_call.rs (100%) rename {tests/ui => clippy_tests/examples}/redundant_closure_call.stderr (100%) rename {tests/ui => clippy_tests/examples}/reference.rs (100%) rename {tests/ui => clippy_tests/examples}/reference.stderr (100%) rename {tests/ui => clippy_tests/examples}/regex.rs (100%) rename {tests/ui => clippy_tests/examples}/regex.stderr (100%) rename {tests/ui => clippy_tests/examples}/replace_consts.rs (100%) rename {tests/ui => clippy_tests/examples}/replace_consts.stderr (100%) rename {tests/ui => clippy_tests/examples}/serde.rs (100%) rename {tests/ui => clippy_tests/examples}/serde.stderr (100%) rename {tests/ui => clippy_tests/examples}/shadow.rs (100%) rename {tests/ui => clippy_tests/examples}/shadow.stderr (100%) rename {tests/ui => clippy_tests/examples}/short_circuit_statement.rs (100%) rename {tests/ui => clippy_tests/examples}/short_circuit_statement.stderr (100%) rename {tests/ui => clippy_tests/examples}/single_char_pattern.rs (100%) rename {tests/ui => clippy_tests/examples}/single_char_pattern.stderr (100%) rename {tests/ui => clippy_tests/examples}/starts_ends_with.rs (100%) rename {tests/ui => clippy_tests/examples}/starts_ends_with.stderr (100%) rename {tests/ui => clippy_tests/examples}/string_extend.rs (100%) rename {tests/ui => clippy_tests/examples}/string_extend.stderr (100%) rename {tests/ui => clippy_tests/examples}/strings.rs (100%) rename {tests/ui => clippy_tests/examples}/strings.stderr (100%) rename {tests/ui => clippy_tests/examples}/stutter.rs (100%) rename {tests/ui => clippy_tests/examples}/stutter.stderr (100%) rename {tests/ui => clippy_tests/examples}/swap.rs (100%) rename {tests/ui => clippy_tests/examples}/swap.stderr (100%) rename {tests/ui => clippy_tests/examples}/temporary_assignment.rs (100%) rename {tests/ui => clippy_tests/examples}/temporary_assignment.stderr (100%) rename {tests/ui => clippy_tests/examples}/toplevel_ref_arg.rs (100%) rename {tests/ui => clippy_tests/examples}/toplevel_ref_arg.stderr (100%) rename {tests/ui => clippy_tests/examples}/trailing_zeros.rs (100%) rename {tests/ui => clippy_tests/examples}/trailing_zeros.stderr (100%) rename {tests/ui => clippy_tests/examples}/trailing_zeros.stdout (100%) rename {tests/ui => clippy_tests/examples}/transmute.rs (100%) rename {tests/ui => clippy_tests/examples}/transmute.stderr (100%) rename {tests/ui => clippy_tests/examples}/transmute_32bit.rs (100%) rename {tests/ui => clippy_tests/examples}/transmute_64bit.rs (100%) rename {tests/ui => clippy_tests/examples}/transmute_64bit.stderr (100%) rename {tests/ui => clippy_tests/examples}/ty_fn_sig.rs (100%) rename {tests/ui => clippy_tests/examples}/types.rs (100%) rename {tests/ui => clippy_tests/examples}/types.stderr (100%) rename {tests/ui => clippy_tests/examples}/unicode.rs (100%) rename {tests/ui => clippy_tests/examples}/unicode.stderr (100%) rename {tests/ui => clippy_tests/examples}/unit_arg.rs (100%) rename {tests/ui => clippy_tests/examples}/unit_arg.stderr (100%) rename {tests/ui => clippy_tests/examples}/unit_cmp.rs (100%) rename {tests/ui => clippy_tests/examples}/unit_cmp.stderr (100%) rename {tests/ui => clippy_tests/examples}/unnecessary_clone.rs (100%) rename {tests/ui => clippy_tests/examples}/unnecessary_clone.stderr (100%) rename {tests/ui => clippy_tests/examples}/unneeded_field_pattern.rs (100%) rename {tests/ui => clippy_tests/examples}/unneeded_field_pattern.stderr (100%) rename {tests/ui => clippy_tests/examples}/unreadable_literal.rs (100%) rename {tests/ui => clippy_tests/examples}/unreadable_literal.stderr (100%) rename {tests/ui => clippy_tests/examples}/unsafe_removed_from_name.rs (100%) rename {tests/ui => clippy_tests/examples}/unsafe_removed_from_name.stderr (100%) rename {tests/ui => clippy_tests/examples}/unused_io_amount.rs (100%) rename {tests/ui => clippy_tests/examples}/unused_io_amount.stderr (100%) rename {tests/ui => clippy_tests/examples}/unused_labels.rs (100%) rename {tests/ui => clippy_tests/examples}/unused_labels.stderr (100%) rename {tests/ui => clippy_tests/examples}/unused_lt.rs (100%) rename {tests/ui => clippy_tests/examples}/unused_lt.stderr (100%) rename {tests/ui => clippy_tests/examples}/update-all-references.sh (100%) rename {tests/ui => clippy_tests/examples}/update-references.sh (100%) rename {tests/ui => clippy_tests/examples}/use_self.rs (100%) rename {tests/ui => clippy_tests/examples}/use_self.stderr (100%) rename {tests/ui => clippy_tests/examples}/used_underscore_binding.rs (100%) rename {tests/ui => clippy_tests/examples}/used_underscore_binding.stderr (100%) rename {tests/ui => clippy_tests/examples}/useless_asref.rs (100%) rename {tests/ui => clippy_tests/examples}/useless_asref.stderr (100%) rename {tests/ui => clippy_tests/examples}/useless_attribute.rs (100%) rename {tests/ui => clippy_tests/examples}/useless_attribute.stderr (100%) rename {tests/ui => clippy_tests/examples}/vec.rs (100%) rename {tests/ui => clippy_tests/examples}/vec.stderr (100%) rename {tests/ui => clippy_tests/examples}/while_loop.rs (100%) rename {tests/ui => clippy_tests/examples}/while_loop.stderr (100%) rename {tests/ui => clippy_tests/examples}/wrong_self_convention.rs (100%) rename {tests/ui => clippy_tests/examples}/wrong_self_convention.stderr (100%) rename {tests/ui => clippy_tests/examples}/zero_div_zero.rs (100%) rename {tests/ui => clippy_tests/examples}/zero_div_zero.stderr (100%) rename {tests/ui => clippy_tests/examples}/zero_ptr.rs (100%) rename {tests/ui => clippy_tests/examples}/zero_ptr.stderr (100%) diff --git a/tests/ui/absurd-extreme-comparisons.rs b/clippy_tests/examples/absurd-extreme-comparisons.rs similarity index 100% rename from tests/ui/absurd-extreme-comparisons.rs rename to clippy_tests/examples/absurd-extreme-comparisons.rs diff --git a/tests/ui/absurd-extreme-comparisons.stderr b/clippy_tests/examples/absurd-extreme-comparisons.stderr similarity index 100% rename from tests/ui/absurd-extreme-comparisons.stderr rename to clippy_tests/examples/absurd-extreme-comparisons.stderr diff --git a/tests/ui/approx_const.rs b/clippy_tests/examples/approx_const.rs similarity index 100% rename from tests/ui/approx_const.rs rename to clippy_tests/examples/approx_const.rs diff --git a/tests/ui/approx_const.stderr b/clippy_tests/examples/approx_const.stderr similarity index 100% rename from tests/ui/approx_const.stderr rename to clippy_tests/examples/approx_const.stderr diff --git a/tests/ui/arithmetic.rs b/clippy_tests/examples/arithmetic.rs similarity index 100% rename from tests/ui/arithmetic.rs rename to clippy_tests/examples/arithmetic.rs diff --git a/tests/ui/arithmetic.stderr b/clippy_tests/examples/arithmetic.stderr similarity index 100% rename from tests/ui/arithmetic.stderr rename to clippy_tests/examples/arithmetic.stderr diff --git a/tests/ui/array_indexing.rs b/clippy_tests/examples/array_indexing.rs similarity index 100% rename from tests/ui/array_indexing.rs rename to clippy_tests/examples/array_indexing.rs diff --git a/tests/ui/array_indexing.stderr b/clippy_tests/examples/array_indexing.stderr similarity index 100% rename from tests/ui/array_indexing.stderr rename to clippy_tests/examples/array_indexing.stderr diff --git a/tests/ui/assign_ops.rs b/clippy_tests/examples/assign_ops.rs similarity index 100% rename from tests/ui/assign_ops.rs rename to clippy_tests/examples/assign_ops.rs diff --git a/tests/ui/assign_ops.stderr b/clippy_tests/examples/assign_ops.stderr similarity index 100% rename from tests/ui/assign_ops.stderr rename to clippy_tests/examples/assign_ops.stderr diff --git a/tests/ui/assign_ops2.rs b/clippy_tests/examples/assign_ops2.rs similarity index 100% rename from tests/ui/assign_ops2.rs rename to clippy_tests/examples/assign_ops2.rs diff --git a/tests/ui/assign_ops2.stderr b/clippy_tests/examples/assign_ops2.stderr similarity index 100% rename from tests/ui/assign_ops2.stderr rename to clippy_tests/examples/assign_ops2.stderr diff --git a/tests/ui/attrs.rs b/clippy_tests/examples/attrs.rs similarity index 100% rename from tests/ui/attrs.rs rename to clippy_tests/examples/attrs.rs diff --git a/tests/ui/attrs.stderr b/clippy_tests/examples/attrs.stderr similarity index 100% rename from tests/ui/attrs.stderr rename to clippy_tests/examples/attrs.stderr diff --git a/tests/ui/bit_masks.rs b/clippy_tests/examples/bit_masks.rs similarity index 100% rename from tests/ui/bit_masks.rs rename to clippy_tests/examples/bit_masks.rs diff --git a/tests/ui/bit_masks.stderr b/clippy_tests/examples/bit_masks.stderr similarity index 100% rename from tests/ui/bit_masks.stderr rename to clippy_tests/examples/bit_masks.stderr diff --git a/tests/ui/blacklisted_name.rs b/clippy_tests/examples/blacklisted_name.rs similarity index 100% rename from tests/ui/blacklisted_name.rs rename to clippy_tests/examples/blacklisted_name.rs diff --git a/tests/ui/blacklisted_name.stderr b/clippy_tests/examples/blacklisted_name.stderr similarity index 100% rename from tests/ui/blacklisted_name.stderr rename to clippy_tests/examples/blacklisted_name.stderr diff --git a/tests/ui/block_in_if_condition.rs b/clippy_tests/examples/block_in_if_condition.rs similarity index 100% rename from tests/ui/block_in_if_condition.rs rename to clippy_tests/examples/block_in_if_condition.rs diff --git a/tests/ui/block_in_if_condition.stderr b/clippy_tests/examples/block_in_if_condition.stderr similarity index 100% rename from tests/ui/block_in_if_condition.stderr rename to clippy_tests/examples/block_in_if_condition.stderr diff --git a/tests/ui/bool_comparison.rs b/clippy_tests/examples/bool_comparison.rs similarity index 100% rename from tests/ui/bool_comparison.rs rename to clippy_tests/examples/bool_comparison.rs diff --git a/tests/ui/bool_comparison.stderr b/clippy_tests/examples/bool_comparison.stderr similarity index 100% rename from tests/ui/bool_comparison.stderr rename to clippy_tests/examples/bool_comparison.stderr diff --git a/tests/ui/booleans.rs b/clippy_tests/examples/booleans.rs similarity index 100% rename from tests/ui/booleans.rs rename to clippy_tests/examples/booleans.rs diff --git a/tests/ui/booleans.stderr b/clippy_tests/examples/booleans.stderr similarity index 100% rename from tests/ui/booleans.stderr rename to clippy_tests/examples/booleans.stderr diff --git a/tests/ui/borrow_box.rs b/clippy_tests/examples/borrow_box.rs similarity index 100% rename from tests/ui/borrow_box.rs rename to clippy_tests/examples/borrow_box.rs diff --git a/tests/ui/borrow_box.stderr b/clippy_tests/examples/borrow_box.stderr similarity index 100% rename from tests/ui/borrow_box.stderr rename to clippy_tests/examples/borrow_box.stderr diff --git a/tests/ui/box_vec.rs b/clippy_tests/examples/box_vec.rs similarity index 100% rename from tests/ui/box_vec.rs rename to clippy_tests/examples/box_vec.rs diff --git a/tests/ui/box_vec.stderr b/clippy_tests/examples/box_vec.stderr similarity index 100% rename from tests/ui/box_vec.stderr rename to clippy_tests/examples/box_vec.stderr diff --git a/tests/ui/builtin-type-shadow.rs b/clippy_tests/examples/builtin-type-shadow.rs similarity index 100% rename from tests/ui/builtin-type-shadow.rs rename to clippy_tests/examples/builtin-type-shadow.rs diff --git a/tests/ui/builtin-type-shadow.stderr b/clippy_tests/examples/builtin-type-shadow.stderr similarity index 100% rename from tests/ui/builtin-type-shadow.stderr rename to clippy_tests/examples/builtin-type-shadow.stderr diff --git a/tests/ui/bytecount.rs b/clippy_tests/examples/bytecount.rs similarity index 100% rename from tests/ui/bytecount.rs rename to clippy_tests/examples/bytecount.rs diff --git a/tests/ui/bytecount.stderr b/clippy_tests/examples/bytecount.stderr similarity index 100% rename from tests/ui/bytecount.stderr rename to clippy_tests/examples/bytecount.stderr diff --git a/tests/ui/cast.rs b/clippy_tests/examples/cast.rs similarity index 100% rename from tests/ui/cast.rs rename to clippy_tests/examples/cast.rs diff --git a/tests/ui/cast.stderr b/clippy_tests/examples/cast.stderr similarity index 100% rename from tests/ui/cast.stderr rename to clippy_tests/examples/cast.stderr diff --git a/tests/ui/cast_lossless_float.rs b/clippy_tests/examples/cast_lossless_float.rs similarity index 100% rename from tests/ui/cast_lossless_float.rs rename to clippy_tests/examples/cast_lossless_float.rs diff --git a/tests/ui/cast_lossless_float.stderr b/clippy_tests/examples/cast_lossless_float.stderr similarity index 100% rename from tests/ui/cast_lossless_float.stderr rename to clippy_tests/examples/cast_lossless_float.stderr diff --git a/tests/ui/cast_lossless_integer.rs b/clippy_tests/examples/cast_lossless_integer.rs similarity index 100% rename from tests/ui/cast_lossless_integer.rs rename to clippy_tests/examples/cast_lossless_integer.rs diff --git a/tests/ui/cast_lossless_integer.stderr b/clippy_tests/examples/cast_lossless_integer.stderr similarity index 100% rename from tests/ui/cast_lossless_integer.stderr rename to clippy_tests/examples/cast_lossless_integer.stderr diff --git a/tests/ui/cast_size.rs b/clippy_tests/examples/cast_size.rs similarity index 100% rename from tests/ui/cast_size.rs rename to clippy_tests/examples/cast_size.rs diff --git a/tests/ui/cast_size.stderr b/clippy_tests/examples/cast_size.stderr similarity index 100% rename from tests/ui/cast_size.stderr rename to clippy_tests/examples/cast_size.stderr diff --git a/tests/ui/char_lit_as_u8.rs b/clippy_tests/examples/char_lit_as_u8.rs similarity index 100% rename from tests/ui/char_lit_as_u8.rs rename to clippy_tests/examples/char_lit_as_u8.rs diff --git a/tests/ui/char_lit_as_u8.stderr b/clippy_tests/examples/char_lit_as_u8.stderr similarity index 100% rename from tests/ui/char_lit_as_u8.stderr rename to clippy_tests/examples/char_lit_as_u8.stderr diff --git a/tests/ui/clone_on_copy_impl.rs b/clippy_tests/examples/clone_on_copy_impl.rs similarity index 100% rename from tests/ui/clone_on_copy_impl.rs rename to clippy_tests/examples/clone_on_copy_impl.rs diff --git a/tests/ui/clone_on_copy_mut.rs b/clippy_tests/examples/clone_on_copy_mut.rs similarity index 100% rename from tests/ui/clone_on_copy_mut.rs rename to clippy_tests/examples/clone_on_copy_mut.rs diff --git a/tests/ui/cmp_nan.rs b/clippy_tests/examples/cmp_nan.rs similarity index 100% rename from tests/ui/cmp_nan.rs rename to clippy_tests/examples/cmp_nan.rs diff --git a/tests/ui/cmp_nan.stderr b/clippy_tests/examples/cmp_nan.stderr similarity index 100% rename from tests/ui/cmp_nan.stderr rename to clippy_tests/examples/cmp_nan.stderr diff --git a/tests/ui/cmp_null.rs b/clippy_tests/examples/cmp_null.rs similarity index 100% rename from tests/ui/cmp_null.rs rename to clippy_tests/examples/cmp_null.rs diff --git a/tests/ui/cmp_null.stderr b/clippy_tests/examples/cmp_null.stderr similarity index 100% rename from tests/ui/cmp_null.stderr rename to clippy_tests/examples/cmp_null.stderr diff --git a/tests/ui/cmp_owned.rs b/clippy_tests/examples/cmp_owned.rs similarity index 100% rename from tests/ui/cmp_owned.rs rename to clippy_tests/examples/cmp_owned.rs diff --git a/tests/ui/cmp_owned.stderr b/clippy_tests/examples/cmp_owned.stderr similarity index 100% rename from tests/ui/cmp_owned.stderr rename to clippy_tests/examples/cmp_owned.stderr diff --git a/tests/ui/collapsible_if.rs b/clippy_tests/examples/collapsible_if.rs similarity index 100% rename from tests/ui/collapsible_if.rs rename to clippy_tests/examples/collapsible_if.rs diff --git a/tests/ui/collapsible_if.stderr b/clippy_tests/examples/collapsible_if.stderr similarity index 100% rename from tests/ui/collapsible_if.stderr rename to clippy_tests/examples/collapsible_if.stderr diff --git a/tests/ui/complex_types.rs b/clippy_tests/examples/complex_types.rs similarity index 100% rename from tests/ui/complex_types.rs rename to clippy_tests/examples/complex_types.rs diff --git a/tests/ui/complex_types.stderr b/clippy_tests/examples/complex_types.stderr similarity index 100% rename from tests/ui/complex_types.stderr rename to clippy_tests/examples/complex_types.stderr diff --git a/tests/ui/conf_bad_arg.rs b/clippy_tests/examples/conf_bad_arg.rs similarity index 100% rename from tests/ui/conf_bad_arg.rs rename to clippy_tests/examples/conf_bad_arg.rs diff --git a/tests/ui/conf_bad_arg.stderr b/clippy_tests/examples/conf_bad_arg.stderr similarity index 100% rename from tests/ui/conf_bad_arg.stderr rename to clippy_tests/examples/conf_bad_arg.stderr diff --git a/tests/ui/conf_bad_toml.rs b/clippy_tests/examples/conf_bad_toml.rs similarity index 100% rename from tests/ui/conf_bad_toml.rs rename to clippy_tests/examples/conf_bad_toml.rs diff --git a/tests/ui/conf_bad_toml.stderr b/clippy_tests/examples/conf_bad_toml.stderr similarity index 100% rename from tests/ui/conf_bad_toml.stderr rename to clippy_tests/examples/conf_bad_toml.stderr diff --git a/tests/ui/conf_bad_toml.toml b/clippy_tests/examples/conf_bad_toml.toml similarity index 100% rename from tests/ui/conf_bad_toml.toml rename to clippy_tests/examples/conf_bad_toml.toml diff --git a/tests/ui/conf_bad_type.rs b/clippy_tests/examples/conf_bad_type.rs similarity index 100% rename from tests/ui/conf_bad_type.rs rename to clippy_tests/examples/conf_bad_type.rs diff --git a/tests/ui/conf_bad_type.stderr b/clippy_tests/examples/conf_bad_type.stderr similarity index 100% rename from tests/ui/conf_bad_type.stderr rename to clippy_tests/examples/conf_bad_type.stderr diff --git a/tests/ui/conf_bad_type.toml b/clippy_tests/examples/conf_bad_type.toml similarity index 100% rename from tests/ui/conf_bad_type.toml rename to clippy_tests/examples/conf_bad_type.toml diff --git a/tests/ui/conf_french_blacklisted_name.rs b/clippy_tests/examples/conf_french_blacklisted_name.rs similarity index 100% rename from tests/ui/conf_french_blacklisted_name.rs rename to clippy_tests/examples/conf_french_blacklisted_name.rs diff --git a/tests/ui/conf_french_blacklisted_name.stderr b/clippy_tests/examples/conf_french_blacklisted_name.stderr similarity index 100% rename from tests/ui/conf_french_blacklisted_name.stderr rename to clippy_tests/examples/conf_french_blacklisted_name.stderr diff --git a/tests/ui/conf_path_non_string.rs b/clippy_tests/examples/conf_path_non_string.rs similarity index 100% rename from tests/ui/conf_path_non_string.rs rename to clippy_tests/examples/conf_path_non_string.rs diff --git a/tests/ui/conf_path_non_string.stderr b/clippy_tests/examples/conf_path_non_string.stderr similarity index 100% rename from tests/ui/conf_path_non_string.stderr rename to clippy_tests/examples/conf_path_non_string.stderr diff --git a/tests/ui/conf_unknown_key.rs b/clippy_tests/examples/conf_unknown_key.rs similarity index 100% rename from tests/ui/conf_unknown_key.rs rename to clippy_tests/examples/conf_unknown_key.rs diff --git a/tests/ui/conf_unknown_key.stderr b/clippy_tests/examples/conf_unknown_key.stderr similarity index 100% rename from tests/ui/conf_unknown_key.stderr rename to clippy_tests/examples/conf_unknown_key.stderr diff --git a/tests/ui/const_static_lifetime.rs b/clippy_tests/examples/const_static_lifetime.rs similarity index 100% rename from tests/ui/const_static_lifetime.rs rename to clippy_tests/examples/const_static_lifetime.rs diff --git a/tests/ui/const_static_lifetime.stderr b/clippy_tests/examples/const_static_lifetime.stderr similarity index 100% rename from tests/ui/const_static_lifetime.stderr rename to clippy_tests/examples/const_static_lifetime.stderr diff --git a/tests/ui/copies.rs b/clippy_tests/examples/copies.rs similarity index 100% rename from tests/ui/copies.rs rename to clippy_tests/examples/copies.rs diff --git a/tests/ui/copies.stderr b/clippy_tests/examples/copies.stderr similarity index 100% rename from tests/ui/copies.stderr rename to clippy_tests/examples/copies.stderr diff --git a/tests/ui/cstring.rs b/clippy_tests/examples/cstring.rs similarity index 100% rename from tests/ui/cstring.rs rename to clippy_tests/examples/cstring.rs diff --git a/tests/ui/cstring.stderr b/clippy_tests/examples/cstring.stderr similarity index 100% rename from tests/ui/cstring.stderr rename to clippy_tests/examples/cstring.stderr diff --git a/tests/ui/cyclomatic_complexity.rs b/clippy_tests/examples/cyclomatic_complexity.rs similarity index 100% rename from tests/ui/cyclomatic_complexity.rs rename to clippy_tests/examples/cyclomatic_complexity.rs diff --git a/tests/ui/cyclomatic_complexity.stderr b/clippy_tests/examples/cyclomatic_complexity.stderr similarity index 100% rename from tests/ui/cyclomatic_complexity.stderr rename to clippy_tests/examples/cyclomatic_complexity.stderr diff --git a/tests/ui/cyclomatic_complexity_attr_used.rs b/clippy_tests/examples/cyclomatic_complexity_attr_used.rs similarity index 100% rename from tests/ui/cyclomatic_complexity_attr_used.rs rename to clippy_tests/examples/cyclomatic_complexity_attr_used.rs diff --git a/tests/ui/cyclomatic_complexity_attr_used.stderr b/clippy_tests/examples/cyclomatic_complexity_attr_used.stderr similarity index 100% rename from tests/ui/cyclomatic_complexity_attr_used.stderr rename to clippy_tests/examples/cyclomatic_complexity_attr_used.stderr diff --git a/tests/ui/deprecated.rs b/clippy_tests/examples/deprecated.rs similarity index 100% rename from tests/ui/deprecated.rs rename to clippy_tests/examples/deprecated.rs diff --git a/tests/ui/deprecated.stderr b/clippy_tests/examples/deprecated.stderr similarity index 100% rename from tests/ui/deprecated.stderr rename to clippy_tests/examples/deprecated.stderr diff --git a/tests/ui/derive.rs b/clippy_tests/examples/derive.rs similarity index 100% rename from tests/ui/derive.rs rename to clippy_tests/examples/derive.rs diff --git a/tests/ui/derive.stderr b/clippy_tests/examples/derive.stderr similarity index 100% rename from tests/ui/derive.stderr rename to clippy_tests/examples/derive.stderr diff --git a/tests/ui/diverging_sub_expression.rs b/clippy_tests/examples/diverging_sub_expression.rs similarity index 100% rename from tests/ui/diverging_sub_expression.rs rename to clippy_tests/examples/diverging_sub_expression.rs diff --git a/tests/ui/diverging_sub_expression.stderr b/clippy_tests/examples/diverging_sub_expression.stderr similarity index 100% rename from tests/ui/diverging_sub_expression.stderr rename to clippy_tests/examples/diverging_sub_expression.stderr diff --git a/tests/ui/dlist.rs b/clippy_tests/examples/dlist.rs similarity index 100% rename from tests/ui/dlist.rs rename to clippy_tests/examples/dlist.rs diff --git a/tests/ui/dlist.stderr b/clippy_tests/examples/dlist.stderr similarity index 100% rename from tests/ui/dlist.stderr rename to clippy_tests/examples/dlist.stderr diff --git a/tests/ui/doc.rs b/clippy_tests/examples/doc.rs similarity index 100% rename from tests/ui/doc.rs rename to clippy_tests/examples/doc.rs diff --git a/tests/ui/doc.stderr b/clippy_tests/examples/doc.stderr similarity index 100% rename from tests/ui/doc.stderr rename to clippy_tests/examples/doc.stderr diff --git a/tests/ui/double_neg.rs b/clippy_tests/examples/double_neg.rs similarity index 100% rename from tests/ui/double_neg.rs rename to clippy_tests/examples/double_neg.rs diff --git a/tests/ui/double_neg.stderr b/clippy_tests/examples/double_neg.stderr similarity index 100% rename from tests/ui/double_neg.stderr rename to clippy_tests/examples/double_neg.stderr diff --git a/tests/ui/double_parens.rs b/clippy_tests/examples/double_parens.rs similarity index 100% rename from tests/ui/double_parens.rs rename to clippy_tests/examples/double_parens.rs diff --git a/tests/ui/double_parens.stderr b/clippy_tests/examples/double_parens.stderr similarity index 100% rename from tests/ui/double_parens.stderr rename to clippy_tests/examples/double_parens.stderr diff --git a/tests/ui/drop_forget_copy.rs b/clippy_tests/examples/drop_forget_copy.rs similarity index 100% rename from tests/ui/drop_forget_copy.rs rename to clippy_tests/examples/drop_forget_copy.rs diff --git a/tests/ui/drop_forget_copy.stderr b/clippy_tests/examples/drop_forget_copy.stderr similarity index 100% rename from tests/ui/drop_forget_copy.stderr rename to clippy_tests/examples/drop_forget_copy.stderr diff --git a/tests/ui/drop_forget_ref.rs b/clippy_tests/examples/drop_forget_ref.rs similarity index 100% rename from tests/ui/drop_forget_ref.rs rename to clippy_tests/examples/drop_forget_ref.rs diff --git a/tests/ui/drop_forget_ref.stderr b/clippy_tests/examples/drop_forget_ref.stderr similarity index 100% rename from tests/ui/drop_forget_ref.stderr rename to clippy_tests/examples/drop_forget_ref.stderr diff --git a/tests/ui/duplicate_underscore_argument.rs b/clippy_tests/examples/duplicate_underscore_argument.rs similarity index 100% rename from tests/ui/duplicate_underscore_argument.rs rename to clippy_tests/examples/duplicate_underscore_argument.rs diff --git a/tests/ui/duplicate_underscore_argument.stderr b/clippy_tests/examples/duplicate_underscore_argument.stderr similarity index 100% rename from tests/ui/duplicate_underscore_argument.stderr rename to clippy_tests/examples/duplicate_underscore_argument.stderr diff --git a/tests/ui/else_if_without_else.rs b/clippy_tests/examples/else_if_without_else.rs similarity index 100% rename from tests/ui/else_if_without_else.rs rename to clippy_tests/examples/else_if_without_else.rs diff --git a/tests/ui/else_if_without_else.stderr b/clippy_tests/examples/else_if_without_else.stderr similarity index 100% rename from tests/ui/else_if_without_else.stderr rename to clippy_tests/examples/else_if_without_else.stderr diff --git a/tests/ui/empty_enum.rs b/clippy_tests/examples/empty_enum.rs similarity index 100% rename from tests/ui/empty_enum.rs rename to clippy_tests/examples/empty_enum.rs diff --git a/tests/ui/empty_enum.stderr b/clippy_tests/examples/empty_enum.stderr similarity index 100% rename from tests/ui/empty_enum.stderr rename to clippy_tests/examples/empty_enum.stderr diff --git a/tests/ui/entry.rs b/clippy_tests/examples/entry.rs similarity index 100% rename from tests/ui/entry.rs rename to clippy_tests/examples/entry.rs diff --git a/tests/ui/entry.stderr b/clippy_tests/examples/entry.stderr similarity index 100% rename from tests/ui/entry.stderr rename to clippy_tests/examples/entry.stderr diff --git a/tests/ui/enum_glob_use.rs b/clippy_tests/examples/enum_glob_use.rs similarity index 100% rename from tests/ui/enum_glob_use.rs rename to clippy_tests/examples/enum_glob_use.rs diff --git a/tests/ui/enum_glob_use.stderr b/clippy_tests/examples/enum_glob_use.stderr similarity index 100% rename from tests/ui/enum_glob_use.stderr rename to clippy_tests/examples/enum_glob_use.stderr diff --git a/tests/ui/enum_variants.rs b/clippy_tests/examples/enum_variants.rs similarity index 100% rename from tests/ui/enum_variants.rs rename to clippy_tests/examples/enum_variants.rs diff --git a/tests/ui/enum_variants.stderr b/clippy_tests/examples/enum_variants.stderr similarity index 100% rename from tests/ui/enum_variants.stderr rename to clippy_tests/examples/enum_variants.stderr diff --git a/tests/ui/enums_clike.rs b/clippy_tests/examples/enums_clike.rs similarity index 100% rename from tests/ui/enums_clike.rs rename to clippy_tests/examples/enums_clike.rs diff --git a/tests/ui/enums_clike.stderr b/clippy_tests/examples/enums_clike.stderr similarity index 100% rename from tests/ui/enums_clike.stderr rename to clippy_tests/examples/enums_clike.stderr diff --git a/tests/ui/eq_op.rs b/clippy_tests/examples/eq_op.rs similarity index 100% rename from tests/ui/eq_op.rs rename to clippy_tests/examples/eq_op.rs diff --git a/tests/ui/eq_op.stderr b/clippy_tests/examples/eq_op.stderr similarity index 100% rename from tests/ui/eq_op.stderr rename to clippy_tests/examples/eq_op.stderr diff --git a/tests/ui/erasing_op.rs b/clippy_tests/examples/erasing_op.rs similarity index 100% rename from tests/ui/erasing_op.rs rename to clippy_tests/examples/erasing_op.rs diff --git a/tests/ui/erasing_op.stderr b/clippy_tests/examples/erasing_op.stderr similarity index 100% rename from tests/ui/erasing_op.stderr rename to clippy_tests/examples/erasing_op.stderr diff --git a/tests/ui/escape_analysis.rs b/clippy_tests/examples/escape_analysis.rs similarity index 100% rename from tests/ui/escape_analysis.rs rename to clippy_tests/examples/escape_analysis.rs diff --git a/tests/ui/escape_analysis.stderr b/clippy_tests/examples/escape_analysis.stderr similarity index 100% rename from tests/ui/escape_analysis.stderr rename to clippy_tests/examples/escape_analysis.stderr diff --git a/tests/ui/eta.rs b/clippy_tests/examples/eta.rs similarity index 100% rename from tests/ui/eta.rs rename to clippy_tests/examples/eta.rs diff --git a/tests/ui/eta.stderr b/clippy_tests/examples/eta.stderr similarity index 100% rename from tests/ui/eta.stderr rename to clippy_tests/examples/eta.stderr diff --git a/tests/ui/eval_order_dependence.rs b/clippy_tests/examples/eval_order_dependence.rs similarity index 100% rename from tests/ui/eval_order_dependence.rs rename to clippy_tests/examples/eval_order_dependence.rs diff --git a/tests/ui/eval_order_dependence.stderr b/clippy_tests/examples/eval_order_dependence.stderr similarity index 100% rename from tests/ui/eval_order_dependence.stderr rename to clippy_tests/examples/eval_order_dependence.stderr diff --git a/tests/ui/explicit_write.rs b/clippy_tests/examples/explicit_write.rs similarity index 100% rename from tests/ui/explicit_write.rs rename to clippy_tests/examples/explicit_write.rs diff --git a/tests/ui/explicit_write.stderr b/clippy_tests/examples/explicit_write.stderr similarity index 100% rename from tests/ui/explicit_write.stderr rename to clippy_tests/examples/explicit_write.stderr diff --git a/tests/ui/fallible_impl_from.rs b/clippy_tests/examples/fallible_impl_from.rs similarity index 100% rename from tests/ui/fallible_impl_from.rs rename to clippy_tests/examples/fallible_impl_from.rs diff --git a/tests/ui/fallible_impl_from.stderr b/clippy_tests/examples/fallible_impl_from.stderr similarity index 100% rename from tests/ui/fallible_impl_from.stderr rename to clippy_tests/examples/fallible_impl_from.stderr diff --git a/tests/ui/filter_methods.rs b/clippy_tests/examples/filter_methods.rs similarity index 100% rename from tests/ui/filter_methods.rs rename to clippy_tests/examples/filter_methods.rs diff --git a/tests/ui/filter_methods.stderr b/clippy_tests/examples/filter_methods.stderr similarity index 100% rename from tests/ui/filter_methods.stderr rename to clippy_tests/examples/filter_methods.stderr diff --git a/tests/ui/float_cmp.rs b/clippy_tests/examples/float_cmp.rs similarity index 100% rename from tests/ui/float_cmp.rs rename to clippy_tests/examples/float_cmp.rs diff --git a/tests/ui/float_cmp.stderr b/clippy_tests/examples/float_cmp.stderr similarity index 100% rename from tests/ui/float_cmp.stderr rename to clippy_tests/examples/float_cmp.stderr diff --git a/tests/ui/float_cmp_const.rs b/clippy_tests/examples/float_cmp_const.rs similarity index 100% rename from tests/ui/float_cmp_const.rs rename to clippy_tests/examples/float_cmp_const.rs diff --git a/tests/ui/float_cmp_const.stderr b/clippy_tests/examples/float_cmp_const.stderr similarity index 100% rename from tests/ui/float_cmp_const.stderr rename to clippy_tests/examples/float_cmp_const.stderr diff --git a/tests/ui/for_loop.rs b/clippy_tests/examples/for_loop.rs similarity index 100% rename from tests/ui/for_loop.rs rename to clippy_tests/examples/for_loop.rs diff --git a/tests/ui/for_loop.stderr b/clippy_tests/examples/for_loop.stderr similarity index 100% rename from tests/ui/for_loop.stderr rename to clippy_tests/examples/for_loop.stderr diff --git a/tests/ui/format.rs b/clippy_tests/examples/format.rs similarity index 100% rename from tests/ui/format.rs rename to clippy_tests/examples/format.rs diff --git a/tests/ui/format.stderr b/clippy_tests/examples/format.stderr similarity index 100% rename from tests/ui/format.stderr rename to clippy_tests/examples/format.stderr diff --git a/tests/ui/formatting.rs b/clippy_tests/examples/formatting.rs similarity index 100% rename from tests/ui/formatting.rs rename to clippy_tests/examples/formatting.rs diff --git a/tests/ui/formatting.stderr b/clippy_tests/examples/formatting.stderr similarity index 100% rename from tests/ui/formatting.stderr rename to clippy_tests/examples/formatting.stderr diff --git a/tests/ui/functions.rs b/clippy_tests/examples/functions.rs similarity index 100% rename from tests/ui/functions.rs rename to clippy_tests/examples/functions.rs diff --git a/tests/ui/functions.stderr b/clippy_tests/examples/functions.stderr similarity index 100% rename from tests/ui/functions.stderr rename to clippy_tests/examples/functions.stderr diff --git a/tests/ui/get_unwrap.rs b/clippy_tests/examples/get_unwrap.rs similarity index 100% rename from tests/ui/get_unwrap.rs rename to clippy_tests/examples/get_unwrap.rs diff --git a/tests/ui/get_unwrap.stderr b/clippy_tests/examples/get_unwrap.stderr similarity index 100% rename from tests/ui/get_unwrap.stderr rename to clippy_tests/examples/get_unwrap.stderr diff --git a/tests/ui/identity_conversion.rs b/clippy_tests/examples/identity_conversion.rs similarity index 100% rename from tests/ui/identity_conversion.rs rename to clippy_tests/examples/identity_conversion.rs diff --git a/tests/ui/identity_conversion.stderr b/clippy_tests/examples/identity_conversion.stderr similarity index 100% rename from tests/ui/identity_conversion.stderr rename to clippy_tests/examples/identity_conversion.stderr diff --git a/tests/ui/identity_op.rs b/clippy_tests/examples/identity_op.rs similarity index 100% rename from tests/ui/identity_op.rs rename to clippy_tests/examples/identity_op.rs diff --git a/tests/ui/identity_op.stderr b/clippy_tests/examples/identity_op.stderr similarity index 100% rename from tests/ui/identity_op.stderr rename to clippy_tests/examples/identity_op.stderr diff --git a/tests/ui/if_let_redundant_pattern_matching.rs b/clippy_tests/examples/if_let_redundant_pattern_matching.rs similarity index 100% rename from tests/ui/if_let_redundant_pattern_matching.rs rename to clippy_tests/examples/if_let_redundant_pattern_matching.rs diff --git a/tests/ui/if_let_redundant_pattern_matching.stderr b/clippy_tests/examples/if_let_redundant_pattern_matching.stderr similarity index 100% rename from tests/ui/if_let_redundant_pattern_matching.stderr rename to clippy_tests/examples/if_let_redundant_pattern_matching.stderr diff --git a/tests/ui/if_not_else.rs b/clippy_tests/examples/if_not_else.rs similarity index 100% rename from tests/ui/if_not_else.rs rename to clippy_tests/examples/if_not_else.rs diff --git a/tests/ui/if_not_else.stderr b/clippy_tests/examples/if_not_else.stderr similarity index 100% rename from tests/ui/if_not_else.stderr rename to clippy_tests/examples/if_not_else.stderr diff --git a/tests/ui/implicit_hasher.rs b/clippy_tests/examples/implicit_hasher.rs similarity index 100% rename from tests/ui/implicit_hasher.rs rename to clippy_tests/examples/implicit_hasher.rs diff --git a/tests/ui/implicit_hasher.stderr b/clippy_tests/examples/implicit_hasher.stderr similarity index 100% rename from tests/ui/implicit_hasher.stderr rename to clippy_tests/examples/implicit_hasher.stderr diff --git a/tests/ui/inconsistent_digit_grouping.rs b/clippy_tests/examples/inconsistent_digit_grouping.rs similarity index 100% rename from tests/ui/inconsistent_digit_grouping.rs rename to clippy_tests/examples/inconsistent_digit_grouping.rs diff --git a/tests/ui/inconsistent_digit_grouping.stderr b/clippy_tests/examples/inconsistent_digit_grouping.stderr similarity index 100% rename from tests/ui/inconsistent_digit_grouping.stderr rename to clippy_tests/examples/inconsistent_digit_grouping.stderr diff --git a/tests/ui/infinite_iter.rs b/clippy_tests/examples/infinite_iter.rs similarity index 100% rename from tests/ui/infinite_iter.rs rename to clippy_tests/examples/infinite_iter.rs diff --git a/tests/ui/infinite_iter.stderr b/clippy_tests/examples/infinite_iter.stderr similarity index 100% rename from tests/ui/infinite_iter.stderr rename to clippy_tests/examples/infinite_iter.stderr diff --git a/tests/ui/inline_fn_without_body.rs b/clippy_tests/examples/inline_fn_without_body.rs similarity index 100% rename from tests/ui/inline_fn_without_body.rs rename to clippy_tests/examples/inline_fn_without_body.rs diff --git a/tests/ui/inline_fn_without_body.stderr b/clippy_tests/examples/inline_fn_without_body.stderr similarity index 100% rename from tests/ui/inline_fn_without_body.stderr rename to clippy_tests/examples/inline_fn_without_body.stderr diff --git a/tests/ui/int_plus_one.rs b/clippy_tests/examples/int_plus_one.rs similarity index 100% rename from tests/ui/int_plus_one.rs rename to clippy_tests/examples/int_plus_one.rs diff --git a/tests/ui/int_plus_one.stderr b/clippy_tests/examples/int_plus_one.stderr similarity index 100% rename from tests/ui/int_plus_one.stderr rename to clippy_tests/examples/int_plus_one.stderr diff --git a/tests/ui/invalid_ref.rs b/clippy_tests/examples/invalid_ref.rs similarity index 100% rename from tests/ui/invalid_ref.rs rename to clippy_tests/examples/invalid_ref.rs diff --git a/tests/ui/invalid_ref.stderr b/clippy_tests/examples/invalid_ref.stderr similarity index 100% rename from tests/ui/invalid_ref.stderr rename to clippy_tests/examples/invalid_ref.stderr diff --git a/tests/ui/invalid_upcast_comparisons.rs b/clippy_tests/examples/invalid_upcast_comparisons.rs similarity index 100% rename from tests/ui/invalid_upcast_comparisons.rs rename to clippy_tests/examples/invalid_upcast_comparisons.rs diff --git a/tests/ui/invalid_upcast_comparisons.stderr b/clippy_tests/examples/invalid_upcast_comparisons.stderr similarity index 100% rename from tests/ui/invalid_upcast_comparisons.stderr rename to clippy_tests/examples/invalid_upcast_comparisons.stderr diff --git a/tests/ui/item_after_statement.rs b/clippy_tests/examples/item_after_statement.rs similarity index 100% rename from tests/ui/item_after_statement.rs rename to clippy_tests/examples/item_after_statement.rs diff --git a/tests/ui/item_after_statement.stderr b/clippy_tests/examples/item_after_statement.stderr similarity index 100% rename from tests/ui/item_after_statement.stderr rename to clippy_tests/examples/item_after_statement.stderr diff --git a/tests/ui/large_digit_groups.rs b/clippy_tests/examples/large_digit_groups.rs similarity index 100% rename from tests/ui/large_digit_groups.rs rename to clippy_tests/examples/large_digit_groups.rs diff --git a/tests/ui/large_digit_groups.stderr b/clippy_tests/examples/large_digit_groups.stderr similarity index 100% rename from tests/ui/large_digit_groups.stderr rename to clippy_tests/examples/large_digit_groups.stderr diff --git a/tests/ui/large_enum_variant.rs b/clippy_tests/examples/large_enum_variant.rs similarity index 100% rename from tests/ui/large_enum_variant.rs rename to clippy_tests/examples/large_enum_variant.rs diff --git a/tests/ui/large_enum_variant.stderr b/clippy_tests/examples/large_enum_variant.stderr similarity index 100% rename from tests/ui/large_enum_variant.stderr rename to clippy_tests/examples/large_enum_variant.stderr diff --git a/tests/ui/len_zero.rs b/clippy_tests/examples/len_zero.rs similarity index 100% rename from tests/ui/len_zero.rs rename to clippy_tests/examples/len_zero.rs diff --git a/tests/ui/len_zero.stderr b/clippy_tests/examples/len_zero.stderr similarity index 100% rename from tests/ui/len_zero.stderr rename to clippy_tests/examples/len_zero.stderr diff --git a/tests/ui/let_if_seq.rs b/clippy_tests/examples/let_if_seq.rs similarity index 100% rename from tests/ui/let_if_seq.rs rename to clippy_tests/examples/let_if_seq.rs diff --git a/tests/ui/let_if_seq.stderr b/clippy_tests/examples/let_if_seq.stderr similarity index 100% rename from tests/ui/let_if_seq.stderr rename to clippy_tests/examples/let_if_seq.stderr diff --git a/tests/ui/let_return.rs b/clippy_tests/examples/let_return.rs similarity index 100% rename from tests/ui/let_return.rs rename to clippy_tests/examples/let_return.rs diff --git a/tests/ui/let_return.stderr b/clippy_tests/examples/let_return.stderr similarity index 100% rename from tests/ui/let_return.stderr rename to clippy_tests/examples/let_return.stderr diff --git a/tests/ui/let_unit.rs b/clippy_tests/examples/let_unit.rs similarity index 100% rename from tests/ui/let_unit.rs rename to clippy_tests/examples/let_unit.rs diff --git a/tests/ui/let_unit.stderr b/clippy_tests/examples/let_unit.stderr similarity index 100% rename from tests/ui/let_unit.stderr rename to clippy_tests/examples/let_unit.stderr diff --git a/tests/ui/lifetimes.rs b/clippy_tests/examples/lifetimes.rs similarity index 100% rename from tests/ui/lifetimes.rs rename to clippy_tests/examples/lifetimes.rs diff --git a/tests/ui/lifetimes.stderr b/clippy_tests/examples/lifetimes.stderr similarity index 100% rename from tests/ui/lifetimes.stderr rename to clippy_tests/examples/lifetimes.stderr diff --git a/tests/ui/lint_pass.rs b/clippy_tests/examples/lint_pass.rs similarity index 100% rename from tests/ui/lint_pass.rs rename to clippy_tests/examples/lint_pass.rs diff --git a/tests/ui/lint_pass.stderr b/clippy_tests/examples/lint_pass.stderr similarity index 100% rename from tests/ui/lint_pass.stderr rename to clippy_tests/examples/lint_pass.stderr diff --git a/tests/ui/literals.rs b/clippy_tests/examples/literals.rs similarity index 100% rename from tests/ui/literals.rs rename to clippy_tests/examples/literals.rs diff --git a/tests/ui/literals.stderr b/clippy_tests/examples/literals.stderr similarity index 100% rename from tests/ui/literals.stderr rename to clippy_tests/examples/literals.stderr diff --git a/tests/ui/map_clone.rs b/clippy_tests/examples/map_clone.rs similarity index 100% rename from tests/ui/map_clone.rs rename to clippy_tests/examples/map_clone.rs diff --git a/tests/ui/map_clone.stderr b/clippy_tests/examples/map_clone.stderr similarity index 100% rename from tests/ui/map_clone.stderr rename to clippy_tests/examples/map_clone.stderr diff --git a/tests/ui/matches.rs b/clippy_tests/examples/matches.rs similarity index 100% rename from tests/ui/matches.rs rename to clippy_tests/examples/matches.rs diff --git a/tests/ui/matches.stderr b/clippy_tests/examples/matches.stderr similarity index 100% rename from tests/ui/matches.stderr rename to clippy_tests/examples/matches.stderr diff --git a/tests/ui/mem_forget.rs b/clippy_tests/examples/mem_forget.rs similarity index 100% rename from tests/ui/mem_forget.rs rename to clippy_tests/examples/mem_forget.rs diff --git a/tests/ui/mem_forget.stderr b/clippy_tests/examples/mem_forget.stderr similarity index 100% rename from tests/ui/mem_forget.stderr rename to clippy_tests/examples/mem_forget.stderr diff --git a/tests/ui/methods.rs b/clippy_tests/examples/methods.rs similarity index 100% rename from tests/ui/methods.rs rename to clippy_tests/examples/methods.rs diff --git a/tests/ui/methods.stderr b/clippy_tests/examples/methods.stderr similarity index 100% rename from tests/ui/methods.stderr rename to clippy_tests/examples/methods.stderr diff --git a/tests/ui/min_max.rs b/clippy_tests/examples/min_max.rs similarity index 100% rename from tests/ui/min_max.rs rename to clippy_tests/examples/min_max.rs diff --git a/tests/ui/min_max.stderr b/clippy_tests/examples/min_max.stderr similarity index 100% rename from tests/ui/min_max.stderr rename to clippy_tests/examples/min_max.stderr diff --git a/tests/ui/missing-doc.rs b/clippy_tests/examples/missing-doc.rs similarity index 100% rename from tests/ui/missing-doc.rs rename to clippy_tests/examples/missing-doc.rs diff --git a/tests/ui/missing-doc.stderr b/clippy_tests/examples/missing-doc.stderr similarity index 100% rename from tests/ui/missing-doc.stderr rename to clippy_tests/examples/missing-doc.stderr diff --git a/tests/ui/module_inception.rs b/clippy_tests/examples/module_inception.rs similarity index 100% rename from tests/ui/module_inception.rs rename to clippy_tests/examples/module_inception.rs diff --git a/tests/ui/module_inception.stderr b/clippy_tests/examples/module_inception.stderr similarity index 100% rename from tests/ui/module_inception.stderr rename to clippy_tests/examples/module_inception.stderr diff --git a/tests/ui/modulo_one.rs b/clippy_tests/examples/modulo_one.rs similarity index 100% rename from tests/ui/modulo_one.rs rename to clippy_tests/examples/modulo_one.rs diff --git a/tests/ui/modulo_one.stderr b/clippy_tests/examples/modulo_one.stderr similarity index 100% rename from tests/ui/modulo_one.stderr rename to clippy_tests/examples/modulo_one.stderr diff --git a/tests/ui/mut_from_ref.rs b/clippy_tests/examples/mut_from_ref.rs similarity index 100% rename from tests/ui/mut_from_ref.rs rename to clippy_tests/examples/mut_from_ref.rs diff --git a/tests/ui/mut_from_ref.stderr b/clippy_tests/examples/mut_from_ref.stderr similarity index 100% rename from tests/ui/mut_from_ref.stderr rename to clippy_tests/examples/mut_from_ref.stderr diff --git a/tests/ui/mut_mut.rs b/clippy_tests/examples/mut_mut.rs similarity index 100% rename from tests/ui/mut_mut.rs rename to clippy_tests/examples/mut_mut.rs diff --git a/tests/ui/mut_mut.stderr b/clippy_tests/examples/mut_mut.stderr similarity index 100% rename from tests/ui/mut_mut.stderr rename to clippy_tests/examples/mut_mut.stderr diff --git a/tests/ui/mut_range_bound.rs b/clippy_tests/examples/mut_range_bound.rs similarity index 100% rename from tests/ui/mut_range_bound.rs rename to clippy_tests/examples/mut_range_bound.rs diff --git a/tests/ui/mut_range_bound.stderr b/clippy_tests/examples/mut_range_bound.stderr similarity index 100% rename from tests/ui/mut_range_bound.stderr rename to clippy_tests/examples/mut_range_bound.stderr diff --git a/tests/ui/mut_reference.rs b/clippy_tests/examples/mut_reference.rs similarity index 100% rename from tests/ui/mut_reference.rs rename to clippy_tests/examples/mut_reference.rs diff --git a/tests/ui/mut_reference.stderr b/clippy_tests/examples/mut_reference.stderr similarity index 100% rename from tests/ui/mut_reference.stderr rename to clippy_tests/examples/mut_reference.stderr diff --git a/tests/ui/mutex_atomic.rs b/clippy_tests/examples/mutex_atomic.rs similarity index 100% rename from tests/ui/mutex_atomic.rs rename to clippy_tests/examples/mutex_atomic.rs diff --git a/tests/ui/mutex_atomic.stderr b/clippy_tests/examples/mutex_atomic.stderr similarity index 100% rename from tests/ui/mutex_atomic.stderr rename to clippy_tests/examples/mutex_atomic.stderr diff --git a/tests/ui/needless_bool.rs b/clippy_tests/examples/needless_bool.rs similarity index 100% rename from tests/ui/needless_bool.rs rename to clippy_tests/examples/needless_bool.rs diff --git a/tests/ui/needless_bool.stderr b/clippy_tests/examples/needless_bool.stderr similarity index 100% rename from tests/ui/needless_bool.stderr rename to clippy_tests/examples/needless_bool.stderr diff --git a/tests/ui/needless_borrow.rs b/clippy_tests/examples/needless_borrow.rs similarity index 100% rename from tests/ui/needless_borrow.rs rename to clippy_tests/examples/needless_borrow.rs diff --git a/tests/ui/needless_borrow.stderr b/clippy_tests/examples/needless_borrow.stderr similarity index 100% rename from tests/ui/needless_borrow.stderr rename to clippy_tests/examples/needless_borrow.stderr diff --git a/tests/ui/needless_borrowed_ref.rs b/clippy_tests/examples/needless_borrowed_ref.rs similarity index 100% rename from tests/ui/needless_borrowed_ref.rs rename to clippy_tests/examples/needless_borrowed_ref.rs diff --git a/tests/ui/needless_borrowed_ref.stderr b/clippy_tests/examples/needless_borrowed_ref.stderr similarity index 100% rename from tests/ui/needless_borrowed_ref.stderr rename to clippy_tests/examples/needless_borrowed_ref.stderr diff --git a/tests/ui/needless_continue.rs b/clippy_tests/examples/needless_continue.rs similarity index 100% rename from tests/ui/needless_continue.rs rename to clippy_tests/examples/needless_continue.rs diff --git a/tests/ui/needless_continue.stderr b/clippy_tests/examples/needless_continue.stderr similarity index 100% rename from tests/ui/needless_continue.stderr rename to clippy_tests/examples/needless_continue.stderr diff --git a/tests/ui/needless_pass_by_value.rs b/clippy_tests/examples/needless_pass_by_value.rs similarity index 100% rename from tests/ui/needless_pass_by_value.rs rename to clippy_tests/examples/needless_pass_by_value.rs diff --git a/tests/ui/needless_pass_by_value.stderr b/clippy_tests/examples/needless_pass_by_value.stderr similarity index 100% rename from tests/ui/needless_pass_by_value.stderr rename to clippy_tests/examples/needless_pass_by_value.stderr diff --git a/tests/ui/needless_pass_by_value_proc_macro.rs b/clippy_tests/examples/needless_pass_by_value_proc_macro.rs similarity index 100% rename from tests/ui/needless_pass_by_value_proc_macro.rs rename to clippy_tests/examples/needless_pass_by_value_proc_macro.rs diff --git a/tests/ui/needless_range_loop.rs b/clippy_tests/examples/needless_range_loop.rs similarity index 100% rename from tests/ui/needless_range_loop.rs rename to clippy_tests/examples/needless_range_loop.rs diff --git a/tests/ui/needless_range_loop.stderr b/clippy_tests/examples/needless_range_loop.stderr similarity index 100% rename from tests/ui/needless_range_loop.stderr rename to clippy_tests/examples/needless_range_loop.stderr diff --git a/tests/ui/needless_return.rs b/clippy_tests/examples/needless_return.rs similarity index 100% rename from tests/ui/needless_return.rs rename to clippy_tests/examples/needless_return.rs diff --git a/tests/ui/needless_return.stderr b/clippy_tests/examples/needless_return.stderr similarity index 100% rename from tests/ui/needless_return.stderr rename to clippy_tests/examples/needless_return.stderr diff --git a/tests/ui/needless_update.rs b/clippy_tests/examples/needless_update.rs similarity index 100% rename from tests/ui/needless_update.rs rename to clippy_tests/examples/needless_update.rs diff --git a/tests/ui/needless_update.stderr b/clippy_tests/examples/needless_update.stderr similarity index 100% rename from tests/ui/needless_update.stderr rename to clippy_tests/examples/needless_update.stderr diff --git a/tests/ui/neg_multiply.rs b/clippy_tests/examples/neg_multiply.rs similarity index 100% rename from tests/ui/neg_multiply.rs rename to clippy_tests/examples/neg_multiply.rs diff --git a/tests/ui/neg_multiply.stderr b/clippy_tests/examples/neg_multiply.stderr similarity index 100% rename from tests/ui/neg_multiply.stderr rename to clippy_tests/examples/neg_multiply.stderr diff --git a/tests/ui/never_loop.rs b/clippy_tests/examples/never_loop.rs similarity index 100% rename from tests/ui/never_loop.rs rename to clippy_tests/examples/never_loop.rs diff --git a/tests/ui/never_loop.stderr b/clippy_tests/examples/never_loop.stderr similarity index 100% rename from tests/ui/never_loop.stderr rename to clippy_tests/examples/never_loop.stderr diff --git a/tests/ui/new_without_default.rs b/clippy_tests/examples/new_without_default.rs similarity index 100% rename from tests/ui/new_without_default.rs rename to clippy_tests/examples/new_without_default.rs diff --git a/tests/ui/new_without_default.stderr b/clippy_tests/examples/new_without_default.stderr similarity index 100% rename from tests/ui/new_without_default.stderr rename to clippy_tests/examples/new_without_default.stderr diff --git a/tests/ui/no_effect.rs b/clippy_tests/examples/no_effect.rs similarity index 100% rename from tests/ui/no_effect.rs rename to clippy_tests/examples/no_effect.rs diff --git a/tests/ui/no_effect.stderr b/clippy_tests/examples/no_effect.stderr similarity index 100% rename from tests/ui/no_effect.stderr rename to clippy_tests/examples/no_effect.stderr diff --git a/tests/ui/non_expressive_names.rs b/clippy_tests/examples/non_expressive_names.rs similarity index 100% rename from tests/ui/non_expressive_names.rs rename to clippy_tests/examples/non_expressive_names.rs diff --git a/tests/ui/non_expressive_names.stderr b/clippy_tests/examples/non_expressive_names.stderr similarity index 100% rename from tests/ui/non_expressive_names.stderr rename to clippy_tests/examples/non_expressive_names.stderr diff --git a/tests/ui/ok_expect.rs b/clippy_tests/examples/ok_expect.rs similarity index 100% rename from tests/ui/ok_expect.rs rename to clippy_tests/examples/ok_expect.rs diff --git a/tests/ui/ok_expect.stderr b/clippy_tests/examples/ok_expect.stderr similarity index 100% rename from tests/ui/ok_expect.stderr rename to clippy_tests/examples/ok_expect.stderr diff --git a/tests/ui/ok_if_let.rs b/clippy_tests/examples/ok_if_let.rs similarity index 100% rename from tests/ui/ok_if_let.rs rename to clippy_tests/examples/ok_if_let.rs diff --git a/tests/ui/ok_if_let.stderr b/clippy_tests/examples/ok_if_let.stderr similarity index 100% rename from tests/ui/ok_if_let.stderr rename to clippy_tests/examples/ok_if_let.stderr diff --git a/tests/ui/op_ref.rs b/clippy_tests/examples/op_ref.rs similarity index 100% rename from tests/ui/op_ref.rs rename to clippy_tests/examples/op_ref.rs diff --git a/tests/ui/op_ref.stderr b/clippy_tests/examples/op_ref.stderr similarity index 100% rename from tests/ui/op_ref.stderr rename to clippy_tests/examples/op_ref.stderr diff --git a/tests/ui/open_options.rs b/clippy_tests/examples/open_options.rs similarity index 100% rename from tests/ui/open_options.rs rename to clippy_tests/examples/open_options.rs diff --git a/tests/ui/open_options.stderr b/clippy_tests/examples/open_options.stderr similarity index 100% rename from tests/ui/open_options.stderr rename to clippy_tests/examples/open_options.stderr diff --git a/tests/ui/option_option.rs b/clippy_tests/examples/option_option.rs similarity index 100% rename from tests/ui/option_option.rs rename to clippy_tests/examples/option_option.rs diff --git a/tests/ui/option_option.stderr b/clippy_tests/examples/option_option.stderr similarity index 100% rename from tests/ui/option_option.stderr rename to clippy_tests/examples/option_option.stderr diff --git a/tests/ui/overflow_check_conditional.rs b/clippy_tests/examples/overflow_check_conditional.rs similarity index 100% rename from tests/ui/overflow_check_conditional.rs rename to clippy_tests/examples/overflow_check_conditional.rs diff --git a/tests/ui/overflow_check_conditional.stderr b/clippy_tests/examples/overflow_check_conditional.stderr similarity index 100% rename from tests/ui/overflow_check_conditional.stderr rename to clippy_tests/examples/overflow_check_conditional.stderr diff --git a/tests/ui/panic.rs b/clippy_tests/examples/panic.rs similarity index 100% rename from tests/ui/panic.rs rename to clippy_tests/examples/panic.rs diff --git a/tests/ui/panic.stderr b/clippy_tests/examples/panic.stderr similarity index 100% rename from tests/ui/panic.stderr rename to clippy_tests/examples/panic.stderr diff --git a/tests/ui/partialeq_ne_impl.rs b/clippy_tests/examples/partialeq_ne_impl.rs similarity index 100% rename from tests/ui/partialeq_ne_impl.rs rename to clippy_tests/examples/partialeq_ne_impl.rs diff --git a/tests/ui/partialeq_ne_impl.stderr b/clippy_tests/examples/partialeq_ne_impl.stderr similarity index 100% rename from tests/ui/partialeq_ne_impl.stderr rename to clippy_tests/examples/partialeq_ne_impl.stderr diff --git a/tests/ui/patterns.rs b/clippy_tests/examples/patterns.rs similarity index 100% rename from tests/ui/patterns.rs rename to clippy_tests/examples/patterns.rs diff --git a/tests/ui/patterns.stderr b/clippy_tests/examples/patterns.stderr similarity index 100% rename from tests/ui/patterns.stderr rename to clippy_tests/examples/patterns.stderr diff --git a/tests/ui/precedence.rs b/clippy_tests/examples/precedence.rs similarity index 100% rename from tests/ui/precedence.rs rename to clippy_tests/examples/precedence.rs diff --git a/tests/ui/precedence.stderr b/clippy_tests/examples/precedence.stderr similarity index 100% rename from tests/ui/precedence.stderr rename to clippy_tests/examples/precedence.stderr diff --git a/tests/ui/print.rs b/clippy_tests/examples/print.rs similarity index 100% rename from tests/ui/print.rs rename to clippy_tests/examples/print.rs diff --git a/tests/ui/print.stderr b/clippy_tests/examples/print.stderr similarity index 100% rename from tests/ui/print.stderr rename to clippy_tests/examples/print.stderr diff --git a/tests/ui/print_with_newline.rs b/clippy_tests/examples/print_with_newline.rs similarity index 100% rename from tests/ui/print_with_newline.rs rename to clippy_tests/examples/print_with_newline.rs diff --git a/tests/ui/print_with_newline.stderr b/clippy_tests/examples/print_with_newline.stderr similarity index 100% rename from tests/ui/print_with_newline.stderr rename to clippy_tests/examples/print_with_newline.stderr diff --git a/tests/ui/println_empty_string.rs b/clippy_tests/examples/println_empty_string.rs similarity index 100% rename from tests/ui/println_empty_string.rs rename to clippy_tests/examples/println_empty_string.rs diff --git a/tests/ui/println_empty_string.stderr b/clippy_tests/examples/println_empty_string.stderr similarity index 100% rename from tests/ui/println_empty_string.stderr rename to clippy_tests/examples/println_empty_string.stderr diff --git a/tests/ui/ptr_arg.rs b/clippy_tests/examples/ptr_arg.rs similarity index 100% rename from tests/ui/ptr_arg.rs rename to clippy_tests/examples/ptr_arg.rs diff --git a/tests/ui/ptr_arg.stderr b/clippy_tests/examples/ptr_arg.stderr similarity index 100% rename from tests/ui/ptr_arg.stderr rename to clippy_tests/examples/ptr_arg.stderr diff --git a/tests/ui/range.rs b/clippy_tests/examples/range.rs similarity index 100% rename from tests/ui/range.rs rename to clippy_tests/examples/range.rs diff --git a/tests/ui/range.stderr b/clippy_tests/examples/range.stderr similarity index 100% rename from tests/ui/range.stderr rename to clippy_tests/examples/range.stderr diff --git a/tests/ui/range_plus_minus_one.rs b/clippy_tests/examples/range_plus_minus_one.rs similarity index 100% rename from tests/ui/range_plus_minus_one.rs rename to clippy_tests/examples/range_plus_minus_one.rs diff --git a/tests/ui/range_plus_minus_one.stderr b/clippy_tests/examples/range_plus_minus_one.stderr similarity index 100% rename from tests/ui/range_plus_minus_one.stderr rename to clippy_tests/examples/range_plus_minus_one.stderr diff --git a/tests/ui/redundant_closure_call.rs b/clippy_tests/examples/redundant_closure_call.rs similarity index 100% rename from tests/ui/redundant_closure_call.rs rename to clippy_tests/examples/redundant_closure_call.rs diff --git a/tests/ui/redundant_closure_call.stderr b/clippy_tests/examples/redundant_closure_call.stderr similarity index 100% rename from tests/ui/redundant_closure_call.stderr rename to clippy_tests/examples/redundant_closure_call.stderr diff --git a/tests/ui/reference.rs b/clippy_tests/examples/reference.rs similarity index 100% rename from tests/ui/reference.rs rename to clippy_tests/examples/reference.rs diff --git a/tests/ui/reference.stderr b/clippy_tests/examples/reference.stderr similarity index 100% rename from tests/ui/reference.stderr rename to clippy_tests/examples/reference.stderr diff --git a/tests/ui/regex.rs b/clippy_tests/examples/regex.rs similarity index 100% rename from tests/ui/regex.rs rename to clippy_tests/examples/regex.rs diff --git a/tests/ui/regex.stderr b/clippy_tests/examples/regex.stderr similarity index 100% rename from tests/ui/regex.stderr rename to clippy_tests/examples/regex.stderr diff --git a/tests/ui/replace_consts.rs b/clippy_tests/examples/replace_consts.rs similarity index 100% rename from tests/ui/replace_consts.rs rename to clippy_tests/examples/replace_consts.rs diff --git a/tests/ui/replace_consts.stderr b/clippy_tests/examples/replace_consts.stderr similarity index 100% rename from tests/ui/replace_consts.stderr rename to clippy_tests/examples/replace_consts.stderr diff --git a/tests/ui/serde.rs b/clippy_tests/examples/serde.rs similarity index 100% rename from tests/ui/serde.rs rename to clippy_tests/examples/serde.rs diff --git a/tests/ui/serde.stderr b/clippy_tests/examples/serde.stderr similarity index 100% rename from tests/ui/serde.stderr rename to clippy_tests/examples/serde.stderr diff --git a/tests/ui/shadow.rs b/clippy_tests/examples/shadow.rs similarity index 100% rename from tests/ui/shadow.rs rename to clippy_tests/examples/shadow.rs diff --git a/tests/ui/shadow.stderr b/clippy_tests/examples/shadow.stderr similarity index 100% rename from tests/ui/shadow.stderr rename to clippy_tests/examples/shadow.stderr diff --git a/tests/ui/short_circuit_statement.rs b/clippy_tests/examples/short_circuit_statement.rs similarity index 100% rename from tests/ui/short_circuit_statement.rs rename to clippy_tests/examples/short_circuit_statement.rs diff --git a/tests/ui/short_circuit_statement.stderr b/clippy_tests/examples/short_circuit_statement.stderr similarity index 100% rename from tests/ui/short_circuit_statement.stderr rename to clippy_tests/examples/short_circuit_statement.stderr diff --git a/tests/ui/single_char_pattern.rs b/clippy_tests/examples/single_char_pattern.rs similarity index 100% rename from tests/ui/single_char_pattern.rs rename to clippy_tests/examples/single_char_pattern.rs diff --git a/tests/ui/single_char_pattern.stderr b/clippy_tests/examples/single_char_pattern.stderr similarity index 100% rename from tests/ui/single_char_pattern.stderr rename to clippy_tests/examples/single_char_pattern.stderr diff --git a/tests/ui/starts_ends_with.rs b/clippy_tests/examples/starts_ends_with.rs similarity index 100% rename from tests/ui/starts_ends_with.rs rename to clippy_tests/examples/starts_ends_with.rs diff --git a/tests/ui/starts_ends_with.stderr b/clippy_tests/examples/starts_ends_with.stderr similarity index 100% rename from tests/ui/starts_ends_with.stderr rename to clippy_tests/examples/starts_ends_with.stderr diff --git a/tests/ui/string_extend.rs b/clippy_tests/examples/string_extend.rs similarity index 100% rename from tests/ui/string_extend.rs rename to clippy_tests/examples/string_extend.rs diff --git a/tests/ui/string_extend.stderr b/clippy_tests/examples/string_extend.stderr similarity index 100% rename from tests/ui/string_extend.stderr rename to clippy_tests/examples/string_extend.stderr diff --git a/tests/ui/strings.rs b/clippy_tests/examples/strings.rs similarity index 100% rename from tests/ui/strings.rs rename to clippy_tests/examples/strings.rs diff --git a/tests/ui/strings.stderr b/clippy_tests/examples/strings.stderr similarity index 100% rename from tests/ui/strings.stderr rename to clippy_tests/examples/strings.stderr diff --git a/tests/ui/stutter.rs b/clippy_tests/examples/stutter.rs similarity index 100% rename from tests/ui/stutter.rs rename to clippy_tests/examples/stutter.rs diff --git a/tests/ui/stutter.stderr b/clippy_tests/examples/stutter.stderr similarity index 100% rename from tests/ui/stutter.stderr rename to clippy_tests/examples/stutter.stderr diff --git a/tests/ui/swap.rs b/clippy_tests/examples/swap.rs similarity index 100% rename from tests/ui/swap.rs rename to clippy_tests/examples/swap.rs diff --git a/tests/ui/swap.stderr b/clippy_tests/examples/swap.stderr similarity index 100% rename from tests/ui/swap.stderr rename to clippy_tests/examples/swap.stderr diff --git a/tests/ui/temporary_assignment.rs b/clippy_tests/examples/temporary_assignment.rs similarity index 100% rename from tests/ui/temporary_assignment.rs rename to clippy_tests/examples/temporary_assignment.rs diff --git a/tests/ui/temporary_assignment.stderr b/clippy_tests/examples/temporary_assignment.stderr similarity index 100% rename from tests/ui/temporary_assignment.stderr rename to clippy_tests/examples/temporary_assignment.stderr diff --git a/tests/ui/toplevel_ref_arg.rs b/clippy_tests/examples/toplevel_ref_arg.rs similarity index 100% rename from tests/ui/toplevel_ref_arg.rs rename to clippy_tests/examples/toplevel_ref_arg.rs diff --git a/tests/ui/toplevel_ref_arg.stderr b/clippy_tests/examples/toplevel_ref_arg.stderr similarity index 100% rename from tests/ui/toplevel_ref_arg.stderr rename to clippy_tests/examples/toplevel_ref_arg.stderr diff --git a/tests/ui/trailing_zeros.rs b/clippy_tests/examples/trailing_zeros.rs similarity index 100% rename from tests/ui/trailing_zeros.rs rename to clippy_tests/examples/trailing_zeros.rs diff --git a/tests/ui/trailing_zeros.stderr b/clippy_tests/examples/trailing_zeros.stderr similarity index 100% rename from tests/ui/trailing_zeros.stderr rename to clippy_tests/examples/trailing_zeros.stderr diff --git a/tests/ui/trailing_zeros.stdout b/clippy_tests/examples/trailing_zeros.stdout similarity index 100% rename from tests/ui/trailing_zeros.stdout rename to clippy_tests/examples/trailing_zeros.stdout diff --git a/tests/ui/transmute.rs b/clippy_tests/examples/transmute.rs similarity index 100% rename from tests/ui/transmute.rs rename to clippy_tests/examples/transmute.rs diff --git a/tests/ui/transmute.stderr b/clippy_tests/examples/transmute.stderr similarity index 100% rename from tests/ui/transmute.stderr rename to clippy_tests/examples/transmute.stderr diff --git a/tests/ui/transmute_32bit.rs b/clippy_tests/examples/transmute_32bit.rs similarity index 100% rename from tests/ui/transmute_32bit.rs rename to clippy_tests/examples/transmute_32bit.rs diff --git a/tests/ui/transmute_64bit.rs b/clippy_tests/examples/transmute_64bit.rs similarity index 100% rename from tests/ui/transmute_64bit.rs rename to clippy_tests/examples/transmute_64bit.rs diff --git a/tests/ui/transmute_64bit.stderr b/clippy_tests/examples/transmute_64bit.stderr similarity index 100% rename from tests/ui/transmute_64bit.stderr rename to clippy_tests/examples/transmute_64bit.stderr diff --git a/tests/ui/ty_fn_sig.rs b/clippy_tests/examples/ty_fn_sig.rs similarity index 100% rename from tests/ui/ty_fn_sig.rs rename to clippy_tests/examples/ty_fn_sig.rs diff --git a/tests/ui/types.rs b/clippy_tests/examples/types.rs similarity index 100% rename from tests/ui/types.rs rename to clippy_tests/examples/types.rs diff --git a/tests/ui/types.stderr b/clippy_tests/examples/types.stderr similarity index 100% rename from tests/ui/types.stderr rename to clippy_tests/examples/types.stderr diff --git a/tests/ui/unicode.rs b/clippy_tests/examples/unicode.rs similarity index 100% rename from tests/ui/unicode.rs rename to clippy_tests/examples/unicode.rs diff --git a/tests/ui/unicode.stderr b/clippy_tests/examples/unicode.stderr similarity index 100% rename from tests/ui/unicode.stderr rename to clippy_tests/examples/unicode.stderr diff --git a/tests/ui/unit_arg.rs b/clippy_tests/examples/unit_arg.rs similarity index 100% rename from tests/ui/unit_arg.rs rename to clippy_tests/examples/unit_arg.rs diff --git a/tests/ui/unit_arg.stderr b/clippy_tests/examples/unit_arg.stderr similarity index 100% rename from tests/ui/unit_arg.stderr rename to clippy_tests/examples/unit_arg.stderr diff --git a/tests/ui/unit_cmp.rs b/clippy_tests/examples/unit_cmp.rs similarity index 100% rename from tests/ui/unit_cmp.rs rename to clippy_tests/examples/unit_cmp.rs diff --git a/tests/ui/unit_cmp.stderr b/clippy_tests/examples/unit_cmp.stderr similarity index 100% rename from tests/ui/unit_cmp.stderr rename to clippy_tests/examples/unit_cmp.stderr diff --git a/tests/ui/unnecessary_clone.rs b/clippy_tests/examples/unnecessary_clone.rs similarity index 100% rename from tests/ui/unnecessary_clone.rs rename to clippy_tests/examples/unnecessary_clone.rs diff --git a/tests/ui/unnecessary_clone.stderr b/clippy_tests/examples/unnecessary_clone.stderr similarity index 100% rename from tests/ui/unnecessary_clone.stderr rename to clippy_tests/examples/unnecessary_clone.stderr diff --git a/tests/ui/unneeded_field_pattern.rs b/clippy_tests/examples/unneeded_field_pattern.rs similarity index 100% rename from tests/ui/unneeded_field_pattern.rs rename to clippy_tests/examples/unneeded_field_pattern.rs diff --git a/tests/ui/unneeded_field_pattern.stderr b/clippy_tests/examples/unneeded_field_pattern.stderr similarity index 100% rename from tests/ui/unneeded_field_pattern.stderr rename to clippy_tests/examples/unneeded_field_pattern.stderr diff --git a/tests/ui/unreadable_literal.rs b/clippy_tests/examples/unreadable_literal.rs similarity index 100% rename from tests/ui/unreadable_literal.rs rename to clippy_tests/examples/unreadable_literal.rs diff --git a/tests/ui/unreadable_literal.stderr b/clippy_tests/examples/unreadable_literal.stderr similarity index 100% rename from tests/ui/unreadable_literal.stderr rename to clippy_tests/examples/unreadable_literal.stderr diff --git a/tests/ui/unsafe_removed_from_name.rs b/clippy_tests/examples/unsafe_removed_from_name.rs similarity index 100% rename from tests/ui/unsafe_removed_from_name.rs rename to clippy_tests/examples/unsafe_removed_from_name.rs diff --git a/tests/ui/unsafe_removed_from_name.stderr b/clippy_tests/examples/unsafe_removed_from_name.stderr similarity index 100% rename from tests/ui/unsafe_removed_from_name.stderr rename to clippy_tests/examples/unsafe_removed_from_name.stderr diff --git a/tests/ui/unused_io_amount.rs b/clippy_tests/examples/unused_io_amount.rs similarity index 100% rename from tests/ui/unused_io_amount.rs rename to clippy_tests/examples/unused_io_amount.rs diff --git a/tests/ui/unused_io_amount.stderr b/clippy_tests/examples/unused_io_amount.stderr similarity index 100% rename from tests/ui/unused_io_amount.stderr rename to clippy_tests/examples/unused_io_amount.stderr diff --git a/tests/ui/unused_labels.rs b/clippy_tests/examples/unused_labels.rs similarity index 100% rename from tests/ui/unused_labels.rs rename to clippy_tests/examples/unused_labels.rs diff --git a/tests/ui/unused_labels.stderr b/clippy_tests/examples/unused_labels.stderr similarity index 100% rename from tests/ui/unused_labels.stderr rename to clippy_tests/examples/unused_labels.stderr diff --git a/tests/ui/unused_lt.rs b/clippy_tests/examples/unused_lt.rs similarity index 100% rename from tests/ui/unused_lt.rs rename to clippy_tests/examples/unused_lt.rs diff --git a/tests/ui/unused_lt.stderr b/clippy_tests/examples/unused_lt.stderr similarity index 100% rename from tests/ui/unused_lt.stderr rename to clippy_tests/examples/unused_lt.stderr diff --git a/tests/ui/update-all-references.sh b/clippy_tests/examples/update-all-references.sh similarity index 100% rename from tests/ui/update-all-references.sh rename to clippy_tests/examples/update-all-references.sh diff --git a/tests/ui/update-references.sh b/clippy_tests/examples/update-references.sh similarity index 100% rename from tests/ui/update-references.sh rename to clippy_tests/examples/update-references.sh diff --git a/tests/ui/use_self.rs b/clippy_tests/examples/use_self.rs similarity index 100% rename from tests/ui/use_self.rs rename to clippy_tests/examples/use_self.rs diff --git a/tests/ui/use_self.stderr b/clippy_tests/examples/use_self.stderr similarity index 100% rename from tests/ui/use_self.stderr rename to clippy_tests/examples/use_self.stderr diff --git a/tests/ui/used_underscore_binding.rs b/clippy_tests/examples/used_underscore_binding.rs similarity index 100% rename from tests/ui/used_underscore_binding.rs rename to clippy_tests/examples/used_underscore_binding.rs diff --git a/tests/ui/used_underscore_binding.stderr b/clippy_tests/examples/used_underscore_binding.stderr similarity index 100% rename from tests/ui/used_underscore_binding.stderr rename to clippy_tests/examples/used_underscore_binding.stderr diff --git a/tests/ui/useless_asref.rs b/clippy_tests/examples/useless_asref.rs similarity index 100% rename from tests/ui/useless_asref.rs rename to clippy_tests/examples/useless_asref.rs diff --git a/tests/ui/useless_asref.stderr b/clippy_tests/examples/useless_asref.stderr similarity index 100% rename from tests/ui/useless_asref.stderr rename to clippy_tests/examples/useless_asref.stderr diff --git a/tests/ui/useless_attribute.rs b/clippy_tests/examples/useless_attribute.rs similarity index 100% rename from tests/ui/useless_attribute.rs rename to clippy_tests/examples/useless_attribute.rs diff --git a/tests/ui/useless_attribute.stderr b/clippy_tests/examples/useless_attribute.stderr similarity index 100% rename from tests/ui/useless_attribute.stderr rename to clippy_tests/examples/useless_attribute.stderr diff --git a/tests/ui/vec.rs b/clippy_tests/examples/vec.rs similarity index 100% rename from tests/ui/vec.rs rename to clippy_tests/examples/vec.rs diff --git a/tests/ui/vec.stderr b/clippy_tests/examples/vec.stderr similarity index 100% rename from tests/ui/vec.stderr rename to clippy_tests/examples/vec.stderr diff --git a/tests/ui/while_loop.rs b/clippy_tests/examples/while_loop.rs similarity index 100% rename from tests/ui/while_loop.rs rename to clippy_tests/examples/while_loop.rs diff --git a/tests/ui/while_loop.stderr b/clippy_tests/examples/while_loop.stderr similarity index 100% rename from tests/ui/while_loop.stderr rename to clippy_tests/examples/while_loop.stderr diff --git a/tests/ui/wrong_self_convention.rs b/clippy_tests/examples/wrong_self_convention.rs similarity index 100% rename from tests/ui/wrong_self_convention.rs rename to clippy_tests/examples/wrong_self_convention.rs diff --git a/tests/ui/wrong_self_convention.stderr b/clippy_tests/examples/wrong_self_convention.stderr similarity index 100% rename from tests/ui/wrong_self_convention.stderr rename to clippy_tests/examples/wrong_self_convention.stderr diff --git a/tests/ui/zero_div_zero.rs b/clippy_tests/examples/zero_div_zero.rs similarity index 100% rename from tests/ui/zero_div_zero.rs rename to clippy_tests/examples/zero_div_zero.rs diff --git a/tests/ui/zero_div_zero.stderr b/clippy_tests/examples/zero_div_zero.stderr similarity index 100% rename from tests/ui/zero_div_zero.stderr rename to clippy_tests/examples/zero_div_zero.stderr diff --git a/tests/ui/zero_ptr.rs b/clippy_tests/examples/zero_ptr.rs similarity index 100% rename from tests/ui/zero_ptr.rs rename to clippy_tests/examples/zero_ptr.rs diff --git a/tests/ui/zero_ptr.stderr b/clippy_tests/examples/zero_ptr.stderr similarity index 100% rename from tests/ui/zero_ptr.stderr rename to clippy_tests/examples/zero_ptr.stderr From eb1ed192313f17eda74441fee822e357a1b7a249 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 18:16:10 +0100 Subject: [PATCH 3/8] Switch pretty_assertions to pretty non-assertions We don't want to panic here just yet :) --- clippy_tests/Cargo.toml | 3 +- clippy_tests/src/diff.rs | 196 +++++++++++++++++++++++++++++++++++++++ clippy_tests/src/main.rs | 25 +++-- 3 files changed, 217 insertions(+), 7 deletions(-) create mode 100644 clippy_tests/src/diff.rs diff --git a/clippy_tests/Cargo.toml b/clippy_tests/Cargo.toml index 8ee55c5ccdc9..072fe8085de2 100644 --- a/clippy_tests/Cargo.toml +++ b/clippy_tests/Cargo.toml @@ -9,9 +9,10 @@ env_logger = "0.5.0-rc.1" failure = "0.1.1" failure_derive = "0.1.1" log = "0.4.1" -pretty_assertions = "0.4.1" # rustfix = { git = "https://github.com/killercup/rustfix" } rustfix = { path = '../../../rustfix' } serde_json = "1.0" tempdir = "0.3.5" rayon = "0.9.0" +difference = "1.0.0" +ansi_term = "0.10.2" diff --git a/clippy_tests/src/diff.rs b/clippy_tests/src/diff.rs new file mode 100644 index 000000000000..2adcb91d7c05 --- /dev/null +++ b/clippy_tests/src/diff.rs @@ -0,0 +1,196 @@ +//! Draw some pretty diff + +extern crate ansi_term; +extern crate difference; + +use failure::Error; + +pub fn diff(left: &str, right: &str) -> Result { + let mut fancy_diff = String::new(); + let changeset = Changeset::new(&left, &right, "\n"); + format_changeset(&mut fancy_diff, &changeset)?; + + Ok(fancy_diff) +} + +// What follows is copied from [1] which is Copyright 2016-2017 by Colin Kiegel, +// and licensed under MIT/Apache-2.0. +// +// [1]: https://github.com/colin-kiegel/rust-pretty-assertions/blob/cf599543726ddac31f6be2319b35413952c9f9dc/src/format_changeset.rs + +use self::difference::{Difference, Changeset}; +use std::fmt; +use self::ansi_term::Colour::{Red, Green, Fixed}; +use self::ansi_term::Style; + +macro_rules! paint { + ($f:ident, $colour:expr, $fmt:expr, $($args:tt)*) => ( + write!($f, "{}", $colour.paint(format!($fmt, $($args)*))) + ) +} + +const SIGN_RIGHT: char = '>'; // + > → +const SIGN_LEFT: char = '<'; // - < ← + +// Adapted from: +// https://github.com/johannhof/difference.rs/blob/c5749ad7d82aa3d480c15cb61af9f6baa08f116f/examples/github-style.rs +// Credits johannhof (MIT License) + +fn format_changeset(f: &mut fmt::Write, changeset: &Changeset) -> fmt::Result { + let ref diffs = changeset.diffs; + + writeln!( + f, + "{} {} / {} :", + Style::new().bold().paint("Diff"), + Red.paint(format!("{} left", SIGN_LEFT)), + Green.paint(format!("right {}", SIGN_RIGHT)) + )?; + for i in 0..diffs.len() { + match diffs[i] { + Difference::Same(ref same) => { + // Have to split line by line in order to have the extra whitespace + // at the beginning. + for line in same.split("\n") { + writeln!(f, " {}", line)?; + } + } + Difference::Add(ref added) => { + match diffs.get(i - 1) { + Some(&Difference::Rem(ref removed)) => { + // The addition is preceded by an removal. + // + // Let's highlight the character-differences in this replaced + // chunk. Note that this chunk can span over multiple lines. + format_replacement(f, added, removed)?; + } + _ => { + for line in added.split("\n") { + paint!(f, Green, "{}{}\n", SIGN_RIGHT, line)?; + } + } + }; + } + Difference::Rem(ref removed) => { + match diffs.get(i + 1) { + Some(&Difference::Add(_)) => { + // The removal is followed by an addition. + // + // ... we'll handle both in the next iteration. + } + _ => { + for line in removed.split("\n") { + paint!(f, Red, "{}{}\n", SIGN_LEFT, line)?; + } + } + } + } + } + } + Ok(()) +} + +macro_rules! join { + ( + $elem:ident in ($iter:expr) { + $( $body:tt )* + } seperated by { + $( $separator:tt )* + } + ) => ( + let mut iter = $iter; + + if let Some($elem) = iter.next() { + $( $body )* + } + + for $elem in iter { + $( $separator )* + $( $body )* + } + ) +} + +pub fn format_replacement(f: &mut fmt::Write, added: &str, removed: &str) -> fmt::Result { + let Changeset { diffs, .. } = Changeset::new(removed, added, ""); + + // LEFT side (==what's been) + paint!(f, Red, "{}", SIGN_LEFT)?; + for c in &diffs { + match *c { + Difference::Same(ref word_diff) => { + join!(chunk in (word_diff.split("\n")) { + paint!(f, Red, "{}", chunk)?; + } seperated by { + writeln!(f)?; + paint!(f, Red, "{}", SIGN_LEFT)?; + }); + } + Difference::Rem(ref word_diff) => { + join!(chunk in (word_diff.split("\n")) { + paint!(f, Red.on(Fixed(52)).bold(), "{}", chunk)?; + } seperated by { + writeln!(f)?; + paint!(f, Red.bold(), "{}", SIGN_LEFT)?; + }); + } + _ => (), + } + } + writeln!(f, "")?; + + // RIGHT side (==what's new) + paint!(f, Green, "{}", SIGN_RIGHT)?; + for c in &diffs { + match *c { + Difference::Same(ref word_diff) => { + join!(chunk in (word_diff.split("\n")) { + paint!(f, Green, "{}", chunk)?; + } seperated by { + writeln!(f)?; + paint!(f, Green, "{}", SIGN_RIGHT)?; + }); + } + Difference::Add(ref word_diff) => { + join!(chunk in (word_diff.split("\n")) { + paint!(f, Green.on(Fixed(22)).bold(), "{}", chunk)?; + } seperated by { + writeln!(f)?; + paint!(f, Green.bold(), "{}", SIGN_RIGHT)?; + }); + } + _ => (), + } + } + + writeln!(f, "") +} + +#[test] +fn test_format_replacement() { + let added = " 84,\ + \n 248,"; + let removed = " 0,\ + \n 0,\ + \n 128,"; + + let mut buf = String::new(); + let _ = format_replacement(&mut buf, added, removed); + + println!( + "## removed ##\ + \n{}\ + \n## added ##\ + \n{}\ + \n## diff ##\ + \n{}", + removed, + added, + buf + ); + + assert_eq!( + buf, + "\u{1b}[31m<\u{1b}[0m\u{1b}[31m \u{1b}[0m\u{1b}[1;48;5;52;31m0\u{1b}[0m\u{1b}[31m,\u{1b}[0m\n\u{1b}[31m<\u{1b}[0m\u{1b}[31m \u{1b}[0m\u{1b}[1;48;5;52;31m0,\u{1b}[0m\n\u{1b}[1;31m<\u{1b}[0m\u{1b}[1;48;5;52;31m 1\u{1b}[0m\u{1b}[31m2\u{1b}[0m\u{1b}[31m8,\u{1b}[0m\n\u{1b}[32m>\u{1b}[0m\u{1b}[32m \u{1b}[0m\u{1b}[1;48;5;22;32m84\u{1b}[0m\u{1b}[32m,\u{1b}[0m\n\u{1b}[32m>\u{1b}[0m\u{1b}[32m \u{1b}[0m\u{1b}[32m2\u{1b}[0m\u{1b}[1;48;5;22;32m4\u{1b}[0m\u{1b}[32m8,\u{1b}[0m\n" + ); +} diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs index 660e45d7a194..797acc2156c4 100644 --- a/clippy_tests/src/main.rs +++ b/clippy_tests/src/main.rs @@ -3,7 +3,6 @@ extern crate serde_json; extern crate failure; #[macro_use] extern crate log; #[macro_use] extern crate duct; -#[macro_use] extern crate pretty_assertions; extern crate tempdir; extern crate env_logger; extern crate rayon; @@ -15,9 +14,9 @@ use std::collections::HashSet; use failure::{Error, ResultExt, err_msg}; use rayon::prelude::*; -mod compile; -use compile::*; +mod compile; use compile::*; mod fix; +mod diff; use diff::diff; fn read_file(path: &Path) -> Result { use std::io::Read; @@ -39,11 +38,15 @@ fn rename(file: &Path, suffix: &str) -> Result { #[derive(Fail, Debug)] #[fail(display = "Could not test suggestions, there was no assertion file")] -pub struct NoSuggestionsTestFile; +struct NoSuggestionsTestFile; #[derive(Fail, Debug)] #[fail(display = "Could not test human readable error messages, there was no assertion file")] -pub struct NoUiTestFile; +struct NoUiTestFile; + +#[derive(Fail, Debug)] +#[fail(display = "Mismatch between expected and generated fixed file")] +struct FixedFileMismatch; fn test_rustfix_with_file>(file: P) -> Result<(), Error> { let file: &Path = file.as_ref(); @@ -81,7 +84,17 @@ fn test_rustfix_with_file>(file: P) -> Result<(), Error> { } let expected_fixed = read_file(&fixed_file).map_err(|_| NoSuggestionsTestFile)?; - assert_eq!(fixed.trim(), expected_fixed.trim(), "file doesn't look fixed"); + if fixed.trim() != expected_fixed.trim() { + use log::Level::Debug; + if log_enabled!(Debug) { + debug!( + "Difference between file produced by rustfix \ + and expected fixed file:\n{}", + diff(&fixed, &expected_fixed)?, + ); + } + Err(FixedFileMismatch)?; + }; debug!("compiling fixed file {:?}", fixed_file); compiles_without_errors(&fixed_file)?; From d4a766452e5588beefa0cbe0c97704a185b65425 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 18:22:25 +0100 Subject: [PATCH 4/8] Refactor: Move all things fixing into fix mod --- clippy_tests/src/fix.rs | 22 ++++++++++++++++++++-- clippy_tests/src/main.rs | 14 +------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/clippy_tests/src/fix.rs b/clippy_tests/src/fix.rs index 934cac8dccb7..cf66a178f96b 100644 --- a/clippy_tests/src/fix.rs +++ b/clippy_tests/src/fix.rs @@ -1,7 +1,25 @@ -use rustfix::Replacement; +use rustfix::{Suggestion, Replacement}; use failure::Error; -pub fn apply_suggestion(file_content: &mut String, suggestion: &Replacement) -> Result { +pub fn apply_suggestions(file_content: &str, suggestions: &[Suggestion]) -> Result { + let mut fixed = String::from(file_content); + + for sug in suggestions.into_iter().rev() { + trace!("{:?}", sug); + for sol in &sug.solutions { + trace!("{:?}", sol); + for r in &sol.replacements { + debug!("replaced."); + trace!("{:?}", r); + fixed = apply_suggestion(&mut fixed, r)?; + } + } + } + + Ok(fixed) +} + +fn apply_suggestion(file_content: &mut String, suggestion: &Replacement) -> Result { use std::cmp::max; let mut new_content = String::new(); diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs index 797acc2156c4..631ad91e3372 100644 --- a/clippy_tests/src/main.rs +++ b/clippy_tests/src/main.rs @@ -60,20 +60,8 @@ fn test_rustfix_with_file>(file: P) -> Result<(), Error> { debug!("collecting suggestions for {:?}", file); let suggestions = rustfix::get_suggestions_from_json(&errors, &HashSet::new()); - let mut fixed = code.clone(); - debug!("applying suggestions for {:?}", file); - for sug in suggestions.into_iter().rev() { - trace!("{:?}", sug); - for sol in sug.solutions { - trace!("{:?}", sol); - for r in sol.replacements { - debug!("replaced."); - trace!("{:?}", r); - fixed = fix::apply_suggestion(&mut fixed, &r)?; - } - } - } + let fixed = fix::apply_suggestions(&code, &suggestions)?; if std::env::var("RUSTFIX_PLS_FIX_AND_RECORD_MY_CODE").is_ok() { use std::io::Write; From b9da47f3756e80df2659da1b52a0f10a0b9802eb Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 18:24:36 +0100 Subject: [PATCH 5/8] Refactor: No glob imports no more --- clippy_tests/src/compile.rs | 6 +++--- clippy_tests/src/diff.rs | 2 +- clippy_tests/src/main.rs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clippy_tests/src/compile.rs b/clippy_tests/src/compile.rs index 2721ab9bd527..afbcb0f80965 100644 --- a/clippy_tests/src/compile.rs +++ b/clippy_tests/src/compile.rs @@ -2,7 +2,7 @@ use std::path::Path; use failure::{Error, err_msg}; use std::process::Output; -pub fn compile(file: &Path) -> Result { +fn compile(file: &Path) -> Result { let example_name = file.file_stem() .ok_or_else(|| err_msg(format!("Couldn't get file name from {:?}", file)))?; @@ -22,7 +22,7 @@ pub fn compile(file: &Path) -> Result { Ok(res) } -pub fn compile_and_get_json_errors(file: &Path) -> Result { +pub fn get_json_errors(file: &Path) -> Result { let res = compile(file)?; let stderr = String::from_utf8(res.stderr)?; @@ -34,7 +34,7 @@ pub fn compile_and_get_json_errors(file: &Path) -> Result { } } -pub fn compiles_without_errors(file: &Path) -> Result<(), Error> { +pub fn without_errors(file: &Path) -> Result<(), Error> { let res = compile(file)?; match res.status.code() { diff --git a/clippy_tests/src/diff.rs b/clippy_tests/src/diff.rs index 2adcb91d7c05..1111728972f6 100644 --- a/clippy_tests/src/diff.rs +++ b/clippy_tests/src/diff.rs @@ -5,7 +5,7 @@ extern crate difference; use failure::Error; -pub fn diff(left: &str, right: &str) -> Result { +pub fn render(left: &str, right: &str) -> Result { let mut fancy_diff = String::new(); let changeset = Changeset::new(&left, &right, "\n"); format_changeset(&mut fancy_diff, &changeset)?; diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs index 631ad91e3372..539d33deedf6 100644 --- a/clippy_tests/src/main.rs +++ b/clippy_tests/src/main.rs @@ -14,9 +14,9 @@ use std::collections::HashSet; use failure::{Error, ResultExt, err_msg}; use rayon::prelude::*; -mod compile; use compile::*; +mod compile; mod fix; -mod diff; use diff::diff; +mod diff; fn read_file(path: &Path) -> Result { use std::io::Read; @@ -56,7 +56,7 @@ fn test_rustfix_with_file>(file: P) -> Result<(), Error> { let code = read_file(file)?; debug!("compiling... {:?}", file); - let errors = compile_and_get_json_errors(file)?; + let errors = compile::get_json_errors(file)?; debug!("collecting suggestions for {:?}", file); let suggestions = rustfix::get_suggestions_from_json(&errors, &HashSet::new()); @@ -78,14 +78,14 @@ fn test_rustfix_with_file>(file: P) -> Result<(), Error> { debug!( "Difference between file produced by rustfix \ and expected fixed file:\n{}", - diff(&fixed, &expected_fixed)?, + diff::render(&fixed, &expected_fixed)?, ); } Err(FixedFileMismatch)?; }; debug!("compiling fixed file {:?}", fixed_file); - compiles_without_errors(&fixed_file)?; + compile::without_errors(&fixed_file)?; Ok(()) } From 1c54f8c676b04737b49b6de25bfa4e29f4e05d1a Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 19:10:20 +0100 Subject: [PATCH 6/8] Use rustfix from git --- clippy_tests/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clippy_tests/Cargo.toml b/clippy_tests/Cargo.toml index 072fe8085de2..416f8aa2e794 100644 --- a/clippy_tests/Cargo.toml +++ b/clippy_tests/Cargo.toml @@ -9,8 +9,7 @@ env_logger = "0.5.0-rc.1" failure = "0.1.1" failure_derive = "0.1.1" log = "0.4.1" -# rustfix = { git = "https://github.com/killercup/rustfix" } -rustfix = { path = '../../../rustfix' } +rustfix = { git = "https://github.com/killercup/rustfix" } serde_json = "1.0" tempdir = "0.3.5" rayon = "0.9.0" From 61579578450bad82ec3f88e825a60799c9b0d595 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 19:10:53 +0100 Subject: [PATCH 7/8] Refactor test result collection a bit Yes this is overkill. Yes, I really enjoyed doing that. --- clippy_tests/src/main.rs | 67 ++++++++++++++------------------ clippy_tests/src/test_results.rs | 43 ++++++++++++++++++++ 2 files changed, 73 insertions(+), 37 deletions(-) create mode 100644 clippy_tests/src/test_results.rs diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs index 539d33deedf6..8d4f2278ae99 100644 --- a/clippy_tests/src/main.rs +++ b/clippy_tests/src/main.rs @@ -17,6 +17,8 @@ use rayon::prelude::*; mod compile; mod fix; mod diff; +mod test_results; +use test_results::TestResults; fn read_file(path: &Path) -> Result { use std::io::Read; @@ -102,45 +104,36 @@ fn get_fixture_files() -> Result, Error> { .collect()) } -fn main() { - use std::sync::atomic::{AtomicUsize, Ordering}; +fn run(file: &Path) -> TestResults { + match test_rustfix_with_file(&file) { + Ok(_) => { + info!("passed: {:?}", file); + TestResults::passed() + }, + Err(e) => { + match e.downcast::() { + Ok(e) => { + info!("ignored: {:?} (no fixed file)", file); + debug!("{:?}", e); + TestResults::ignored() + }, + Err(e) => { + warn!("failed: {:?}", file); + debug!("{:?}", e); + TestResults::failed() + } + } + } + } +} +fn main() { env_logger::init(); let files = get_fixture_files().unwrap(); - let passed = AtomicUsize::new(0); - let failed = AtomicUsize::new(0); - let ignored = AtomicUsize::new(0); - - files.par_iter().for_each(|file| { - match test_rustfix_with_file(&file) { - Ok(_) => { - info!("passed: {:?}", file); - passed.fetch_add(1, Ordering::SeqCst); - }, - Err(e) => { - match e.downcast::() { - Ok(e) => { - info!("ignored: {:?} (no fixed file)", file); - debug!("{:?}", e); - ignored.fetch_add(1, Ordering::SeqCst); - }, - Err(e) => { - warn!("failed: {:?}", file); - debug!("{:?}", e); - failed.fetch_add(1, Ordering::SeqCst); - } - } - } - } - }); - - let passed = passed.into_inner(); - let failed = failed.into_inner(); - let ignored = ignored.into_inner(); - let res = if failed > 0 { "failed" } else { "ok" }; - println!( - "test result: {}. {} passed; {} failed; {} ignored;", - res, passed, failed, ignored, - ); + let res = files.par_iter() + .map(|path| run(path)) + .reduce(TestResults::default, |a, b| a + b); + + println!("{}", res); } diff --git a/clippy_tests/src/test_results.rs b/clippy_tests/src/test_results.rs new file mode 100644 index 000000000000..96b00d68d19e --- /dev/null +++ b/clippy_tests/src/test_results.rs @@ -0,0 +1,43 @@ +#[derive(Debug, Default, Clone, Copy)] +pub struct TestResults { + passed: i32, + failed: i32, + ignored: i32, +} + +impl TestResults { + pub fn passed() -> TestResults { + TestResults { passed: 1, ..TestResults::default() } + } + + pub fn failed() -> TestResults { + TestResults { failed: 1, ..TestResults::default() } + } + + pub fn ignored() -> TestResults { + TestResults { ignored: 1, ..TestResults::default() } + } +} + +impl ::std::ops::Add for TestResults { + type Output = TestResults; + + fn add(self, other: Self) -> Self { + TestResults { + passed: self.passed + other.passed, + failed: self.failed + other.failed, + ignored: self.ignored + other.ignored, + } + } +} + +impl ::std::fmt::Display for TestResults { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + let res = if self.failed > 0 { "failed" } else { "ok" }; + + write!(f, + "test result: {}. {} passed; {} failed; {} ignored;", + res, self.passed, self.failed, self.ignored, + ) + } +} From 8d37c05dd5f6d19f3ac3538cd7c0d735b95999d4 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 20 Jan 2018 20:18:36 +0100 Subject: [PATCH 8/8] Begin UI test implementation Currently generates some rather ugly diffs with the existing UI tests, but I hope fixing those is just a combination of passing the correct RUSTC_FLAGS and `s/examples/$DIR/g`. --- clippy_tests/Cargo.toml | 2 ++ clippy_tests/src/compile.rs | 12 ++++++++---- clippy_tests/src/human.rs | 19 +++++++++++++++++++ clippy_tests/src/main.rs | 38 +++++++++++++++++++++++++++++++++++-- 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 clippy_tests/src/human.rs diff --git a/clippy_tests/Cargo.toml b/clippy_tests/Cargo.toml index 416f8aa2e794..c72c1fd56bbd 100644 --- a/clippy_tests/Cargo.toml +++ b/clippy_tests/Cargo.toml @@ -10,6 +10,8 @@ failure = "0.1.1" failure_derive = "0.1.1" log = "0.4.1" rustfix = { git = "https://github.com/killercup/rustfix" } +serde_derive = "1.0" +serde = "1.0" serde_json = "1.0" tempdir = "0.3.5" rayon = "0.9.0" diff --git a/clippy_tests/src/compile.rs b/clippy_tests/src/compile.rs index afbcb0f80965..ae99eedd5fe5 100644 --- a/clippy_tests/src/compile.rs +++ b/clippy_tests/src/compile.rs @@ -13,7 +13,10 @@ fn compile(file: &Path) -> Result { ); let res = better_call_clippy .env("RUSTC_WRAPPER", "clippy-driver") + .env("RUSTC_FLAGS", "-Dwarnings") .env("CLIPPY_DISABLE_DOCS_LINKS", "true") + .env("CLIPPY_TESTS", "true") + .env("RUST_BACKTRACE", "0") .stdout_capture() .stderr_capture() .unchecked() @@ -24,12 +27,13 @@ fn compile(file: &Path) -> Result { pub fn get_json_errors(file: &Path) -> Result { let res = compile(file)?; - let stderr = String::from_utf8(res.stderr)?; - match res.status.code() { - Some(0) | Some(1) | Some(101) => Ok(stderr), + Some(0) | Some(1) | Some(101) => Ok(String::from_utf8(res.stdout)?), _ => Err(err_msg( - format!("failed with status {:?}: {}", res.status.code(), stderr), + format!( + "failed with status {:?}: {}", + res.status.code(), String::from_utf8(res.stderr)?, + ), )) } } diff --git a/clippy_tests/src/human.rs b/clippy_tests/src/human.rs new file mode 100644 index 000000000000..a723fc35a673 --- /dev/null +++ b/clippy_tests/src/human.rs @@ -0,0 +1,19 @@ +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +struct CargoMessage { + message: Diagnostic, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +struct Diagnostic { + rendered: String, +} + +pub fn ui_from_json(input: &str) -> String { + input.lines() + .map(|l| ::serde_json::from_str::(l)) + // eat parsing errors + .flat_map(|line| line.ok()) + // One diagnostic line might have multiple suggestions + .map(|c| c.message.rendered) + .collect() +} diff --git a/clippy_tests/src/main.rs b/clippy_tests/src/main.rs index 8d4f2278ae99..b85372c0e5f1 100644 --- a/clippy_tests/src/main.rs +++ b/clippy_tests/src/main.rs @@ -1,3 +1,5 @@ +#[macro_use] extern crate serde_derive; +extern crate serde; extern crate serde_json; #[macro_use] extern crate failure_derive; extern crate failure; @@ -17,6 +19,7 @@ use rayon::prelude::*; mod compile; mod fix; mod diff; +mod human; mod test_results; use test_results::TestResults; @@ -50,6 +53,10 @@ struct NoUiTestFile; #[fail(display = "Mismatch between expected and generated fixed file")] struct FixedFileMismatch; +#[derive(Fail, Debug)] +#[fail(display = "Mismatch between expected and generated diagnostics output")] +struct StderrFileMismatch; + fn test_rustfix_with_file>(file: P) -> Result<(), Error> { let file: &Path = file.as_ref(); let fixed_file = rename(file, "fixed")?; @@ -59,6 +66,32 @@ fn test_rustfix_with_file>(file: P) -> Result<(), Error> { let code = read_file(file)?; debug!("compiling... {:?}", file); let errors = compile::get_json_errors(file)?; + + let diagnostics = human::ui_from_json(&errors); + + if std::env::var("RECORD_NEW_DIAGNOSTICS").is_ok() { + use std::io::Write; + let diagnostics_recording = rename(file, "recorded")?.with_extension("stderr"); + let mut recorded_diagnostics = fs::File::create(&diagnostics_recording)?; + recorded_diagnostics.write_all(diagnostics.as_bytes())?; + debug!("wrote recorded diagnostics for {:?} to {:?}", file, diagnostics_recording); + } + + let ui_file = file.with_extension("stderr"); + let expected_diagnostics = read_file(&ui_file).map_err(|_| NoUiTestFile)?; + + debug!("comparing diagnostics for {:?}", file); + if diagnostics.trim() != expected_diagnostics.trim() { + use log::Level::Debug; + if log_enabled!(Debug) { + debug!( + "Difference between generated and expected diagnostics:\n{}", + diff::render(&diagnostics, &expected_diagnostics)?, + ); + } + Err(StderrFileMismatch)?; + }; + debug!("collecting suggestions for {:?}", file); let suggestions = rustfix::get_suggestions_from_json(&errors, &HashSet::new()); @@ -114,12 +147,12 @@ fn run(file: &Path) -> TestResults { match e.downcast::() { Ok(e) => { info!("ignored: {:?} (no fixed file)", file); - debug!("{:?}", e); + debug!("{}", e); TestResults::ignored() }, Err(e) => { warn!("failed: {:?}", file); - debug!("{:?}", e); + debug!("{}", e); TestResults::failed() } } @@ -132,6 +165,7 @@ fn main() { let files = get_fixture_files().unwrap(); let res = files.par_iter() + // .take(10) .map(|path| run(path)) .reduce(TestResults::default, |a, b| a + b);