]> git.lizzy.rs Git - rust.git/commitdiff
Update tests to remove old numeric constants
authorbstrie <bstrie@thinwsl>
Sat, 24 Oct 2020 23:21:40 +0000 (19:21 -0400)
committerbstrie <bstrie@thinwsl>
Sun, 29 Nov 2020 05:55:55 +0000 (00:55 -0500)
Part of #68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.

106 files changed:
library/core/src/intrinsics.rs
library/core/tests/num/nan.rs
src/test/codegen/enum-discriminant-value.rs
src/test/codegen/issue-56927.rs
src/test/compile-fail/consts/issue-55878.rs
src/test/rustdoc/reexport-check.rs
src/test/rustdoc/show-const-contents.rs
src/test/ui/array-slice-vec/bounds-check-no-overflow.rs
src/test/ui/associated-consts/issue-69020-assoc-const-arith-overflow.noopt.stderr
src/test/ui/associated-consts/issue-69020-assoc-const-arith-overflow.opt.stderr
src/test/ui/associated-consts/issue-69020-assoc-const-arith-overflow.opt_with_overflow_checks.stderr
src/test/ui/associated-consts/issue-69020-assoc-const-arith-overflow.rs
src/test/ui/big-literals.rs
src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs
src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr
src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr
src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs
src/test/ui/const-generics/issues/issue-73260.rs
src/test/ui/const-generics/issues/issue-73260.stderr
src/test/ui/consts/const-err-early.rs
src/test/ui/consts/const-err-early.stderr
src/test/ui/consts/const-err-multi.rs
src/test/ui/consts/const-err-multi.stderr
src/test/ui/consts/const-err2.noopt.stderr
src/test/ui/consts/const-err2.opt.stderr
src/test/ui/consts/const-err2.opt_with_overflow_checks.stderr
src/test/ui/consts/const-err2.rs
src/test/ui/consts/const-eval/const-eval-overflow-3.rs
src/test/ui/consts/const-eval/const-eval-overflow-3.stderr
src/test/ui/consts/const-eval/const-eval-overflow-3b.rs
src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
src/test/ui/consts/const-eval/const-eval-overflow-4.rs
src/test/ui/consts/const-eval/const-eval-overflow-4.stderr
src/test/ui/consts/const-eval/const-eval-overflow-4b.rs
src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
src/test/ui/consts/const-eval/const-eval-overflow2.rs
src/test/ui/consts/const-eval/const-eval-overflow2.stderr
src/test/ui/consts/const-eval/const-eval-overflow2b.rs
src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
src/test/ui/consts/const-eval/const-eval-overflow2c.rs
src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
src/test/ui/consts/const-eval/dangling.rs
src/test/ui/consts/const-int-arithmetic.rs
src/test/ui/consts/const-int-overflowing-rpass.rs
src/test/ui/consts/const-negation.rs
src/test/ui/consts/issue-63952.rs
src/test/ui/consts/issue-63952.stderr
src/test/ui/consts/promote_fn_calls_std.rs
src/test/ui/consts/promotion.rs
src/test/ui/discrim/discrim-ill-typed.rs
src/test/ui/discrim/discrim-ill-typed.stderr
src/test/ui/discrim/discrim-overflow-2.rs
src/test/ui/discrim/discrim-overflow-2.stderr
src/test/ui/discrim/discrim-overflow.rs
src/test/ui/discrim/discrim-overflow.stderr
src/test/ui/drop/dynamic-drop-async.rs
src/test/ui/drop/dynamic-drop.rs
src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
src/test/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs
src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr
src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs
src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
src/test/ui/hashmap/hashmap-capacity-overflow.rs
src/test/ui/issues/issue-20427.rs
src/test/ui/issues/issue-23833.rs
src/test/ui/issues/issue-37686.rs
src/test/ui/issues/issue-41880.rs
src/test/ui/issues/issue-48006.rs
src/test/ui/issues/issue-50811.rs
src/test/ui/issues/issue-68010-large-zst-consts.rs
src/test/ui/issues/issue-6804.rs
src/test/ui/issues/issue-8460-const.noopt.stderr
src/test/ui/issues/issue-8460-const.opt.stderr
src/test/ui/issues/issue-8460-const.opt_with_overflow_checks.stderr
src/test/ui/issues/issue-8460-const.rs
src/test/ui/iterators/iter-count-overflow-debug.rs
src/test/ui/iterators/iter-count-overflow-ndebug.rs
src/test/ui/iterators/iter-position-overflow-debug.rs
src/test/ui/iterators/iter-position-overflow-ndebug.rs
src/test/ui/macros/macro-first-set.rs
src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.rs
src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr
src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs
src/test/ui/numbers-arithmetic/float-nan.rs
src/test/ui/numbers-arithmetic/num-wrapping.rs
src/test/ui/numbers-arithmetic/overflowing-neg.rs
src/test/ui/numbers-arithmetic/saturating-float-casts-impl.rs
src/test/ui/numbers-arithmetic/shift-near-oflo.rs
src/test/ui/numbers-arithmetic/u128-as-f32.rs
src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr
src/test/ui/regions/regions-addr-of-upvar-self.rs
src/test/ui/regions/regions-addr-of-upvar-self.stderr
src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs
src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
src/test/ui/simd/simd-intrinsic-float-minmax.rs
src/test/ui/simd/simd-intrinsic-generic-comparison.rs
src/test/ui/sleep.rs
src/test/ui/structs-enums/discrim-explicit-23030.rs
src/test/ui/symbol-names/const-generics.rs
src/test/ui/union/union-transmute.rs
src/test/ui/use-module-level-int-consts.rs
src/test/ui/wrapping-int-api.rs
src/tools/clippy/tests/ui/float_cmp_const.rs

index 5a5aa76a076272210aef2da9248f209f1e896592..1a588b314c4f163cdc195ae11334d044a569497d 100644 (file)
     /// Returns the square root of an `f32`
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::sqrt`](../../std/primitive.f32.html#method.sqrt)
+    /// [`f32::sqrt`](../../std/primitive.f32.html#method.sqrt)
     pub fn sqrtf32(x: f32) -> f32;
     /// Returns the square root of an `f64`
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::sqrt`](../../std/primitive.f64.html#method.sqrt)
+    /// [`f64::sqrt`](../../std/primitive.f64.html#method.sqrt)
     pub fn sqrtf64(x: f64) -> f64;
 
     /// Raises an `f32` to an integer power.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::powi`](../../std/primitive.f32.html#method.powi)
+    /// [`f32::powi`](../../std/primitive.f32.html#method.powi)
     pub fn powif32(a: f32, x: i32) -> f32;
     /// Raises an `f64` to an integer power.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::powi`](../../std/primitive.f64.html#method.powi)
+    /// [`f64::powi`](../../std/primitive.f64.html#method.powi)
     pub fn powif64(a: f64, x: i32) -> f64;
 
     /// Returns the sine of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::sin`](../../std/primitive.f32.html#method.sin)
+    /// [`f32::sin`](../../std/primitive.f32.html#method.sin)
     pub fn sinf32(x: f32) -> f32;
     /// Returns the sine of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::sin`](../../std/primitive.f64.html#method.sin)
+    /// [`f64::sin`](../../std/primitive.f64.html#method.sin)
     pub fn sinf64(x: f64) -> f64;
 
     /// Returns the cosine of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::cos`](../../std/primitive.f32.html#method.cos)
+    /// [`f32::cos`](../../std/primitive.f32.html#method.cos)
     pub fn cosf32(x: f32) -> f32;
     /// Returns the cosine of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::cos`](../../std/primitive.f64.html#method.cos)
+    /// [`f64::cos`](../../std/primitive.f64.html#method.cos)
     pub fn cosf64(x: f64) -> f64;
 
     /// Raises an `f32` to an `f32` power.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::powf`](../../std/primitive.f32.html#method.powf)
+    /// [`f32::powf`](../../std/primitive.f32.html#method.powf)
     pub fn powf32(a: f32, x: f32) -> f32;
     /// Raises an `f64` to an `f64` power.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::powf`](../../std/primitive.f64.html#method.powf)
+    /// [`f64::powf`](../../std/primitive.f64.html#method.powf)
     pub fn powf64(a: f64, x: f64) -> f64;
 
     /// Returns the exponential of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::exp`](../../std/primitive.f32.html#method.exp)
+    /// [`f32::exp`](../../std/primitive.f32.html#method.exp)
     pub fn expf32(x: f32) -> f32;
     /// Returns the exponential of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::exp`](../../std/primitive.f64.html#method.exp)
+    /// [`f64::exp`](../../std/primitive.f64.html#method.exp)
     pub fn expf64(x: f64) -> f64;
 
     /// Returns 2 raised to the power of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::exp2`](../../std/primitive.f32.html#method.exp2)
+    /// [`f32::exp2`](../../std/primitive.f32.html#method.exp2)
     pub fn exp2f32(x: f32) -> f32;
     /// Returns 2 raised to the power of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::exp2`](../../std/primitive.f64.html#method.exp2)
+    /// [`f64::exp2`](../../std/primitive.f64.html#method.exp2)
     pub fn exp2f64(x: f64) -> f64;
 
     /// Returns the natural logarithm of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::ln`](../../std/primitive.f32.html#method.ln)
+    /// [`f32::ln`](../../std/primitive.f32.html#method.ln)
     pub fn logf32(x: f32) -> f32;
     /// Returns the natural logarithm of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::ln`](../../std/primitive.f64.html#method.ln)
+    /// [`f64::ln`](../../std/primitive.f64.html#method.ln)
     pub fn logf64(x: f64) -> f64;
 
     /// Returns the base 10 logarithm of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::log10`](../../std/primitive.f32.html#method.log10)
+    /// [`f32::log10`](../../std/primitive.f32.html#method.log10)
     pub fn log10f32(x: f32) -> f32;
     /// Returns the base 10 logarithm of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::log10`](../../std/primitive.f64.html#method.log10)
+    /// [`f64::log10`](../../std/primitive.f64.html#method.log10)
     pub fn log10f64(x: f64) -> f64;
 
     /// Returns the base 2 logarithm of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::log2`](../../std/primitive.f32.html#method.log2)
+    /// [`f32::log2`](../../std/primitive.f32.html#method.log2)
     pub fn log2f32(x: f32) -> f32;
     /// Returns the base 2 logarithm of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::log2`](../../std/primitive.f64.html#method.log2)
+    /// [`f64::log2`](../../std/primitive.f64.html#method.log2)
     pub fn log2f64(x: f64) -> f64;
 
     /// Returns `a * b + c` for `f32` values.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::mul_add`](../../std/primitive.f32.html#method.mul_add)
+    /// [`f32::mul_add`](../../std/primitive.f32.html#method.mul_add)
     pub fn fmaf32(a: f32, b: f32, c: f32) -> f32;
     /// Returns `a * b + c` for `f64` values.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::mul_add`](../../std/primitive.f64.html#method.mul_add)
+    /// [`f64::mul_add`](../../std/primitive.f64.html#method.mul_add)
     pub fn fmaf64(a: f64, b: f64, c: f64) -> f64;
 
     /// Returns the absolute value of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::abs`](../../std/primitive.f32.html#method.abs)
+    /// [`f32::abs`](../../std/primitive.f32.html#method.abs)
     pub fn fabsf32(x: f32) -> f32;
     /// Returns the absolute value of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::abs`](../../std/primitive.f64.html#method.abs)
+    /// [`f64::abs`](../../std/primitive.f64.html#method.abs)
     pub fn fabsf64(x: f64) -> f64;
 
     /// Returns the minimum of two `f32` values.
     /// Copies the sign from `y` to `x` for `f32` values.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::copysign`](../../std/primitive.f32.html#method.copysign)
+    /// [`f32::copysign`](../../std/primitive.f32.html#method.copysign)
     pub fn copysignf32(x: f32, y: f32) -> f32;
     /// Copies the sign from `y` to `x` for `f64` values.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::copysign`](../../std/primitive.f64.html#method.copysign)
+    /// [`f64::copysign`](../../std/primitive.f64.html#method.copysign)
     pub fn copysignf64(x: f64, y: f64) -> f64;
 
     /// Returns the largest integer less than or equal to an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::floor`](../../std/primitive.f32.html#method.floor)
+    /// [`f32::floor`](../../std/primitive.f32.html#method.floor)
     pub fn floorf32(x: f32) -> f32;
     /// Returns the largest integer less than or equal to an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::floor`](../../std/primitive.f64.html#method.floor)
+    /// [`f64::floor`](../../std/primitive.f64.html#method.floor)
     pub fn floorf64(x: f64) -> f64;
 
     /// Returns the smallest integer greater than or equal to an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::ceil`](../../std/primitive.f32.html#method.ceil)
+    /// [`f32::ceil`](../../std/primitive.f32.html#method.ceil)
     pub fn ceilf32(x: f32) -> f32;
     /// Returns the smallest integer greater than or equal to an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::ceil`](../../std/primitive.f64.html#method.ceil)
+    /// [`f64::ceil`](../../std/primitive.f64.html#method.ceil)
     pub fn ceilf64(x: f64) -> f64;
 
     /// Returns the integer part of an `f32`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::trunc`](../../std/primitive.f32.html#method.trunc)
+    /// [`f32::trunc`](../../std/primitive.f32.html#method.trunc)
     pub fn truncf32(x: f32) -> f32;
     /// Returns the integer part of an `f64`.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::trunc`](../../std/primitive.f64.html#method.trunc)
+    /// [`f64::trunc`](../../std/primitive.f64.html#method.trunc)
     pub fn truncf64(x: f64) -> f64;
 
     /// Returns the nearest integer to an `f32`. May raise an inexact floating-point exception
     /// Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f32::round`](../../std/primitive.f32.html#method.round)
+    /// [`f32::round`](../../std/primitive.f32.html#method.round)
     pub fn roundf32(x: f32) -> f32;
     /// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
     ///
     /// The stabilized version of this intrinsic is
-    /// [`std::f64::round`](../../std/primitive.f64.html#method.round)
+    /// [`f64::round`](../../std/primitive.f64.html#method.round)
     pub fn roundf64(x: f64) -> f64;
 
     /// Float addition that allows optimizations based on algebraic rules.
index 011ffa790beeecbbf8301c9cbaffbac4565b92c7..ef81988c9612f8d952d920344ea98f018d3036c5 100644 (file)
@@ -1,6 +1,5 @@
 #[test]
 fn test_nan() {
-    use core::f64;
     let x = "NaN".to_string();
     assert_eq!(format!("{}", f64::NAN), x);
     assert_eq!(format!("{:e}", f64::NAN), x);
index f9da987765f9cd58c60fe86a6171304aa8453738..cc14c21200253249e48a6b0388997e361857e265 100644 (file)
@@ -4,14 +4,14 @@
 
 #[repr(i64)]
 pub enum I64 {
-    I64Min = std::i64::MIN,
-    I64Max = std::i64::MAX,
+    I64Min = i64::MIN,
+    I64Max = i64::MAX,
 }
 
 #[repr(u64)]
 pub enum U64 {
-    U64Min = std::u64::MIN,
-    U64Max = std::u64::MAX,
+    U64Min = u64::MIN,
+    U64Max = u64::MAX,
 }
 
 fn main() {
index d502673e2f880d85f539f8188347c7800a68015a..2c84015d5e29a760fe5b99270dfdf21a57c9a6db 100644 (file)
@@ -1,7 +1,6 @@
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type="rlib"]
-use std::usize;
 
 #[repr(align(16))]
 pub struct S {
index 541befa7b1310d2987f27c7e9c6286d54cebbe9d..fee664caa17833fea08c75f53c57d1cdeb1c881f 100644 (file)
@@ -3,5 +3,5 @@
 
 // error-pattern: are too big for the current architecture
 fn main() {
-    println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
+    println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
 }
index 066b0cfe5e80e2f35be81c060e963122f951fc68..841702987ef7ce00d200396630a7d0a9f6c69c3e 100644 (file)
@@ -6,6 +6,7 @@
 // @!has 'foo/index.html' '//code' 'pub use self::i32;'
 // @has 'foo/index.html' '//tr[@class="module-item"]' 'i32'
 // @has 'foo/i32/index.html'
+#[allow(deprecated, deprecated_in_future)]
 pub use std::i32;
 // @!has 'foo/index.html' '//code' 'pub use self::string::String;'
 // @has 'foo/index.html' '//tr[@class="module-item"]' 'String'
index 814339e198f95035b7cf787a35a9f5c4a9bbbf3b..f5a356bcae6acf09fd27f60fd86b68ad234f6c74 100644 (file)
@@ -52,6 +52,7 @@
 pub use std::f32::consts::PI;
 
 // @has show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
+#[allow(deprecated, deprecated_in_future)]
 pub use std::i32::MAX;
 
 macro_rules! int_module {
index 3caf5f44995221bf3e1edaa3ddc24c80b2244811..577853a4e911134f51f471c5a40c0b732dd86a7e 100644 (file)
@@ -2,7 +2,6 @@
 // error-pattern:index out of bounds
 // ignore-emscripten no processes
 
-use std::usize;
 use std::mem::size_of;
 
 fn main() {
index f59287bce736bf99039fb90c455047146f251cbd..0c35819007b7fda5c400b099e9883b7e5a127f7b 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:27:22
    |
 LL |     const NEG: i32 = -i32::MIN + T::NEG;
    |                      ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
@@ -7,25 +7,25 @@ LL |     const NEG: i32 = -i32::MIN + T::NEG;
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:35
    |
 LL |     const NEG_REV: i32 = T::NEG + (-i32::MIN);
    |                                   ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:32:22
    |
 LL |     const ADD: i32 = (i32::MAX+1) + T::ADD;
    |                      ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:36
    |
 LL |     const ADD_REV: i32 =  T::ADD + (i32::MAX+1);
    |                                    ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:37:22
    |
 LL |     const DIV: i32 = (1/0) + T::DIV;
    |                      ^^^^^ attempt to divide `1_i32` by zero
@@ -33,19 +33,19 @@ LL |     const DIV: i32 = (1/0) + T::DIV;
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:35
    |
 LL |     const DIV_REV: i32 = T::DIV + (1/0);
    |                                   ^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:42:22
    |
 LL |     const OOB: i32 = [1][1] + T::OOB;
    |                      ^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:35
    |
 LL |     const OOB_REV: i32 = T::OOB + [1][1];
    |                                   ^^^^^^ index out of bounds: the length is 1 but the index is 1
index f59287bce736bf99039fb90c455047146f251cbd..0c35819007b7fda5c400b099e9883b7e5a127f7b 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:27:22
    |
 LL |     const NEG: i32 = -i32::MIN + T::NEG;
    |                      ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
@@ -7,25 +7,25 @@ LL |     const NEG: i32 = -i32::MIN + T::NEG;
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:35
    |
 LL |     const NEG_REV: i32 = T::NEG + (-i32::MIN);
    |                                   ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:32:22
    |
 LL |     const ADD: i32 = (i32::MAX+1) + T::ADD;
    |                      ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:36
    |
 LL |     const ADD_REV: i32 =  T::ADD + (i32::MAX+1);
    |                                    ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:37:22
    |
 LL |     const DIV: i32 = (1/0) + T::DIV;
    |                      ^^^^^ attempt to divide `1_i32` by zero
@@ -33,19 +33,19 @@ LL |     const DIV: i32 = (1/0) + T::DIV;
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:35
    |
 LL |     const DIV_REV: i32 = T::DIV + (1/0);
    |                                   ^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:42:22
    |
 LL |     const OOB: i32 = [1][1] + T::OOB;
    |                      ^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:35
    |
 LL |     const OOB_REV: i32 = T::OOB + [1][1];
    |                                   ^^^^^^ index out of bounds: the length is 1 but the index is 1
index f59287bce736bf99039fb90c455047146f251cbd..0c35819007b7fda5c400b099e9883b7e5a127f7b 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:27:22
    |
 LL |     const NEG: i32 = -i32::MIN + T::NEG;
    |                      ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
@@ -7,25 +7,25 @@ LL |     const NEG: i32 = -i32::MIN + T::NEG;
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:35
    |
 LL |     const NEG_REV: i32 = T::NEG + (-i32::MIN);
    |                                   ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:32:22
    |
 LL |     const ADD: i32 = (i32::MAX+1) + T::ADD;
    |                      ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:36
    |
 LL |     const ADD_REV: i32 =  T::ADD + (i32::MAX+1);
    |                                    ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:37:22
    |
 LL |     const DIV: i32 = (1/0) + T::DIV;
    |                      ^^^^^ attempt to divide `1_i32` by zero
@@ -33,19 +33,19 @@ LL |     const DIV: i32 = (1/0) + T::DIV;
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:35
    |
 LL |     const DIV_REV: i32 = T::DIV + (1/0);
    |                                   ^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:42:22
    |
 LL |     const OOB: i32 = [1][1] + T::OOB;
    |                      ^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 error: this operation will panic at runtime
-  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35
+  --> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:35
    |
 LL |     const OOB_REV: i32 = T::OOB + [1][1];
    |                                   ^^^^^^ index out of bounds: the length is 1 but the index is 1
index 850f65ae9d183b9c8a70f874b4c51dcd80fa9182..d4af6e8641440baa88e244c7e0db71b07fe18bbf 100644 (file)
@@ -5,8 +5,6 @@
 
 #![crate_type="lib"]
 
-use std::i32;
-
 pub trait Foo {
     const NEG: i32;
     const NEG_REV: i32;
index 131de5439b7d465da5caab18c23d6d252ce4eccb..96ea115c877f0c5728f138809ca8bc7797b23d04 100644 (file)
@@ -10,8 +10,8 @@ pub fn main() {
 
     assert_eq!((-2147483648i32).wrapping_sub(1), 2147483647);
 
-    assert_eq!(-3.40282356e+38_f32, ::std::f32::MIN);
-    assert_eq!(3.40282356e+38_f32, ::std::f32::MAX);
-    assert_eq!(-1.7976931348623158e+308_f64, ::std::f64::MIN);
-    assert_eq!(1.7976931348623158e+308_f64, ::std::f64::MAX);
+    assert_eq!(-3.40282356e+38_f32, f32::MIN);
+    assert_eq!(3.40282356e+38_f32, f32::MAX);
+    assert_eq!(-1.7976931348623158e+308_f64, f64::MIN);
+    assert_eq!(1.7976931348623158e+308_f64, f64::MAX);
 }
index 1b9ec0108b1e742ae3052ff253a2ecca05d5e7df..c182f5ef81b7d34f4ffa14971a1a4293a0969ef3 100644 (file)
@@ -6,7 +6,7 @@ const fn test_me<T>(a: usize, b: usize) -> usize {
     if a < b {
         std::mem::size_of::<T>()
     } else {
-        std::usize::MAX
+        usize::MAX
     }
 }
 
index e4105a3df1c88f26f1c19bf7933354060ad45fb2..b499400472153727cffe0974653311db1afe7bc4 100644 (file)
@@ -1,8 +1,8 @@
 error: constant expression depends on a generic parameter
-  --> $DIR/issue-72819-generic-in-const-eval.rs:9:47
+  --> $DIR/issue-72819-generic-in-const-eval.rs:9:39
    |
-LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
-   |                                               ^^^^^^
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
+   |                                       ^^^^^^
    |
    = note: this may fail depending on what value the parameter takes
 
index 2394b23d7995be7ed55ed882353dbc1c1229c3a0..8df3c85ec1f7749d83cccd11a225976b116896b0 100644 (file)
@@ -1,7 +1,7 @@
 error: generic parameters may not be used in const operations
   --> $DIR/issue-72819-generic-in-const-eval.rs:9:17
    |
-LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
    |                 ^ cannot perform const operation using `N`
    |
    = help: const parameters may only be used as standalone arguments, i.e. `N`
index 6182042bde7817e85aa29d0dd7e69b2625f95578..4c0004795f0dcabfe6e8a537c24afeb47af07d9a 100644 (file)
@@ -6,7 +6,7 @@
 #![cfg_attr(min, feature(min_const_generics))]
 
 struct Arr<const N: usize>
-where Assert::<{N < usize::max_value() / 2}>: IsTrue,
+where Assert::<{N < usize::MAX / 2}>: IsTrue,
 //[full]~^ ERROR constant expression depends on a generic parameter
 //[min]~^^ ERROR generic parameters may not be used in const operations
 {
@@ -19,5 +19,5 @@ trait IsTrue {}
 impl IsTrue for Assert<true> {}
 
 fn main() {
-    let x: Arr<{usize::max_value()}> = Arr {};
+    let x: Arr<{usize::MAX}> = Arr {};
 }
index 351d6849af5db26a3214e8fc605a6721b53d9537..04e4e9cd52b0063608dc8c912c4bcdafd81b732b 100644 (file)
@@ -3,7 +3,7 @@
 #![feature(const_generics)]
 #![allow(incomplete_features)]
 struct Arr<const N: usize>
-where Assert::<{N < usize::max_value() / 2}>: IsTrue, //~ ERROR constant expression
+where Assert::<{N < usize::MAX / 2}>: IsTrue, //~ ERROR constant expression
 {
 }
 
@@ -14,7 +14,7 @@ trait IsTrue {}
 impl IsTrue for Assert<true> {}
 
 fn main() {
-    let x: Arr<{usize::max_value()}> = Arr {};
+    let x: Arr<{usize::MAX}> = Arr {};
     //~^ ERROR mismatched types
     //~| ERROR mismatched types
 }
index e22612ed5ea63ee9be0a6e2e029d9d03a0a65efa..6a912ffc3c01bd112ca2b1185b88f83a8cc68d01 100644 (file)
@@ -1,25 +1,25 @@
 error: constant expression depends on a generic parameter
-  --> $DIR/issue-73260.rs:6:47
+  --> $DIR/issue-73260.rs:6:39
    |
-LL | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
-   |                                               ^^^^^^
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
+   |                                       ^^^^^^
    |
    = note: this may fail depending on what value the parameter takes
 
 error[E0308]: mismatched types
   --> $DIR/issue-73260.rs:17:12
    |
-LL |     let x: Arr<{usize::max_value()}> = Arr {};
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true`
+LL |     let x: Arr<{usize::MAX}> = Arr {};
+   |            ^^^^^^^^^^^^^^^^^ expected `false`, found `true`
    |
    = note: expected type `false`
               found type `true`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-73260.rs:17:40
+  --> $DIR/issue-73260.rs:17:32
    |
-LL |     let x: Arr<{usize::max_value()}> = Arr {};
-   |                                        ^^^ expected `false`, found `true`
+LL |     let x: Arr<{usize::MAX}> = Arr {};
+   |                                ^^^ expected `false`, found `true`
    |
    = note: expected type `false`
               found type `true`
index bae2cd286e1c929b9f79f1e618c56743f05d601d..13dfe7fac990093b3143be265662b05c4aa0818b 100644 (file)
@@ -1,6 +1,6 @@
 #![deny(const_err)]
 
-pub const A: i8 = -std::i8::MIN; //~ ERROR const_err
+pub const A: i8 = -i8::MIN; //~ ERROR const_err
 pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err
 pub const C: u8 = 200u8 * 4; //~ ERROR const_err
 pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err
index 36b36db7c18bcea5febd2d528c29c837183d222a..ec55139f173457afff11d1be64a337eac9702fc9 100644 (file)
@@ -1,8 +1,8 @@
 error: any use of this value will cause an error
   --> $DIR/const-err-early.rs:3:19
    |
-LL | pub const A: i8 = -std::i8::MIN;
-   | ------------------^^^^^^^^^^^^^-
+LL | pub const A: i8 = -i8::MIN;
+   | ------------------^^^^^^^^-
    |                   |
    |                   attempt to negate `i8::MIN`, which would overflow
    |
index fa3ad832c60e284bf47d6372a05e4e34bf8b3a5d..ce74fae98162d4ff486bab8ff072a57fcf96e310 100644 (file)
@@ -1,6 +1,6 @@
 #![deny(const_err)]
 
-pub const A: i8 = -std::i8::MIN;
+pub const A: i8 = -i8::MIN;
 //~^ ERROR const_err
 pub const B: i8 = A;
 //~^ ERROR const_err
index 5b688d4c6d84c903ec83a100597f34108511e852..b3123b4e359284dd7fd6d621dfadbfe2ebe90eca 100644 (file)
@@ -1,8 +1,8 @@
 error: any use of this value will cause an error
   --> $DIR/const-err-multi.rs:3:19
    |
-LL | pub const A: i8 = -std::i8::MIN;
-   | ------------------^^^^^^^^^^^^^-
+LL | pub const A: i8 = -i8::MIN;
+   | ------------------^^^^^^^^-
    |                   |
    |                   attempt to negate `i8::MIN`, which would overflow
    |
index 2473632cbc804a0e7cc881e4470ddb59e32da507..8b1688c4a898910a3e143ce09a1344d9bf7ec953 100644 (file)
@@ -1,16 +1,16 @@
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:19:13
    |
-LL |     let a = -std::i8::MIN;
-   |             ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
+LL |     let a = -i8::MIN;
+   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
    |
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:21:18
    |
-LL |     let a_i128 = -std::i128::MIN;
-   |                  ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
+LL |     let a_i128 = -i128::MIN;
+   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:23:13
@@ -21,8 +21,8 @@ LL |     let b = 200u8 + 200u8 + 200u8;
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:25:18
    |
-LL |     let b_i128 = std::i128::MIN - std::i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
+LL |     let b_i128 = i128::MIN - i128::MAX;
+   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:27:13
index 2473632cbc804a0e7cc881e4470ddb59e32da507..8b1688c4a898910a3e143ce09a1344d9bf7ec953 100644 (file)
@@ -1,16 +1,16 @@
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:19:13
    |
-LL |     let a = -std::i8::MIN;
-   |             ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
+LL |     let a = -i8::MIN;
+   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
    |
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:21:18
    |
-LL |     let a_i128 = -std::i128::MIN;
-   |                  ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
+LL |     let a_i128 = -i128::MIN;
+   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:23:13
@@ -21,8 +21,8 @@ LL |     let b = 200u8 + 200u8 + 200u8;
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:25:18
    |
-LL |     let b_i128 = std::i128::MIN - std::i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
+LL |     let b_i128 = i128::MIN - i128::MAX;
+   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:27:13
index 2473632cbc804a0e7cc881e4470ddb59e32da507..8b1688c4a898910a3e143ce09a1344d9bf7ec953 100644 (file)
@@ -1,16 +1,16 @@
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:19:13
    |
-LL |     let a = -std::i8::MIN;
-   |             ^^^^^^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
+LL |     let a = -i8::MIN;
+   |             ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
    |
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:21:18
    |
-LL |     let a_i128 = -std::i128::MIN;
-   |                  ^^^^^^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
+LL |     let a_i128 = -i128::MIN;
+   |                  ^^^^^^^^^^ attempt to negate `i128::MIN`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:23:13
@@ -21,8 +21,8 @@ LL |     let b = 200u8 + 200u8 + 200u8;
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:25:18
    |
-LL |     let b_i128 = std::i128::MIN - std::i128::MAX;
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
+LL |     let b_i128 = i128::MIN - i128::MAX;
+   |                  ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i128::MIN - i128::MAX`, which would overflow
 
 error: this arithmetic operation will overflow
   --> $DIR/const-err2.rs:27:13
index 2c6a987180bb1f85c9f6204e73329bf9a6ac28e2..db49ec25aaaeb70ff10d269bd0400355f5ca9aaf 100644 (file)
@@ -16,13 +16,13 @@ fn black_box<T>(_: T) {
 }
 
 fn main() {
-    let a = -std::i8::MIN;
+    let a = -i8::MIN;
     //~^ ERROR arithmetic operation will overflow
-    let a_i128 = -std::i128::MIN;
+    let a_i128 = -i128::MIN;
     //~^ ERROR arithmetic operation will overflow
     let b = 200u8 + 200u8 + 200u8;
     //~^ ERROR arithmetic operation will overflow
-    let b_i128 = std::i128::MIN - std::i128::MAX;
+    let b_i128 = i128::MIN - i128::MAX;
     //~^ ERROR arithmetic operation will overflow
     let c = 200u8 * 4;
     //~^ ERROR arithmetic operation will overflow
index 6fd8e9cbc806b17c872bcc12c77623134faa428a..bcc966dc9621cc04a2170f143c6c09143b206315 100644 (file)
@@ -12,8 +12,6 @@
 #![allow(unused_imports)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const A_I8_I
     : [u32; (i8::MAX as usize) + 1]
index 0ae51786b36a5ac59b37a5c9be689965723038de..73f421b5b1465e2a3ec8c95b8630a41278b79980 100644 (file)
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-eval-overflow-3.rs:20:11
+  --> $DIR/const-eval-overflow-3.rs:18:11
    |
 LL |     = [0; (i8::MAX + 1) as usize];
    |           ^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
index db6f17a671aea5b71db75f41abe6837018d67ef4..480069e67fa28d8fdb5fda90625df61ad30b4789 100644 (file)
@@ -10,8 +10,6 @@
 #![allow(unused_imports)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const A_I8_I
     : [u32; (i8::MAX as usize) + 1]
index 2696d5a0b32bb7c93541e5efd2433054a2239163..2b96b6681928616b66f189054477ee2829aba60e 100644 (file)
@@ -1,11 +1,11 @@
 error[E0308]: mismatched types
-  --> $DIR/const-eval-overflow-3b.rs:18:22
+  --> $DIR/const-eval-overflow-3b.rs:16:22
    |
 LL |     = [0; (i8::MAX + 1u8) as usize];
    |                      ^^^ expected `i8`, found `u8`
 
 error[E0277]: cannot add `u8` to `i8`
-  --> $DIR/const-eval-overflow-3b.rs:18:20
+  --> $DIR/const-eval-overflow-3b.rs:16:20
    |
 LL |     = [0; (i8::MAX + 1u8) as usize];
    |                    ^ no implementation for `i8 + u8`
index 0b12a438f966233ace4dd1e6bc3c76a0642e0f47..762c7a968a8ffd7495d613759ad6bfd3a84059a7 100644 (file)
@@ -6,8 +6,6 @@
 #![allow(unused_imports)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const A_I8_T
     : [u32; (i8::MAX as i8 + 1i8) as usize]
index e548fc266c2125e2ff99024270c81ef44a3e1acf..94f4193195c20280e061940196c222bdfdbd8501 100644 (file)
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-eval-overflow-4.rs:13:13
+  --> $DIR/const-eval-overflow-4.rs:11:13
    |
 LL |     : [u32; (i8::MAX as i8 + 1i8) as usize]
    |             ^^^^^^^^^^^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
index 2a4585faf1493aa176016679646c76d9cc138a21..ce9c980de0dd2cadaa0743dd09222573997647a7 100644 (file)
@@ -5,9 +5,6 @@
 
 #![allow(unused_imports)]
 
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
-
 const A_I8_T
     : [u32; (i8::MAX as i8 + 1u8) as usize]
     //~^ ERROR mismatched types
index e695e9f75feb5261f32e5bc7668b1ec21a5d49b2..1e181c465dba768c3b628cbd50c4b6c613ee9a39 100644 (file)
@@ -1,11 +1,11 @@
 error[E0308]: mismatched types
-  --> $DIR/const-eval-overflow-4b.rs:12:30
+  --> $DIR/const-eval-overflow-4b.rs:9:30
    |
 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    |                              ^^^ expected `i8`, found `u8`
 
 error[E0277]: cannot add `u8` to `i8`
-  --> $DIR/const-eval-overflow-4b.rs:12:28
+  --> $DIR/const-eval-overflow-4b.rs:9:28
    |
 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    |                            ^ no implementation for `i8 + u8`
@@ -13,7 +13,7 @@ LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    = help: the trait `Add<u8>` is not implemented for `i8`
 
 error[E0604]: only `u8` can be cast as `char`, not `i8`
-  --> $DIR/const-eval-overflow-4b.rs:25:13
+  --> $DIR/const-eval-overflow-4b.rs:22:13
    |
 LL |     : [u32; 5i8 as char as usize]
    |             ^^^^^^^^^^^ invalid cast
index a0dbcc88cea8a9da000689a7804cfee57da5159d..57a9dd55c8b55ff6a92f4cc3e2ab4278dfb6a226 100644 (file)
@@ -8,8 +8,6 @@
 #![deny(const_err)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const VALS_I8: (i8,) =
     (
index 51a810b8f3ba83e50d06ed4c729d962cb45c810a..8864bc170f2eec62897f7604799f43cebc8d45df 100644 (file)
@@ -1,5 +1,5 @@
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:16:6
+  --> $DIR/const-eval-overflow2.rs:14:6
    |
 LL | / const VALS_I8: (i8,) =
 LL | |     (
@@ -15,7 +15,7 @@ LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:22:6
+  --> $DIR/const-eval-overflow2.rs:20:6
    |
 LL | / const VALS_I16: (i16,) =
 LL | |     (
@@ -25,7 +25,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:28:6
+  --> $DIR/const-eval-overflow2.rs:26:6
    |
 LL | / const VALS_I32: (i32,) =
 LL | |     (
@@ -35,7 +35,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:34:6
+  --> $DIR/const-eval-overflow2.rs:32:6
    |
 LL | / const VALS_I64: (i64,) =
 LL | |     (
@@ -45,7 +45,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:40:6
+  --> $DIR/const-eval-overflow2.rs:38:6
    |
 LL | / const VALS_U8: (u8,) =
 LL | |     (
@@ -55,7 +55,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:45:6
+  --> $DIR/const-eval-overflow2.rs:43:6
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MIN - 1,
@@ -64,7 +64,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:50:6
+  --> $DIR/const-eval-overflow2.rs:48:6
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MIN - 1,
@@ -73,7 +73,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2.rs:56:6
+  --> $DIR/const-eval-overflow2.rs:54:6
    |
 LL | / const VALS_U64: (u64,) =
 LL | |     (
index da883671a60a3c6cbaebe860ab5da8100d7c8ac7..e87952ab0f438f9e5fc1bab7acf9056952b3691a 100644 (file)
@@ -8,8 +8,6 @@
 #![deny(const_err)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const VALS_I8: (i8,) =
     (
index eec440fcb76a5f7dc200776099aedf6999a58c23..e66e80c8f1937f90312262067305a1fd86dec85b 100644 (file)
@@ -1,5 +1,5 @@
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:16:6
+  --> $DIR/const-eval-overflow2b.rs:14:6
    |
 LL | / const VALS_I8: (i8,) =
 LL | |     (
@@ -15,7 +15,7 @@ LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:22:6
+  --> $DIR/const-eval-overflow2b.rs:20:6
    |
 LL | / const VALS_I16: (i16,) =
 LL | |     (
@@ -25,7 +25,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:28:6
+  --> $DIR/const-eval-overflow2b.rs:26:6
    |
 LL | / const VALS_I32: (i32,) =
 LL | |     (
@@ -35,7 +35,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:34:6
+  --> $DIR/const-eval-overflow2b.rs:32:6
    |
 LL | / const VALS_I64: (i64,) =
 LL | |     (
@@ -45,7 +45,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:40:6
+  --> $DIR/const-eval-overflow2b.rs:38:6
    |
 LL | / const VALS_U8: (u8,) =
 LL | |     (
@@ -55,7 +55,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:45:6
+  --> $DIR/const-eval-overflow2b.rs:43:6
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MAX + 1,
@@ -64,7 +64,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:50:6
+  --> $DIR/const-eval-overflow2b.rs:48:6
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MAX + 1,
@@ -73,7 +73,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2b.rs:56:6
+  --> $DIR/const-eval-overflow2b.rs:54:6
    |
 LL | / const VALS_U64: (u64,) =
 LL | |     (
index e87344405a103f5cf7bfa75ea19edbd8190639f1..84d3dd20a924e6769fab6885c4d9f0bde0b53f6b 100644 (file)
@@ -8,8 +8,6 @@
 #![deny(const_err)]
 
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const VALS_I8: (i8,) =
     (
index e44f94c202166445d19df3fec3ae4f7f1b1a9307..10e308938f3a1e38209e869f263720582e500295 100644 (file)
@@ -1,5 +1,5 @@
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:16:6
+  --> $DIR/const-eval-overflow2c.rs:14:6
    |
 LL | / const VALS_I8: (i8,) =
 LL | |     (
@@ -15,7 +15,7 @@ LL | #![deny(const_err)]
    |         ^^^^^^^^^
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:22:6
+  --> $DIR/const-eval-overflow2c.rs:20:6
    |
 LL | / const VALS_I16: (i16,) =
 LL | |     (
@@ -25,7 +25,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:28:6
+  --> $DIR/const-eval-overflow2c.rs:26:6
    |
 LL | / const VALS_I32: (i32,) =
 LL | |     (
@@ -35,7 +35,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:34:6
+  --> $DIR/const-eval-overflow2c.rs:32:6
    |
 LL | / const VALS_I64: (i64,) =
 LL | |     (
@@ -45,7 +45,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:40:6
+  --> $DIR/const-eval-overflow2c.rs:38:6
    |
 LL | / const VALS_U8: (u8,) =
 LL | |     (
@@ -55,7 +55,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:45:6
+  --> $DIR/const-eval-overflow2c.rs:43:6
    |
 LL | / const VALS_U16: (u16,) = (
 LL | |      u16::MAX * 2,
@@ -64,7 +64,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:50:6
+  --> $DIR/const-eval-overflow2c.rs:48:6
    |
 LL | / const VALS_U32: (u32,) = (
 LL | |      u32::MAX * 2,
@@ -73,7 +73,7 @@ LL | |      );
    | |_______-
 
 error: any use of this value will cause an error
-  --> $DIR/const-eval-overflow2c.rs:56:6
+  --> $DIR/const-eval-overflow2c.rs:54:6
    |
 LL | / const VALS_U64: (u64,) =
 LL | |     (
index 78cf000db03d19ad692bc5af12143c25dc246a35..72e97c03220fc91dd10337d8c26dfef51e843303 100644 (file)
@@ -1,6 +1,6 @@
 #![feature(const_raw_ptr_deref)]
 
-use std::{mem, usize};
+use std::mem;
 
 // Make sure we error with the right kind of error on a too large slice.
 const TEST: () = { unsafe { //~ NOTE
index 9b2e30961aae601efce00c830a0d5038bd0e239d..e0d722ede94e343634725e6b636b81dce58b3010 100644 (file)
@@ -5,8 +5,6 @@
 #![feature(const_overflowing_int_methods)]
 #![feature(const_wrapping_int_methods)]
 
-use std::{i8, i128};
-
 macro_rules! suite {
     ($(
         $fn:ident -> $ty:ty { $( $label:ident : $expr:expr, $result:expr; )* }
index eecb88becabcabc5fd5484f3fd205b80d88689bd..75e77fdf1be1736992a9d8ae58607ceda8558c44 100644 (file)
@@ -16,7 +16,7 @@
 const SHR_B: (u32, bool) = 0x10u32.overflowing_shr(132);
 
 const NEG_A: (u32, bool) = 0u32.overflowing_neg();
-const NEG_B: (u32, bool) = core::u32::MAX.overflowing_neg();
+const NEG_B: (u32, bool) = u32::MAX.overflowing_neg();
 
 const ABS_POS: (i32, bool) = 10i32.overflowing_abs();
 const ABS_NEG: (i32, bool) = (-10i32).overflowing_abs();
index 1c8e27ae6172af598377bd9e534d9d813e8f6907..26c3c0b836bec5ee7f9231dbf3fed495dc1ba262 100644 (file)
@@ -8,19 +8,19 @@ fn main() {
     const I: isize = -2147483648isize;
     #[cfg(target_pointer_width = "64")]
     const I: isize = -9223372036854775808isize;
-    assert_eq!(::std::i32::MIN as u64, 0xffffffff80000000);
+    assert_eq!(i32::MIN as u64, 0xffffffff80000000);
     assert_eq!(-2147483648isize as u64, 0xffffffff80000000);
     assert_eq!(-2147483648i32 as u64, 0xffffffff80000000);
-    assert_eq!(::std::i64::MIN as u64, 0x8000000000000000);
+    assert_eq!(i64::MIN as u64, 0x8000000000000000);
     #[cfg(target_pointer_width = "64")]
     assert_eq!(-9223372036854775808isize as u64, 0x8000000000000000);
     #[cfg(target_pointer_width = "32")]
     assert_eq!(-9223372036854775808isize as u64, 0);
     assert_eq!(-9223372036854775808i32 as u64, 0);
-    const J: usize = ::std::i32::MAX as usize;
+    const J: usize = i32::MAX as usize;
     const K: usize = -1i32 as u32 as usize;
-    const L: usize = ::std::i32::MIN as usize;
-    const M: usize = ::std::i64::MIN as usize;
+    const L: usize = i32::MIN as usize;
+    const M: usize = i64::MIN as usize;
     match 5 {
         J => {},
         K => {},
index 35cbc7003f095183119ed320c2289901efa82ac3..f50e1e51f612f8b55a9a39dccc46c19bccc9cf56 100644 (file)
@@ -1,7 +1,5 @@
 // Regression test for #63952, shouldn't hang.
 
-use std::usize;
-
 #[repr(C)]
 #[derive(Copy, Clone)]
 struct SliceRepr {
index 5e85be45b164711a54c96d36519996e76263d345..503c5706fa24ee70a3276629a7275f75d3ec88c3 100644 (file)
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/issue-63952.rs:18:1
+  --> $DIR/issue-63952.rs:16:1
    |
 LL | / const SLICE_WAY_TOO_LONG: &[u8] = unsafe {
 LL | |     SliceTransmute {
index bdb472f3a9cce025094229341b45ec4a6f69408b..557f6a434f4cd3c7eb022d740c7fba6f4dfdfd2c 100644 (file)
@@ -1,3 +1,4 @@
+#![allow(deprecated, deprecated_in_future)] // can be removed if different fns are chosen
 // build-pass (FIXME(62277): could be check-pass?)
 
 fn main() {
index 5f84030a9e96b4d0f68afaca43b23b5bd353dca2..e6f5c3d27ca994f5d737641669de79036d22279a 100644 (file)
@@ -13,5 +13,5 @@ fn main() {
 
     // make sure that these do not cause trouble despite overflowing
     baz_u32(&(0-1));
-    baz_i32(&-std::i32::MIN);
+    baz_i32(&-i32::MIN);
 }
index 98c90f0ea6828f63526c8465b7683fa90f3161b3..3cf0ea0e6b99768b21e0139acb39f0735fd7c557 100644 (file)
@@ -7,8 +7,6 @@
 
 #![allow(dead_code, unused_variables, unused_imports)]
 
-use std::{i8,u8,i16,u16,i32,u32,i64, u64};
-
 fn f_i8() {
     #[repr(i8)]
     enum A {
index 7b9f086151a847ce8aeabf426e1ab13b5d618844..9a695a8987a37c40b61649c5ac94bc0891923374 100644 (file)
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:17:16
+  --> $DIR/discrim-ill-typed.rs:15:16
    |
 LL |         OhNo = 0_u8,
    |                ^^^^ expected `i8`, found `u8`
@@ -10,7 +10,7 @@ LL |         OhNo = 0_i8,
    |                ^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:30:16
+  --> $DIR/discrim-ill-typed.rs:28:16
    |
 LL |         OhNo = 0_i8,
    |                ^^^^ expected `u8`, found `i8`
@@ -21,7 +21,7 @@ LL |         OhNo = 0_u8,
    |                ^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:43:16
+  --> $DIR/discrim-ill-typed.rs:41:16
    |
 LL |         OhNo = 0_u16,
    |                ^^^^^ expected `i16`, found `u16`
@@ -32,7 +32,7 @@ LL |         OhNo = 0_i16,
    |                ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:56:16
+  --> $DIR/discrim-ill-typed.rs:54:16
    |
 LL |         OhNo = 0_i16,
    |                ^^^^^ expected `u16`, found `i16`
@@ -43,7 +43,7 @@ LL |         OhNo = 0_u16,
    |                ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:69:16
+  --> $DIR/discrim-ill-typed.rs:67:16
    |
 LL |         OhNo = 0_u32,
    |                ^^^^^ expected `i32`, found `u32`
@@ -54,7 +54,7 @@ LL |         OhNo = 0_i32,
    |                ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:82:16
+  --> $DIR/discrim-ill-typed.rs:80:16
    |
 LL |         OhNo = 0_i32,
    |                ^^^^^ expected `u32`, found `i32`
@@ -65,7 +65,7 @@ LL |         OhNo = 0_u32,
    |                ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:95:16
+  --> $DIR/discrim-ill-typed.rs:93:16
    |
 LL |         OhNo = 0_u64,
    |                ^^^^^ expected `i64`, found `u64`
@@ -76,7 +76,7 @@ LL |         OhNo = 0_i64,
    |                ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/discrim-ill-typed.rs:108:16
+  --> $DIR/discrim-ill-typed.rs:106:16
    |
 LL |         OhNo = 0_i64,
    |                ^^^^^ expected `u64`, found `i64`
index f8f565f4d9c14be524db2eb7fc8217ce26ad0979..ca24317c54dc216de5936d19eca39b61450103b5 100644 (file)
@@ -5,8 +5,6 @@
 // See also run-pass/discrim-explicit-23030.rs where the suggested
 // workaround is tested.
 
-use std::{i8,u8,i16,u16,i32,u32,i64, u64};
-
 fn f_i8() {
     #[repr(i8)]
     enum A {
index 198ebe9eb51f9383c264e600c1d8c5bf1f02a5c7..3ca84c66753575dc9c609c60490cf23529381a00 100644 (file)
@@ -1,5 +1,5 @@
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:15:9
+  --> $DIR/discrim-overflow-2.rs:13:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 127
@@ -7,7 +7,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -128` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:24:9
+  --> $DIR/discrim-overflow-2.rs:22:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 255
@@ -15,7 +15,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:33:9
+  --> $DIR/discrim-overflow-2.rs:31:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 32767
@@ -23,7 +23,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -32768` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:42:9
+  --> $DIR/discrim-overflow-2.rs:40:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 65535
@@ -31,7 +31,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:51:9
+  --> $DIR/discrim-overflow-2.rs:49:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 2147483647
@@ -39,7 +39,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -2147483648` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:60:9
+  --> $DIR/discrim-overflow-2.rs:58:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 4294967295
@@ -47,7 +47,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:69:9
+  --> $DIR/discrim-overflow-2.rs:67:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 9223372036854775807
@@ -55,7 +55,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow-2.rs:78:9
+  --> $DIR/discrim-overflow-2.rs:76:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 18446744073709551615
index d8a9dacfa5180e0fb0b7990549153f11063bfc0f..774ced93c17238fe634eb7f0e6bfec8264239967 100644 (file)
@@ -3,8 +3,6 @@
 // See also run-pass/discrim-explicit-23030.rs where the suggested
 // workaround is tested.
 
-use std::{i8,u8,i16,u16,i32,u32,i64, u64};
-
 fn f_i8() {
     #[repr(i8)]
     enum A {
index a2ae4863f9f79abe6e3c8ed35b077d7ab46b4c8b..1b331bb1b8d98301a54f5d5e67d65deb4292e346 100644 (file)
@@ -1,5 +1,5 @@
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:13:9
+  --> $DIR/discrim-overflow.rs:11:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 127
@@ -7,7 +7,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -128` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:24:9
+  --> $DIR/discrim-overflow.rs:22:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 255
@@ -15,7 +15,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:35:9
+  --> $DIR/discrim-overflow.rs:33:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 32767
@@ -23,7 +23,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -32768` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:46:9
+  --> $DIR/discrim-overflow.rs:44:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 65535
@@ -31,7 +31,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:58:9
+  --> $DIR/discrim-overflow.rs:56:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 2147483647
@@ -39,7 +39,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -2147483648` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:70:9
+  --> $DIR/discrim-overflow.rs:68:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 4294967295
@@ -47,7 +47,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:82:9
+  --> $DIR/discrim-overflow.rs:80:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 9223372036854775807
@@ -55,7 +55,7 @@ LL |         OhNo,
    = note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discrim-overflow.rs:94:9
+  --> $DIR/discrim-overflow.rs:92:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 18446744073709551615
index b027faa9d7c3a2ba3f8f684252af589f9cd6bcb3..c4f7c3786168b437a732b0c50a4f076486c74d22 100644 (file)
@@ -18,7 +18,6 @@
     ptr,
     rc::Rc,
     task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
-    usize,
 };
 
 struct InjectedFailure;
index 6d0cd101dbc809a47b98d845f9419b9d81a8fbcb..88f557055f371e98cc193eee2147bf3ca98d3578 100644 (file)
@@ -12,7 +12,6 @@
 use std::ops::Generator;
 use std::panic;
 use std::pin::Pin;
-use std::usize;
 
 struct InjectedFailure;
 
index d42fbf22938c0503f3dd859f84d10cbb41dca0f7..4c77180b767a3c166ea49ae58ec84bbf6bb1f35a 100644 (file)
@@ -1,5 +1,3 @@
-use std::{isize, usize};
-
 fn main() {
     match 0usize {
         //~^ ERROR non-exhaustive patterns: `_` not covered
index da308c292dfab954c0cd045885a5128a64f67eb0..9895646fc2ba477d8aa3c7d530acf78a79c46731 100644 (file)
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/feature-gate-precise_pointer_size_matching.rs:4:11
+  --> $DIR/feature-gate-precise_pointer_size_matching.rs:2:11
    |
 LL |     match 0usize {
    |           ^^^^^^ pattern `_` not covered
@@ -10,7 +10,7 @@ LL |     match 0usize {
    = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
 
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/feature-gate-precise_pointer_size_matching.rs:12:11
+  --> $DIR/feature-gate-precise_pointer_size_matching.rs:10:11
    |
 LL |     match 0isize {
    |           ^^^^^^ pattern `_` not covered
index b135891d0b82f09f5820bd28c8c3339e68b93673..be225359bffabd5a6b2cad11c8b049439064439a 100644 (file)
@@ -13,8 +13,8 @@ macro_rules! m {
 }
 
 fn floats() {
-    m!(0f32, core::f32::NEG_INFINITY..); //~ ERROR non-exhaustive patterns: `_` not covered
-    m!(0f32, ..core::f32::INFINITY); //~ ERROR non-exhaustive patterns: `_` not covered
+    m!(0f32, f32::NEG_INFINITY..); //~ ERROR non-exhaustive patterns: `_` not covered
+    m!(0f32, ..f32::INFINITY); //~ ERROR non-exhaustive patterns: `_` not covered
 }
 
 fn khar() {
@@ -33,12 +33,12 @@ fn khar() {
 
 mod unsigned {
     fn u8() {
-        const ALMOST_MAX: u8 = core::u8::MAX - 1;
-        const ALMOST_MIN: u8 = core::u8::MIN + 1;
+        const ALMOST_MAX: u8 = u8::MAX - 1;
+        const ALMOST_MIN: u8 = u8::MIN + 1;
         const VAL: u8 = 42;
         const VAL_1: u8 = VAL + 1;
         const VAL_2: u8 = VAL + 2;
-        m!(0, ..core::u8::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..u8::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -46,12 +46,12 @@ fn u8() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn u16() {
-        const ALMOST_MAX: u16 = core::u16::MAX - 1;
-        const ALMOST_MIN: u16 = core::u16::MIN + 1;
+        const ALMOST_MAX: u16 = u16::MAX - 1;
+        const ALMOST_MIN: u16 = u16::MIN + 1;
         const VAL: u16 = 42;
         const VAL_1: u16 = VAL + 1;
         const VAL_2: u16 = VAL + 2;
-        m!(0, ..core::u16::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..u16::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -59,12 +59,12 @@ fn u16() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn u32() {
-        const ALMOST_MAX: u32 = core::u32::MAX - 1;
-        const ALMOST_MIN: u32 = core::u32::MIN + 1;
+        const ALMOST_MAX: u32 = u32::MAX - 1;
+        const ALMOST_MIN: u32 = u32::MIN + 1;
         const VAL: u32 = 42;
         const VAL_1: u32 = VAL + 1;
         const VAL_2: u32 = VAL + 2;
-        m!(0, ..core::u32::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..u32::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -72,12 +72,12 @@ fn u32() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn u64() {
-        const ALMOST_MAX: u64 = core::u64::MAX - 1;
-        const ALMOST_MIN: u64 = core::u64::MIN + 1;
+        const ALMOST_MAX: u64 = u64::MAX - 1;
+        const ALMOST_MIN: u64 = u64::MIN + 1;
         const VAL: u64 = 42;
         const VAL_1: u64 = VAL + 1;
         const VAL_2: u64 = VAL + 2;
-        m!(0, ..core::u64::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..u64::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -85,12 +85,12 @@ fn u64() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn u128() {
-        const ALMOST_MAX: u128 = core::u128::MAX - 1;
-        const ALMOST_MIN: u128 = core::u128::MIN + 1;
+        const ALMOST_MAX: u128 = u128::MAX - 1;
+        const ALMOST_MIN: u128 = u128::MIN + 1;
         const VAL: u128 = 42;
         const VAL_1: u128 = VAL + 1;
         const VAL_2: u128 = VAL + 2;
-        m!(0, ..core::u128::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..u128::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -101,12 +101,12 @@ fn u128() {
 
 mod signed {
     fn i8() {
-        const ALMOST_MAX: i8 = core::i8::MAX - 1;
-        const ALMOST_MIN: i8 = core::i8::MIN + 1;
+        const ALMOST_MAX: i8 = i8::MAX - 1;
+        const ALMOST_MIN: i8 = i8::MIN + 1;
         const VAL: i8 = 42;
         const VAL_1: i8 = VAL + 1;
         const VAL_2: i8 = VAL + 2;
-        m!(0, ..core::i8::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..i8::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -114,12 +114,12 @@ fn i8() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn i16() {
-        const ALMOST_MAX: i16 = core::i16::MAX - 1;
-        const ALMOST_MIN: i16 = core::i16::MIN + 1;
+        const ALMOST_MAX: i16 = i16::MAX - 1;
+        const ALMOST_MIN: i16 = i16::MIN + 1;
         const VAL: i16 = 42;
         const VAL_1: i16 = VAL + 1;
         const VAL_2: i16 = VAL + 2;
-        m!(0, ..core::i16::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..i16::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -127,12 +127,12 @@ fn i16() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn i32() {
-        const ALMOST_MAX: i32 = core::i32::MAX - 1;
-        const ALMOST_MIN: i32 = core::i32::MIN + 1;
+        const ALMOST_MAX: i32 = i32::MAX - 1;
+        const ALMOST_MIN: i32 = i32::MIN + 1;
         const VAL: i32 = 42;
         const VAL_1: i32 = VAL + 1;
         const VAL_2: i32 = VAL + 2;
-        m!(0, ..core::i32::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..i32::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -140,12 +140,12 @@ fn i32() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn i64() {
-        const ALMOST_MAX: i64 = core::i64::MAX - 1;
-        const ALMOST_MIN: i64 = core::i64::MIN + 1;
+        const ALMOST_MAX: i64 = i64::MAX - 1;
+        const ALMOST_MIN: i64 = i64::MIN + 1;
         const VAL: i64 = 42;
         const VAL_1: i64 = VAL + 1;
         const VAL_2: i64 = VAL + 2;
-        m!(0, ..core::i64::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..i64::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
@@ -153,12 +153,12 @@ fn i64() {
         m!(0, ..VAL_1 | VAL_2..); //~ ERROR non-exhaustive patterns
     }
     fn i128() {
-        const ALMOST_MAX: i128 = core::i128::MAX - 1;
-        const ALMOST_MIN: i128 = core::i128::MIN + 1;
+        const ALMOST_MAX: i128 = i128::MAX - 1;
+        const ALMOST_MIN: i128 = i128::MIN + 1;
         const VAL: i128 = 42;
         const VAL_1: i128 = VAL + 1;
         const VAL_2: i128 = VAL + 2;
-        m!(0, ..core::i128::MAX); //~ ERROR non-exhaustive patterns
+        m!(0, ..i128::MAX); //~ ERROR non-exhaustive patterns
         m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
         m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
         m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
index 5744232235dd151e8c777702759a2fa3c56ef5f4..14dbca60b78f238d8202519ccd52e8d825a0fca8 100644 (file)
@@ -1,7 +1,7 @@
 error[E0004]: non-exhaustive patterns: `_` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:16:8
    |
-LL |     m!(0f32, core::f32::NEG_INFINITY..);
+LL |     m!(0f32, f32::NEG_INFINITY..);
    |        ^^^^ pattern `_` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -10,7 +10,7 @@ LL |     m!(0f32, core::f32::NEG_INFINITY..);
 error[E0004]: non-exhaustive patterns: `_` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:17:8
    |
-LL |     m!(0f32, ..core::f32::INFINITY);
+LL |     m!(0f32, ..f32::INFINITY);
    |        ^^^^ pattern `_` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -73,7 +73,7 @@ LL |     m!('a', ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
    |
-LL |         m!(0, ..core::u8::MAX);
+LL |         m!(0, ..u8::MAX);
    |            ^ pattern `u8::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -127,7 +127,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
    |
-LL |         m!(0, ..core::u16::MAX);
+LL |         m!(0, ..u16::MAX);
    |            ^ pattern `u16::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -181,7 +181,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
    |
-LL |         m!(0, ..core::u32::MAX);
+LL |         m!(0, ..u32::MAX);
    |            ^ pattern `u32::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -235,7 +235,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
    |
-LL |         m!(0, ..core::u64::MAX);
+LL |         m!(0, ..u64::MAX);
    |            ^ pattern `u64::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -289,7 +289,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
    |
-LL |         m!(0, ..core::u128::MAX);
+LL |         m!(0, ..u128::MAX);
    |            ^ pattern `u128::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -343,7 +343,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
    |
-LL |         m!(0, ..core::i8::MAX);
+LL |         m!(0, ..i8::MAX);
    |            ^ pattern `i8::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -397,7 +397,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
    |
-LL |         m!(0, ..core::i16::MAX);
+LL |         m!(0, ..i16::MAX);
    |            ^ pattern `i16::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -451,7 +451,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
    |
-LL |         m!(0, ..core::i32::MAX);
+LL |         m!(0, ..i32::MAX);
    |            ^ pattern `i32::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -505,7 +505,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
    |
-LL |         m!(0, ..core::i64::MAX);
+LL |         m!(0, ..i64::MAX);
    |            ^ pattern `i64::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
@@ -559,7 +559,7 @@ LL |         m!(0, ..VAL_1 | VAL_2..);
 error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
   --> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
    |
-LL |         m!(0, ..core::i128::MAX);
+LL |         m!(0, ..i128::MAX);
    |            ^ pattern `i128::MAX` not covered
    |
    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
index efac0df2a430d7ededa0e37862bdaf9619db0df1..d3a59e4dffcd620f9b045c49865b4157ba4b7a74 100644 (file)
@@ -26,19 +26,19 @@ macro_rules! test_int {
 }
 
 fn unsigned_int() {
-    test_int!(0u8, core::u8::MIN, core::u8::MAX);
-    test_int!(0u16, core::u16::MIN, core::u16::MAX);
-    test_int!(0u32, core::u32::MIN, core::u32::MAX);
-    test_int!(0u64, core::u64::MIN, core::u64::MAX);
-    test_int!(0u128, core::u128::MIN, core::u128::MAX);
+    test_int!(0u8, u8::MIN, u8::MAX);
+    test_int!(0u16, u16::MIN, u16::MAX);
+    test_int!(0u32, u32::MIN, u32::MAX);
+    test_int!(0u64, u64::MIN, u64::MAX);
+    test_int!(0u128, u128::MIN, u128::MAX);
 }
 
 fn signed_int() {
-    test_int!(0i8, core::i8::MIN, core::i8::MAX);
-    test_int!(0i16, core::i16::MIN, core::i16::MAX);
-    test_int!(0i32, core::i32::MIN, core::i32::MAX);
-    test_int!(0i64, core::i64::MIN, core::i64::MAX);
-    test_int!(0i128, core::i128::MIN, core::i128::MAX);
+    test_int!(0i8, i8::MIN, i8::MAX);
+    test_int!(0i16, i16::MIN, i16::MAX);
+    test_int!(0i32, i32::MIN, i32::MAX);
+    test_int!(0i64, i64::MIN, i64::MAX);
+    test_int!(0i128, i128::MIN, i128::MAX);
 }
 
 fn khar() {
index 416c59af3fd3e58ba13dacc37df80bd88f3e1350..ae532d935df82e00e19bc0fe9717e0201fcca640 100644 (file)
@@ -24,15 +24,15 @@ fn range_to_inclusive() {
     //---------------------------------------
 
     // u8; `..=X`
-    assert!(yes!(core::u8::MIN, ..=core::u8::MIN));
-    assert!(yes!(core::u8::MIN, ..=5));
+    assert!(yes!(u8::MIN, ..=u8::MIN));
+    assert!(yes!(u8::MIN, ..=5));
     assert!(yes!(5u8, ..=5));
     assert!(!yes!(6u8, ..=5));
 
     // i16; `..=X`
-    assert!(yes!(core::i16::MIN, ..=core::i16::MIN));
-    assert!(yes!(core::i16::MIN, ..=0));
-    assert!(yes!(core::i16::MIN, ..=-5));
+    assert!(yes!(i16::MIN, ..=i16::MIN));
+    assert!(yes!(i16::MIN, ..=0));
+    assert!(yes!(i16::MIN, ..=-5));
     assert!(yes!(-5, ..=-5));
     assert!(!yes!(-4, ..=-5));
 
@@ -43,14 +43,14 @@ fn range_to_inclusive() {
     assert!(!yes!('b', ..='a'));
 
     // f32; `..=X`
-    assert!(yes!(core::f32::NEG_INFINITY, ..=core::f32::NEG_INFINITY));
-    assert!(yes!(core::f32::NEG_INFINITY, ..=1.0f32));
+    assert!(yes!(f32::NEG_INFINITY, ..=f32::NEG_INFINITY));
+    assert!(yes!(f32::NEG_INFINITY, ..=1.0f32));
     assert!(yes!(1.5f32, ..=1.5f32));
     assert!(!yes!(1.6f32, ..=-1.5f32));
 
     // f64; `..=X`
-    assert!(yes!(core::f64::NEG_INFINITY, ..=core::f64::NEG_INFINITY));
-    assert!(yes!(core::f64::NEG_INFINITY, ..=1.0f64));
+    assert!(yes!(f64::NEG_INFINITY, ..=f64::NEG_INFINITY));
+    assert!(yes!(f64::NEG_INFINITY, ..=1.0f64));
     assert!(yes!(1.5f64, ..=1.5f64));
     assert!(!yes!(1.6f64, ..=-1.5f64));
 }
@@ -66,16 +66,16 @@ fn range_to() {
     assert!(!yes!(6u8, ..5));
 
     // u8; `..X`
-    const NU8: u8 = core::u8::MIN + 1;
-    assert!(yes!(core::u8::MIN, ..NU8));
+    const NU8: u8 = u8::MIN + 1;
+    assert!(yes!(u8::MIN, ..NU8));
     assert!(yes!(0u8, ..5));
     assert!(!yes!(5u8, ..5));
     assert!(!yes!(6u8, ..5));
 
     // i16; `..X`
-    const NI16: i16 = core::i16::MIN + 1;
-    assert!(yes!(core::i16::MIN, ..NI16));
-    assert!(yes!(core::i16::MIN, ..5));
+    const NI16: i16 = i16::MIN + 1;
+    assert!(yes!(i16::MIN, ..NI16));
+    assert!(yes!(i16::MIN, ..5));
     assert!(yes!(-6, ..-5));
     assert!(!yes!(-5, ..-5));
 
@@ -87,16 +87,16 @@ fn range_to() {
     assert!(!yes!('b', ..'a'));
 
     // f32; `..X`
-    assert!(yes!(core::f32::NEG_INFINITY, ..1.0f32));
+    assert!(yes!(f32::NEG_INFINITY, ..1.0f32));
     assert!(!yes!(1.5f32, ..1.5f32));
-    const E32: f32 = 1.5f32 + core::f32::EPSILON;
+    const E32: f32 = 1.5f32 + f32::EPSILON;
     assert!(yes!(1.5f32, ..E32));
     assert!(!yes!(1.6f32, ..1.5f32));
 
     // f64; `..X`
-    assert!(yes!(core::f64::NEG_INFINITY, ..1.0f64));
+    assert!(yes!(f64::NEG_INFINITY, ..1.0f64));
     assert!(!yes!(1.5f64, ..1.5f64));
-    const E64: f64 = 1.5f64 + core::f64::EPSILON;
+    const E64: f64 = 1.5f64 + f64::EPSILON;
     assert!(yes!(1.5f64, ..E64));
     assert!(!yes!(1.6f64, ..1.5f64));
 }
@@ -106,23 +106,23 @@ fn range_from() {
     //--------------------------------
 
     // u8; `X..`
-    assert!(yes!(core::u8::MIN, core::u8::MIN..));
-    assert!(yes!(core::u8::MAX, core::u8::MIN..));
-    assert!(!yes!(core::u8::MIN, 1..));
+    assert!(yes!(u8::MIN, u8::MIN..));
+    assert!(yes!(u8::MAX, u8::MIN..));
+    assert!(!yes!(u8::MIN, 1..));
     assert!(!yes!(4, 5..));
     assert!(yes!(5, 5..));
     assert!(yes!(6, 5..));
-    assert!(yes!(core::u8::MAX, core::u8::MAX..));
+    assert!(yes!(u8::MAX, u8::MAX..));
 
     // i16; `X..`
-    assert!(yes!(core::i16::MIN, core::i16::MIN..));
-    assert!(yes!(core::i16::MAX, core::i16::MIN..));
-    const NI16: i16 = core::i16::MIN + 1;
-    assert!(!yes!(core::i16::MIN, NI16..));
+    assert!(yes!(i16::MIN, i16::MIN..));
+    assert!(yes!(i16::MAX, i16::MIN..));
+    const NI16: i16 = i16::MIN + 1;
+    assert!(!yes!(i16::MIN, NI16..));
     assert!(!yes!(-4, 5..));
     assert!(yes!(-4, -4..));
     assert!(yes!(-3, -4..));
-    assert!(yes!(core::i16::MAX, core::i16::MAX..));
+    assert!(yes!(i16::MAX, i16::MAX..));
 
     // char; `X..`
     assert!(yes!('\u{0}', '\u{0}'..));
@@ -133,24 +133,24 @@ fn range_from() {
     assert!(yes!(core::char::MAX, core::char::MAX..));
 
     // f32; `X..`
-    assert!(yes!(core::f32::NEG_INFINITY, core::f32::NEG_INFINITY..));
-    assert!(yes!(core::f32::INFINITY, core::f32::NEG_INFINITY..));
-    assert!(!yes!(core::f32::NEG_INFINITY, 1.0f32..));
-    assert!(yes!(core::f32::INFINITY, 1.0f32..));
-    assert!(!yes!(1.0f32 - core::f32::EPSILON, 1.0f32..));
+    assert!(yes!(f32::NEG_INFINITY, f32::NEG_INFINITY..));
+    assert!(yes!(f32::INFINITY, f32::NEG_INFINITY..));
+    assert!(!yes!(f32::NEG_INFINITY, 1.0f32..));
+    assert!(yes!(f32::INFINITY, 1.0f32..));
+    assert!(!yes!(1.0f32 - f32::EPSILON, 1.0f32..));
     assert!(yes!(1.0f32, 1.0f32..));
-    assert!(yes!(core::f32::INFINITY, 1.0f32..));
-    assert!(yes!(core::f32::INFINITY, core::f32::INFINITY..));
+    assert!(yes!(f32::INFINITY, 1.0f32..));
+    assert!(yes!(f32::INFINITY, f32::INFINITY..));
 
     // f64; `X..`
-    assert!(yes!(core::f64::NEG_INFINITY, core::f64::NEG_INFINITY..));
-    assert!(yes!(core::f64::INFINITY, core::f64::NEG_INFINITY..));
-    assert!(!yes!(core::f64::NEG_INFINITY, 1.0f64..));
-    assert!(yes!(core::f64::INFINITY, 1.0f64..));
-    assert!(!yes!(1.0f64 - core::f64::EPSILON, 1.0f64..));
+    assert!(yes!(f64::NEG_INFINITY, f64::NEG_INFINITY..));
+    assert!(yes!(f64::INFINITY, f64::NEG_INFINITY..));
+    assert!(!yes!(f64::NEG_INFINITY, 1.0f64..));
+    assert!(yes!(f64::INFINITY, 1.0f64..));
+    assert!(!yes!(1.0f64 - f64::EPSILON, 1.0f64..));
     assert!(yes!(1.0f64, 1.0f64..));
-    assert!(yes!(core::f64::INFINITY, 1.0f64..));
-    assert!(yes!(core::f64::INFINITY, core::f64::INFINITY..));
+    assert!(yes!(f64::INFINITY, 1.0f64..));
+    assert!(yes!(f64::INFINITY, f64::INFINITY..));
 }
 
 fn main() {
index 904efda903c693ce5ab5faba16776798b2379cb0..2c8e554b229c86181ffa63fa91ce7f1bda0d36f4 100644 (file)
@@ -9,42 +9,42 @@ macro_rules! m {
 }
 
 fn main() {
-    m!(0, ..core::u8::MIN);
+    m!(0, ..u8::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::u16::MIN);
+    m!(0, ..u16::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::u32::MIN);
+    m!(0, ..u32::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::u64::MIN);
+    m!(0, ..u64::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::u128::MIN);
+    m!(0, ..u128::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
 
-    m!(0, ..core::i8::MIN);
+    m!(0, ..i8::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::i16::MIN);
+    m!(0, ..i16::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::i32::MIN);
+    m!(0, ..i32::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::i64::MIN);
+    m!(0, ..i64::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0, ..core::i128::MIN);
+    m!(0, ..i128::MIN);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
 
-    m!(0f32, ..core::f32::NEG_INFINITY);
+    m!(0f32, ..f32::NEG_INFINITY);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
-    m!(0f64, ..core::f64::NEG_INFINITY);
+    m!(0f64, ..f64::NEG_INFINITY);
     //~^ ERROR lower range bound must be less than upper
     //~| ERROR lower range bound must be less than upper
 
index 12ad86429613b52de1867dc13ce1e634b04f9f08..4931ddfac71c90c273e527ad570c0e2c4844ac24 100644 (file)
@@ -1,74 +1,74 @@
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
    |
-LL |     m!(0, ..core::u8::MIN);
-   |           ^^^^^^^^^^^^^^^
+LL |     m!(0, ..u8::MIN);
+   |           ^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:15:11
    |
-LL |     m!(0, ..core::u16::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u16::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:18:11
    |
-LL |     m!(0, ..core::u32::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u32::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
    |
-LL |     m!(0, ..core::u64::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u64::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:24:11
    |
-LL |     m!(0, ..core::u128::MIN);
-   |           ^^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u128::MIN);
+   |           ^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:28:11
    |
-LL |     m!(0, ..core::i8::MIN);
-   |           ^^^^^^^^^^^^^^^
+LL |     m!(0, ..i8::MIN);
+   |           ^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:31:11
    |
-LL |     m!(0, ..core::i16::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i16::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:34:11
    |
-LL |     m!(0, ..core::i32::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i32::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:37:11
    |
-LL |     m!(0, ..core::i64::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i64::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:40:11
    |
-LL |     m!(0, ..core::i128::MIN);
-   |           ^^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i128::MIN);
+   |           ^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:44:14
    |
-LL |     m!(0f32, ..core::f32::NEG_INFINITY);
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     m!(0f32, ..f32::NEG_INFINITY);
+   |              ^^^^^^^^^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:47:14
    |
-LL |     m!(0f64, ..core::f64::NEG_INFINITY);
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     m!(0f64, ..f64::NEG_INFINITY);
+   |              ^^^^^^^^^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:51:13
@@ -79,74 +79,74 @@ LL |     m!('a', ..'\u{0}');
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
    |
-LL |     m!(0, ..core::u8::MIN);
-   |           ^^^^^^^^^^^^^^^
+LL |     m!(0, ..u8::MIN);
+   |           ^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:15:11
    |
-LL |     m!(0, ..core::u16::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u16::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:18:11
    |
-LL |     m!(0, ..core::u32::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u32::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:21:11
    |
-LL |     m!(0, ..core::u64::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u64::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:24:11
    |
-LL |     m!(0, ..core::u128::MIN);
-   |           ^^^^^^^^^^^^^^^^^
+LL |     m!(0, ..u128::MIN);
+   |           ^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:28:11
    |
-LL |     m!(0, ..core::i8::MIN);
-   |           ^^^^^^^^^^^^^^^
+LL |     m!(0, ..i8::MIN);
+   |           ^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:31:11
    |
-LL |     m!(0, ..core::i16::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i16::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:34:11
    |
-LL |     m!(0, ..core::i32::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i32::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:37:11
    |
-LL |     m!(0, ..core::i64::MIN);
-   |           ^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i64::MIN);
+   |           ^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:40:11
    |
-LL |     m!(0, ..core::i128::MIN);
-   |           ^^^^^^^^^^^^^^^^^
+LL |     m!(0, ..i128::MIN);
+   |           ^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:44:14
    |
-LL |     m!(0f32, ..core::f32::NEG_INFINITY);
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     m!(0f32, ..f32::NEG_INFINITY);
+   |              ^^^^^^^^^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:47:14
    |
-LL |     m!(0f64, ..core::f64::NEG_INFINITY);
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     m!(0f64, ..f64::NEG_INFINITY);
+   |              ^^^^^^^^^^^^^^^^^^^
 
 error[E0579]: lower range bound must be less than upper
   --> $DIR/half-open-range-pats-thir-lower-empty.rs:51:13
index 5f88683f4adfcbdb242e705d5fb007c251c6b859..2988af06556d9bfabe676ba4e54edf314f255271 100644 (file)
@@ -3,7 +3,6 @@
 // ignore-emscripten no processes
 
 use std::collections::hash_map::HashMap;
-use std::usize;
 use std::mem::size_of;
 
 fn main() {
index fa2ea6cf592af6bcdb85f456daa86d477776f6e3..41922c6229351446d772870c9fad3d381feeef20 100644 (file)
@@ -4,6 +4,7 @@
 #![allow(unused_imports)]
 #![allow(non_upper_case_globals)]
 #![allow(non_camel_case_types)]
+#![allow(deprecated, deprecated_in_future)]
 
 // aux-build:i8.rs
 // ignore-pretty issue #37201
index 77dc5c50d7aba17557bf9783c2e43cba8338b613..d4128fa54e3daf2059e1cebaffc8465a753243c9 100644 (file)
@@ -1,8 +1,6 @@
 // run-pass
 #![allow(unused_imports)]
 use std::fmt;
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
 
 const A_I8_T
     : [u32; (i8::MAX as i8 - 1i8) as usize]
index 8c3762514494ac3ca5fa3d546186d28959f0eabb..ba58e9e9d897663ef44e8a8a70eb4f36ff97f471 100644 (file)
@@ -1,7 +1,7 @@
 // run-pass
 fn main() {
     match (0, 0) {
-        (std::usize::MIN, std::usize::MAX) => {}
+        (usize::MIN, usize::MAX) => {}
         _ => {}
     }
 }
index 10cde21abd7660db8e95f0b8de36815084ab6aaf..977c43b71fb713f8d2dd6c819e45e4242b9ee6ab 100644 (file)
@@ -19,7 +19,7 @@ fn next(&mut self) -> Option<Self::Item> {
         Some(self.state.clone())
     }
     #[inline]
-    fn size_hint(&self) -> (usize, Option<usize>) { (std::usize::MAX, None) }
+    fn size_hint(&self) -> (usize, Option<usize>) { (usize::MAX, None) }
 }
 
 fn main() {
index 3a862ace55eccdf71da59d61ef7fd6307f275fcc..cfef270e5a67c9643c39371c3d751afb60d5dfa1 100644 (file)
@@ -6,10 +6,10 @@
 
 #[cfg(target_pointer_width = "16")]
 fn main() {
-    assert!(Step::steps_between(&0u32, &::std::u32::MAX).is_none());
+    assert!(Step::steps_between(&0u32, &u32::MAX).is_none());
 }
 
 #[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))]
 fn main() {
-    assert!(Step::steps_between(&0u32, &::std::u32::MAX).is_some());
+    assert!(Step::steps_between(&0u32, &u32::MAX).is_some());
 }
index 63d87e03c4899054c6bb1998300288b7c0b44693..683c856049fdca09ee6df51305e9824c8f689818 100644 (file)
@@ -3,7 +3,6 @@
 
 extern crate test;
 
-use std::f64::{NAN, NEG_INFINITY, INFINITY, MAX};
 use std::mem::size_of;
 use test::black_box;
 
@@ -12,7 +11,7 @@
 macro_rules! compare {
     ($op:tt) => {
         compare!(
-            [NEG_INFINITY, -MAX, -1.0, -0.0, 0.0, 1.0, MAX, INFINITY, NAN],
+            [f64::NEG_INFINITY, -f64::MAX, -1.0, -0.0, 0.0, 1.0, f64::MAX, f64::INFINITY, f64::NAN],
             $op
         );
     };
@@ -20,7 +19,7 @@ macro_rules! compare {
         $(compare!(
             $lhs,
             $op,
-            [NEG_INFINITY, -MAX, -1.0, -0.0, 0.0, 1.0, MAX, INFINITY, NAN]
+            [f64::NEG_INFINITY, -f64::MAX, -1.0, -0.0, 0.0, 1.0, f64::MAX, f64::INFINITY, f64::NAN]
         );)+
     };
     ($lhs:expr, $op:tt, [$($rhs:expr),+]) => {
@@ -44,8 +43,8 @@ fn check() {
 fn main() {
     assert_eq!(0.0/0.0 < 0.0/0.0, false);
     assert_eq!(0.0/0.0 > 0.0/0.0, false);
-    assert_eq!(NAN < NAN, false);
-    assert_eq!(NAN > NAN, false);
+    assert_eq!(f64::NAN < f64::NAN, false);
+    assert_eq!(f64::NAN > f64::NAN, false);
 
     compare!(==);
     compare!(!=);
index 4f1bd45e90a19c25f7b31b8a9167e97c15eaed05..3277df69c028521e1dd3d0025db6a653c0993ab9 100644 (file)
@@ -1,5 +1,5 @@
 // build-pass
 
 fn main() {
-    println!("{}", [(); std::usize::MAX].len());
+    println!("{}", [(); usize::MAX].len());
 }
index 325137327b26926492c0e2e9d6cc8e7e6c2ec0e3..6d950c424e38178b605ffe099c35f453d7950482 100644 (file)
@@ -3,7 +3,7 @@
 #![allow(unused)]
 #![deny(illegal_floating_point_literal_pattern)]
 
-use std::f64::NAN;
+const NAN: f64 = f64::NAN;
 
 fn main() {
     let x = NAN;
index 739b5468743b22dda6a54495c896a1975f9ce5cb..d94c7742de301d397257de5e00eda4f5219e5142 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:14:36
+  --> $DIR/issue-8460-const.rs:13:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,37 +7,37 @@ LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:16:36
+  --> $DIR/issue-8460-const.rs:15:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:18:36
+  --> $DIR/issue-8460-const.rs:17:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:20:36
+  --> $DIR/issue-8460-const.rs:19:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:22:36
+  --> $DIR/issue-8460-const.rs:21:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:24:36
+  --> $DIR/issue-8460-const.rs:23:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:26:36
+  --> $DIR/issue-8460-const.rs:25:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to divide `1_isize` by zero
@@ -45,103 +45,103 @@ LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:28:36
+  --> $DIR/issue-8460-const.rs:27:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to divide `1_i8` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:30:36
+  --> $DIR/issue-8460-const.rs:29:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i16` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:32:36
+  --> $DIR/issue-8460-const.rs:31:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:34:36
+  --> $DIR/issue-8460-const.rs:33:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i64` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:36:36
+  --> $DIR/issue-8460-const.rs:35:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to divide `1_i128` by zero
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:38:36
+  --> $DIR/issue-8460-const.rs:37:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:40:36
+  --> $DIR/issue-8460-const.rs:39:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:42:36
+  --> $DIR/issue-8460-const.rs:41:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:44:36
+  --> $DIR/issue-8460-const.rs:43:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:46:36
+  --> $DIR/issue-8460-const.rs:45:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:48:36
+  --> $DIR/issue-8460-const.rs:47:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:50:36
+  --> $DIR/issue-8460-const.rs:49:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:52:36
+  --> $DIR/issue-8460-const.rs:51:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:54:36
+  --> $DIR/issue-8460-const.rs:53:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:56:36
+  --> $DIR/issue-8460-const.rs:55:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:58:36
+  --> $DIR/issue-8460-const.rs:57:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:60:36
+  --> $DIR/issue-8460-const.rs:59:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
index 739b5468743b22dda6a54495c896a1975f9ce5cb..d94c7742de301d397257de5e00eda4f5219e5142 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:14:36
+  --> $DIR/issue-8460-const.rs:13:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,37 +7,37 @@ LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:16:36
+  --> $DIR/issue-8460-const.rs:15:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:18:36
+  --> $DIR/issue-8460-const.rs:17:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:20:36
+  --> $DIR/issue-8460-const.rs:19:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:22:36
+  --> $DIR/issue-8460-const.rs:21:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:24:36
+  --> $DIR/issue-8460-const.rs:23:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:26:36
+  --> $DIR/issue-8460-const.rs:25:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to divide `1_isize` by zero
@@ -45,103 +45,103 @@ LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:28:36
+  --> $DIR/issue-8460-const.rs:27:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to divide `1_i8` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:30:36
+  --> $DIR/issue-8460-const.rs:29:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i16` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:32:36
+  --> $DIR/issue-8460-const.rs:31:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:34:36
+  --> $DIR/issue-8460-const.rs:33:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i64` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:36:36
+  --> $DIR/issue-8460-const.rs:35:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to divide `1_i128` by zero
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:38:36
+  --> $DIR/issue-8460-const.rs:37:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:40:36
+  --> $DIR/issue-8460-const.rs:39:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:42:36
+  --> $DIR/issue-8460-const.rs:41:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:44:36
+  --> $DIR/issue-8460-const.rs:43:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:46:36
+  --> $DIR/issue-8460-const.rs:45:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:48:36
+  --> $DIR/issue-8460-const.rs:47:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:50:36
+  --> $DIR/issue-8460-const.rs:49:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:52:36
+  --> $DIR/issue-8460-const.rs:51:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:54:36
+  --> $DIR/issue-8460-const.rs:53:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:56:36
+  --> $DIR/issue-8460-const.rs:55:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:58:36
+  --> $DIR/issue-8460-const.rs:57:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:60:36
+  --> $DIR/issue-8460-const.rs:59:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
index 739b5468743b22dda6a54495c896a1975f9ce5cb..d94c7742de301d397257de5e00eda4f5219e5142 100644 (file)
@@ -1,5 +1,5 @@
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:14:36
+  --> $DIR/issue-8460-const.rs:13:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,37 +7,37 @@ LL |     assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
    = note: `#[deny(arithmetic_overflow)]` on by default
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:16:36
+  --> $DIR/issue-8460-const.rs:15:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:18:36
+  --> $DIR/issue-8460-const.rs:17:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:20:36
+  --> $DIR/issue-8460-const.rs:19:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:22:36
+  --> $DIR/issue-8460-const.rs:21:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:24:36
+  --> $DIR/issue-8460-const.rs:23:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:26:36
+  --> $DIR/issue-8460-const.rs:25:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to divide `1_isize` by zero
@@ -45,103 +45,103 @@ LL |     assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
    = note: `#[deny(unconditional_panic)]` on by default
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:28:36
+  --> $DIR/issue-8460-const.rs:27:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to divide `1_i8` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:30:36
+  --> $DIR/issue-8460-const.rs:29:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i16` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:32:36
+  --> $DIR/issue-8460-const.rs:31:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i32` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:34:36
+  --> $DIR/issue-8460-const.rs:33:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to divide `1_i64` by zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:36:36
+  --> $DIR/issue-8460-const.rs:35:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to divide `1_i128` by zero
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:38:36
+  --> $DIR/issue-8460-const.rs:37:36
    |
 LL |     assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:40:36
+  --> $DIR/issue-8460-const.rs:39:36
    |
 LL |     assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:42:36
+  --> $DIR/issue-8460-const.rs:41:36
    |
 LL |     assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:44:36
+  --> $DIR/issue-8460-const.rs:43:36
    |
 LL |     assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:46:36
+  --> $DIR/issue-8460-const.rs:45:36
    |
 LL |     assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
 
 error: this arithmetic operation will overflow
-  --> $DIR/issue-8460-const.rs:48:36
+  --> $DIR/issue-8460-const.rs:47:36
    |
 LL |     assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
    |                                    ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:50:36
+  --> $DIR/issue-8460-const.rs:49:36
    |
 LL |     assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
    |                                    ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:52:36
+  --> $DIR/issue-8460-const.rs:51:36
    |
 LL |     assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
    |                                    ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:54:36
+  --> $DIR/issue-8460-const.rs:53:36
    |
 LL |     assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:56:36
+  --> $DIR/issue-8460-const.rs:55:36
    |
 LL |     assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:58:36
+  --> $DIR/issue-8460-const.rs:57:36
    |
 LL |     assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
    |                                    ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
 
 error: this operation will panic at runtime
-  --> $DIR/issue-8460-const.rs:60:36
+  --> $DIR/issue-8460-const.rs:59:36
    |
 LL |     assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
    |                                    ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
index 53005e46d2f47234372d58d1a27a02816a23f63f..dc754666c8e1fd1ff9599fceea08ff1f9f66cb61 100644 (file)
@@ -7,7 +7,6 @@
 
 #![deny(const_err)]
 
-use std::{isize, i8, i16, i32, i64, i128};
 use std::thread;
 
 fn main() {
index d6612035750836e49accc865a8f2d05dcaeb35b3..5a0394ae760e9305c179ab6b1758980785a9e8ec 100644 (file)
@@ -4,13 +4,12 @@
 // compile-flags: -C debug_assertions=yes -C opt-level=3
 
 use std::panic;
-use std::usize::MAX;
 
 fn main() {
-    assert_eq!((0..MAX).by_ref().count(), MAX);
+    assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX);
 
     let r = panic::catch_unwind(|| {
-        (0..=MAX).by_ref().count()
+        (0..=usize::MAX).by_ref().count()
     });
     assert!(r.is_err());
 }
index c38755db87ebf321f56392d1c684ebdb15d8aab9..dcaaff671b257a27e840a7fcabe0063a299f9375 100644 (file)
@@ -2,9 +2,7 @@
 // only-32bit too impatient for 2⁶⁴ items
 // compile-flags: -C debug_assertions=no -C opt-level=3
 
-use std::usize::MAX;
-
 fn main() {
-    assert_eq!((0..MAX).by_ref().count(), MAX);
-    assert_eq!((0..=MAX).by_ref().count(), 0);
+    assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX);
+    assert_eq!((0..=usize::MAX).by_ref().count(), 0);
 }
index f1eded31702c4449d4ebf383127d13b251d84b81..733ee0c46cc3d6c5d1621f3a7c918c37be708de1 100644 (file)
@@ -4,11 +4,10 @@
 // compile-flags: -C debug_assertions=yes -C opt-level=3
 
 use std::panic;
-use std::usize::MAX;
 
 fn main() {
-    let n = MAX as u64;
-    assert_eq!((0..).by_ref().position(|i| i >= n), Some(MAX));
+    let n = usize::MAX as u64;
+    assert_eq!((0..).by_ref().position(|i| i >= n), Some(usize::MAX));
 
     let r = panic::catch_unwind(|| {
         (0..).by_ref().position(|i| i > n)
index 3b0c245a5c2a18369ff8ad0d2833a88d405f9880..e610c35599c4cb61ac1fb9a322cf3820d45d19f5 100644 (file)
@@ -2,11 +2,9 @@
 // only-32bit too impatient for 2⁶⁴ items
 // compile-flags: -C debug_assertions=no -C opt-level=3
 
-use std::usize::MAX;
-
 fn main() {
-    let n = MAX as u64;
-    assert_eq!((0..).by_ref().position(|i| i >= n), Some(MAX));
+    let n = usize::MAX as u64;
+    assert_eq!((0..).by_ref().position(|i| i >= n), Some(usize::MAX));
     assert_eq!((0..).by_ref().position(|i| i > n), Some(0));
     assert_eq!((0..=n + 1).by_ref().position(|_| false), None);
 }
index eb2504d4bfdb7ef2024f35fc29127af189eb859a..f85376dabcb5de995bbfe5fc84fb6fe9f714b15e 100644 (file)
@@ -249,7 +249,7 @@ macro_rules! test_path {
 test_path!();
 test_path!(,);
 test_path!(::std);
-test_path!(std::u8,);
+test_path!(std::ops,);
 test_path!(any, super, super::super::self::path, X<Y>::Z<'a, T=U>);
 
 macro_rules! test_lifetime {
index 5fcd3392d33e379b11f649076bc58fa2356de487..52a5103865123ee44050b604fef98485eb820ef6 100644 (file)
@@ -1,7 +1,5 @@
 #![feature(box_syntax, unboxed_closures)]
 
-use std::usize;
-
 fn to_fn<A,F:Fn<A>>(f: F) -> F { f }
 
 fn test(_x: Box<usize>) {}
index 462bbd7be58a2d3c885ece9da2b3e96b2cb4740d..9427ba546a9c10468153db4e4547826cf02713d0 100644 (file)
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of `i`, a captured variable in an `Fn` closure
-  --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:11:28
+  --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:9:28
    |
 LL |     let i = box 3;
    |         - captured outer variable
index ced3c61ec162a6d784e3382ca31f04af1111f803..7691149602bc6948d2f8aca86a5804c2d4520ea9 100644 (file)
@@ -2,8 +2,6 @@
 
 #![deny(const_err)]
 
-use std::{f32, f64};
-
 // Forces evaluation of constants, triggering hard error
 fn force<T>(_: T) {}
 
index ee87b8cccfe40419d17b7309afa85fdb47296b78..0cc6473e5c48c440d813c2db388dc5787617145e 100644 (file)
@@ -1,5 +1,4 @@
 // run-pass
-use std::f64;
 
 pub fn main() {
   let nan: f64 = f64::NAN;
index 9a01549ecd24eedaa90c9522de55917a6456ec65..43b1059f944eedb36abee54c754c52715460f999 100644 (file)
@@ -21,7 +21,8 @@ macro_rules! int_modules {
     ($(($name:ident, $size:expr),)*) => ($(
         mod $name {
             pub const BITS: usize = $size;
-            pub use std::$name::*;
+            pub const MAX: $name = $name::MAX;
+            pub const MIN: $name = $name::MIN;
         }
     )*)
 }
index fe77544641cc1655b0b03b6c6b5631dfedca276b..df1198053036d7ebd66d0298bf997ff78485d84a 100644 (file)
@@ -6,5 +6,5 @@
 #![allow(arithmetic_overflow)]
 
 fn main() {
-    let _x = -std::i8::MIN;
+    let _x = -i8::MIN;
 }
index 6c3e503693c3ceef3b999403776f48b36dc83834..4c6929d6627a891043410207642932c7366201ac 100644 (file)
 extern crate test;
 
 use self::test::black_box;
-use std::{f32, f64};
-#[cfg(not(target_os = "emscripten"))]
-use std::{i128, u128};
-use std::{i16, i32, i64, i8, u16, u32, u64, u8};
 
 macro_rules! test {
     ($val:expr, $src_ty:ident -> $dest_ty:ident, $expected:expr) => (
index 939eb9746121f6726eb1dd93a659b2b31f0d68ff..55006a1134297e2a008c3d035e1af0faf97c2798 100644 (file)
@@ -47,21 +47,21 @@ macro_rules! tests {
     let x = 1_u8 << id(0);
     assert_eq!(x, 1);
     let x = 1_i8 << id(7);
-    assert_eq!(x, std::i8::MIN);
+    assert_eq!(x, i8::MIN);
     let x = 1_u8 << id(7);
     assert_eq!(x, 0x80);
     // high-order bits on LHS are silently discarded without panic.
     let x = 3_i8 << id(7);
-    assert_eq!(x, std::i8::MIN);
+    assert_eq!(x, i8::MIN);
     let x = 3_u8 << id(7);
     assert_eq!(x, 0x80);
 
     // above is (approximately) expanded from:
-    tests!(i8, u8, 7, std::i8::MIN, 0x80_u8);
+    tests!(i8, u8, 7, i8::MIN, 0x80_u8);
 
-    tests!(i16, u16, 15, std::i16::MIN, 0x8000_u16);
-    tests!(i32, u32, 31, std::i32::MIN, 0x8000_0000_u32);
-    tests!(i64, u64, 63, std::i64::MIN, 0x8000_0000_0000_0000_u64);
+    tests!(i16, u16, 15, i16::MIN, 0x8000_u16);
+    tests!(i32, u32, 31, i32::MIN, 0x8000_0000_u32);
+    tests!(i64, u64, 63, i64::MIN, 0x8000_0000_0000_0000_u64);
 }
 
 fn test_right_shift() {
@@ -92,9 +92,9 @@ macro_rules! tests {
         } }
     }
 
-    tests!(i8, u8, 7, std::i8::MIN, 0x40_i8, 0x80_u8);
-    tests!(i16, u16, 15, std::i16::MIN, 0x4000_u16, 0x8000_u16);
-    tests!(i32, u32, 31, std::i32::MIN, 0x4000_0000_u32, 0x8000_0000_u32);
-    tests!(i64, u64, 63, std::i64::MIN,
+    tests!(i8, u8, 7, i8::MIN, 0x40_i8, 0x80_u8);
+    tests!(i16, u16, 15, i16::MIN, 0x4000_u16, 0x8000_u16);
+    tests!(i32, u32, 31, i32::MIN, 0x4000_0000_u32, 0x8000_0000_u32);
+    tests!(i64, u64, 63, i64::MIN,
            0x4000_0000_0000_0000_u64, 0x8000_0000_0000_0000_u64);
 }
index 2671a267f4a870c57f11976648bde8acaf346656..839ce932d9e7695f408bffbf7f5806c78ef8d92d 100644 (file)
@@ -4,8 +4,6 @@
 #![deny(overflowing_literals)]
 extern crate test;
 
-use std::f32;
-use std::u128;
 use test::black_box;
 
 macro_rules! test {
index 345e617a7a380a8da5e34757608e1bcc20303389..4c271a3916a69bac7fe3fa2592cc9f3292692398 100644 (file)
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:10:20
+  --> $DIR/regions-addr-of-upvar-self.rs:8:20
    |
 LL |         let _f = || {
    |                  -- lifetime `'1` represents this closure's body
@@ -9,7 +9,7 @@ LL |             let p: &'static mut usize = &mut self.food;
    = note: closure implements `FnMut`, so references to captured variables can't escape the closure
 
 error: lifetime may not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:10:20
+  --> $DIR/regions-addr-of-upvar-self.rs:8:20
    |
 LL |     pub fn chase_cat(&mut self) {
    |                      - let's call the lifetime of this reference `'1`
@@ -18,7 +18,7 @@ LL |             let p: &'static mut usize = &mut self.food;
    |                    ^^^^^^^^^^^^^^^^^^ type annotation requires that `'1` must outlive `'static`
 
 error[E0597]: `self` does not live long enough
-  --> $DIR/regions-addr-of-upvar-self.rs:10:46
+  --> $DIR/regions-addr-of-upvar-self.rs:8:46
    |
 LL |         let _f = || {
    |                  -- value captured here
index 1f8fe9a4439b9f0a48fb0148dee10234a840c7e0..6159ab02d3d95161aa697138f24f8ba1832e68a6 100644 (file)
@@ -1,5 +1,3 @@
-use std::usize;
-
 struct Dog {
     food: usize,
 }
index 005800d50a45725a336e9640605c9bb9a9238896..62e9058365f11596cb7cb21bdffc9749ffd4cb0b 100644 (file)
@@ -1,22 +1,22 @@
 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
-  --> $DIR/regions-addr-of-upvar-self.rs:10:41
+  --> $DIR/regions-addr-of-upvar-self.rs:8:41
    |
 LL |             let p: &'static mut usize = &mut self.food;
    |                                         ^^^^^^^^^^^^^^
    |
-note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 9:18...
-  --> $DIR/regions-addr-of-upvar-self.rs:9:18
+note: first, the lifetime cannot outlive the lifetime `'_` as defined on the body at 7:18...
+  --> $DIR/regions-addr-of-upvar-self.rs:7:18
    |
 LL |         let _f = || {
    |                  ^^
 note: ...so that closure can access `self`
-  --> $DIR/regions-addr-of-upvar-self.rs:10:41
+  --> $DIR/regions-addr-of-upvar-self.rs:8:41
    |
 LL |             let p: &'static mut usize = &mut self.food;
    |                                         ^^^^^^^^^^^^^^
    = note: but, the lifetime must be valid for the static lifetime...
 note: ...so that reference does not outlive borrowed content
-  --> $DIR/regions-addr-of-upvar-self.rs:10:41
+  --> $DIR/regions-addr-of-upvar-self.rs:8:41
    |
 LL |             let p: &'static mut usize = &mut self.food;
    |                                         ^^^^^^^^^^^^^^
index 02fa23981894a07a307a9e87bd856b2768864883..9a5d57d411832e3b0386207d241685246db548f0 100644 (file)
@@ -1,11 +1,11 @@
 error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
-  --> $DIR/match-forbidden-without-eq.rs:13:9
+  --> $DIR/match-forbidden-without-eq.rs:11:9
    |
 LL |         FOO => { }
    |         ^^^
 
 warning: floating-point types cannot be used in patterns
-  --> $DIR/match-forbidden-without-eq.rs:20:9
+  --> $DIR/match-forbidden-without-eq.rs:18:9
    |
 LL |         f32::INFINITY => { }
    |         ^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |         f32::INFINITY => { }
    = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
 
 warning: floating-point types cannot be used in patterns
-  --> $DIR/match-forbidden-without-eq.rs:20:9
+  --> $DIR/match-forbidden-without-eq.rs:18:9
    |
 LL |         f32::INFINITY => { }
    |         ^^^^^^^^^^^^^
index 5f0aa11af5fb8db540b5869bbd3796f9369c73c0..d79be61f909955abfbdf1713dbe1c3aa25569d95 100644 (file)
@@ -20,11 +20,11 @@ fn main() {
     let y = f32x4(2.0, 1.0, 4.0, 3.0);
 
     #[cfg(not(any(target_arch = "mips", target_arch = "mips64")))]
-    let nan = ::std::f32::NAN;
+    let nan = f32::NAN;
     // MIPS hardware treats f32::NAN as SNAN. Clear the signaling bit.
     // See https://github.com/rust-lang/rust/issues/52746.
     #[cfg(any(target_arch = "mips", target_arch = "mips64"))]
-    let nan = f32::from_bits(::std::f32::NAN.to_bits() - 1);
+    let nan = f32::from_bits(f32::NAN.to_bits() - 1);
 
     let n = f32x4(nan, nan, nan, nan);
 
index 2b593e1c9b80414c7b2b91829b44bb6fd33efde7..103132c18ae2f0d30b6a7410dacdef6754cc531d 100644 (file)
@@ -4,8 +4,6 @@
 #![feature(repr_simd, platform_intrinsics, concat_idents)]
 #![allow(non_camel_case_types)]
 
-use std::f32::NAN;
-
 #[repr(simd)]
 #[derive(Copy, Clone)]
 struct i32x4(i32, i32, i32, i32);
@@ -94,7 +92,7 @@ fn main() {
     // NAN comparisons are special:
     // -11 (*)    13
     // -5        -100 (*)
-    let f4 = f32x4(NAN, f1.1, NAN, f2.3);
+    let f4 = f32x4(f32::NAN, f1.1, f32::NAN, f2.3);
 
     unsafe {
         tests! {
index 3b3a4a4f3250cb21d66b98a7a535a7618167fef5..f3f8d7259c44ece7073bbe2ced295bd10a06eb3e 100644 (file)
@@ -4,7 +4,6 @@
 use std::thread::{self, sleep};
 use std::time::Duration;
 use std::sync::{Arc, Mutex};
-use std::u64;
 
 fn main() {
     let finished = Arc::new(Mutex::new(false));
index 211ca7e4e8feb8022ffff71ee0a7bf6d5fc16569..af7ab865e3222512cc9b45a3b41831e6daaacd20 100644 (file)
@@ -5,8 +5,6 @@
 // See also compile-fail/overflow-discrim.rs, which shows what
 // happens if you leave the OhNo explicit cases out here.
 
-use std::{i8,u8,i16,u16,i32,u32,i64,u64,isize,usize};
-
 fn f_i8() {
     #[repr(i8)]
     enum A {
index ad87000228d04ac0a98fbdd0f178a3a3c2ea50db..823995e5be3afb147998943bbe306744aae90bf8 100644 (file)
@@ -19,11 +19,11 @@ pub fn bar() {}
     // `i8`
     pub struct I8<const F: i8>;
 
-    impl I8<{std::i8::MIN}> {
+    impl I8<{i8::MIN}> {
         pub fn foo() {}
     }
 
-    impl I8<{std::i8::MAX}> {
+    impl I8<{i8::MAX}> {
         pub fn foo() {}
     }
 
@@ -34,7 +34,7 @@ pub fn bar() {}
     // `i16`
     pub struct I16<const F: i16>;
 
-    impl I16<{std::i16::MIN}> {
+    impl I16<{i16::MIN}> {
         pub fn foo() {}
     }
 
@@ -45,7 +45,7 @@ pub fn bar() {}
     // `i32`
     pub struct I32<const F: i32>;
 
-    impl I32<{std::i32::MIN}> {
+    impl I32<{i32::MIN}> {
         pub fn foo() {}
     }
 
@@ -56,7 +56,7 @@ pub fn bar() {}
     // `i64`
     pub struct I64<const F: i64>;
 
-    impl I64<{std::i64::MIN}> {
+    impl I64<{i64::MIN}> {
         pub fn foo() {}
     }
 
@@ -67,7 +67,7 @@ pub fn bar() {}
     // `i128`
     pub struct I128<const F: i128>;
 
-    impl I128<{std::i128::MIN}> {
+    impl I128<{i128::MIN}> {
         pub fn foo() {}
     }
 
index ac7dede98a3a347de164b415ccda9a0406db8b0f..be8062f6276fd8a90a92e7c9a9410da927c76355 100644 (file)
@@ -1,8 +1,5 @@
 // run-pass
 
-extern crate core;
-use core::f32;
-
 union U {
     a: (u8, u8),
     b: u16,
index 758fb414eadf2dbcb2c49fd0af66539476ae6844..200f742d771f552a66454fb3f500cab1fc3fd049 100644 (file)
@@ -2,6 +2,7 @@
 
 // Make sure the module level constants are still there and accessible even after
 // the corresponding associated constants have been added, and later stabilized.
+#![allow(deprecated, deprecated_in_future)]
 use std::{u16, f32};
 
 fn main() {
index ecdd742fb4e0885d27fe28b4f512115e806f3bf2..6e2fc7f80b9c480404b05b788ee408bba2d9ec56 100644 (file)
@@ -4,9 +4,6 @@
 // Don't warn about overflowing ops on 32-bit platforms
 #![cfg_attr(target_pointer_width = "32", allow(const_err))]
 
-use std::{i8, i16, i32, i64, isize};
-use std::{u8, u16, u32, u64, usize};
-
 fn main() {
     assert_eq!(   i8::MAX.wrapping_add(1),    i8::MIN);
     assert_eq!(  i16::MAX.wrapping_add(1),   i16::MIN);
index dfc025558a2f430b35b1624b6cd37c5263dc76c4..263d9a7b92ddb2edb65bacef04ee55ca3870e3ad 100644 (file)
@@ -48,7 +48,7 @@ fn main() {
     v != 1.0;
 
     const ZERO_ARRAY: [f32; 3] = [0.0, 0.0, 0.0];
-    const ZERO_INF_ARRAY: [f32; 3] = [0.0, ::std::f32::INFINITY, ::std::f32::NEG_INFINITY];
+    const ZERO_INF_ARRAY: [f32; 3] = [0.0, f32::INFINITY, f32::NEG_INFINITY];
     const NON_ZERO_ARRAY: [f32; 3] = [0.0, 0.1, 0.2];
     const NON_ZERO_ARRAY2: [f32; 3] = [0.2, 0.1, 0.0];