From 3a76bea04b8f3a06b32521528de57c590af338ce Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 6 Jul 2019 04:04:03 +0000 Subject: [PATCH] Update rustfix tests --- tests/ui/replace_consts.fixed | 5 ---- tests/ui/replace_consts.rs | 4 ++- tests/ui/replace_consts.stderr | 48 +++++++++++++++++----------------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/tests/ui/replace_consts.fixed b/tests/ui/replace_consts.fixed index 2c125f978d9..db312665410 100644 --- a/tests/ui/replace_consts.fixed +++ b/tests/ui/replace_consts.fixed @@ -4,12 +4,9 @@ #![deny(clippy::replace_consts)] use std::sync::atomic::*; -use std::sync::{Once, ONCE_INIT}; #[rustfmt::skip] fn bad() { - // Once - { let foo = ONCE_INIT; }; // Min { let foo = isize::min_value(); }; { let foo = i8::min_value(); }; @@ -40,8 +37,6 @@ fn bad() { #[rustfmt::skip] fn good() { - // Once - { let foo = Once::new(); }; // Atomic { let foo = AtomicBool::new(false); }; { let foo = AtomicIsize::new(0); }; diff --git a/tests/ui/replace_consts.rs b/tests/ui/replace_consts.rs index 3c7d8d07ed6..18e9ac9f100 100644 --- a/tests/ui/replace_consts.rs +++ b/tests/ui/replace_consts.rs @@ -4,10 +4,12 @@ #![deny(clippy::replace_consts)] use std::sync::atomic::*; -use std::sync::{Once, ONCE_INIT}; +use std::sync::Once; #[rustfmt::skip] fn bad() { + #[allow(deprecated, unused_imports)] + use std::sync::ONCE_INIT; // Once { let foo = ONCE_INIT; }; // Min diff --git a/tests/ui/replace_consts.stderr b/tests/ui/replace_consts.stderr index be0d0072623..b0d0788a918 100644 --- a/tests/ui/replace_consts.stderr +++ b/tests/ui/replace_consts.stderr @@ -1,5 +1,5 @@ error: using `MIN` - --> $DIR/replace_consts.rs:14:17 + --> $DIR/replace_consts.rs:11:17 | LL | { let foo = std::isize::MIN; }; | ^^^^^^^^^^^^^^^ help: try this: `isize::min_value()` @@ -11,139 +11,139 @@ LL | #![deny(clippy::replace_consts)] | ^^^^^^^^^^^^^^^^^^^^^^ error: using `MIN` - --> $DIR/replace_consts.rs:15:17 + --> $DIR/replace_consts.rs:12:17 | LL | { let foo = std::i8::MIN; }; | ^^^^^^^^^^^^ help: try this: `i8::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:16:17 + --> $DIR/replace_consts.rs:13:17 | LL | { let foo = std::i16::MIN; }; | ^^^^^^^^^^^^^ help: try this: `i16::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:17:17 + --> $DIR/replace_consts.rs:14:17 | LL | { let foo = std::i32::MIN; }; | ^^^^^^^^^^^^^ help: try this: `i32::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:18:17 + --> $DIR/replace_consts.rs:15:17 | LL | { let foo = std::i64::MIN; }; | ^^^^^^^^^^^^^ help: try this: `i64::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:19:17 + --> $DIR/replace_consts.rs:16:17 | LL | { let foo = std::i128::MIN; }; | ^^^^^^^^^^^^^^ help: try this: `i128::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:20:17 + --> $DIR/replace_consts.rs:17:17 | LL | { let foo = std::usize::MIN; }; | ^^^^^^^^^^^^^^^ help: try this: `usize::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:21:17 + --> $DIR/replace_consts.rs:18:17 | LL | { let foo = std::u8::MIN; }; | ^^^^^^^^^^^^ help: try this: `u8::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:22:17 + --> $DIR/replace_consts.rs:19:17 | LL | { let foo = std::u16::MIN; }; | ^^^^^^^^^^^^^ help: try this: `u16::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:23:17 + --> $DIR/replace_consts.rs:20:17 | LL | { let foo = std::u32::MIN; }; | ^^^^^^^^^^^^^ help: try this: `u32::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:24:17 + --> $DIR/replace_consts.rs:21:17 | LL | { let foo = std::u64::MIN; }; | ^^^^^^^^^^^^^ help: try this: `u64::min_value()` error: using `MIN` - --> $DIR/replace_consts.rs:25:17 + --> $DIR/replace_consts.rs:22:17 | LL | { let foo = std::u128::MIN; }; | ^^^^^^^^^^^^^^ help: try this: `u128::min_value()` error: using `MAX` - --> $DIR/replace_consts.rs:27:17 + --> $DIR/replace_consts.rs:24:17 | LL | { let foo = std::isize::MAX; }; | ^^^^^^^^^^^^^^^ help: try this: `isize::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:28:17 + --> $DIR/replace_consts.rs:25:17 | LL | { let foo = std::i8::MAX; }; | ^^^^^^^^^^^^ help: try this: `i8::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:29:17 + --> $DIR/replace_consts.rs:26:17 | LL | { let foo = std::i16::MAX; }; | ^^^^^^^^^^^^^ help: try this: `i16::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:30:17 + --> $DIR/replace_consts.rs:27:17 | LL | { let foo = std::i32::MAX; }; | ^^^^^^^^^^^^^ help: try this: `i32::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:31:17 + --> $DIR/replace_consts.rs:28:17 | LL | { let foo = std::i64::MAX; }; | ^^^^^^^^^^^^^ help: try this: `i64::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:32:17 + --> $DIR/replace_consts.rs:29:17 | LL | { let foo = std::i128::MAX; }; | ^^^^^^^^^^^^^^ help: try this: `i128::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:33:17 + --> $DIR/replace_consts.rs:30:17 | LL | { let foo = std::usize::MAX; }; | ^^^^^^^^^^^^^^^ help: try this: `usize::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:34:17 + --> $DIR/replace_consts.rs:31:17 | LL | { let foo = std::u8::MAX; }; | ^^^^^^^^^^^^ help: try this: `u8::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:35:17 + --> $DIR/replace_consts.rs:32:17 | LL | { let foo = std::u16::MAX; }; | ^^^^^^^^^^^^^ help: try this: `u16::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:36:17 + --> $DIR/replace_consts.rs:33:17 | LL | { let foo = std::u32::MAX; }; | ^^^^^^^^^^^^^ help: try this: `u32::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:37:17 + --> $DIR/replace_consts.rs:34:17 | LL | { let foo = std::u64::MAX; }; | ^^^^^^^^^^^^^ help: try this: `u64::max_value()` error: using `MAX` - --> $DIR/replace_consts.rs:38:17 + --> $DIR/replace_consts.rs:35:17 | LL | { let foo = std::u128::MAX; }; | ^^^^^^^^^^^^^^ help: try this: `u128::max_value()`