diff --git a/src/ci/docker/dist-various-1/install-x86_64-redox.sh b/src/ci/docker/dist-various-1/install-x86_64-redox.sh index 339042bb6729a..dad9792233847 100755 --- a/src/ci/docker/dist-various-1/install-x86_64-redox.sh +++ b/src/ci/docker/dist-various-1/install-x86_64-redox.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# ignore-tidy-linelength set -ex diff --git a/src/ci/docker/dist-various-2/build-fuchsia-toolchain.sh b/src/ci/docker/dist-various-2/build-fuchsia-toolchain.sh index ef486075ff9d8..3b91918288a2b 100755 --- a/src/ci/docker/dist-various-2/build-fuchsia-toolchain.sh +++ b/src/ci/docker/dist-various-2/build-fuchsia-toolchain.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -# ignore-tidy-linelength - set -ex source shared.sh diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 8a3950718d7d2..207359ed6968f 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -911,7 +911,7 @@ impl Generator for Pin> { } } -#[unstable(feature = "futures_api", issue = "50547")] +#[stable(feature = "futures_api", since = "1.36.0")] impl Future for Box { type Output = F::Output; diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 63b3fbbdaefe1..eb673488170b6 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -85,7 +85,6 @@ #![feature(fmt_internals)] #![feature(fn_traits)] #![feature(fundamental)] -#![feature(futures_api)] #![feature(lang_items)] #![feature(libc)] #![feature(needs_allocator)] diff --git a/src/libcore/future/future.rs b/src/libcore/future/future.rs index e1ab67873a025..504330a023b31 100644 --- a/src/libcore/future/future.rs +++ b/src/libcore/future/future.rs @@ -1,6 +1,4 @@ -#![unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#![stable(feature = "futures_api", since = "1.36.0")] use crate::marker::Unpin; use crate::ops; @@ -26,8 +24,10 @@ use crate::task::{Context, Poll}; /// `await!` the value. #[doc(spotlight)] #[must_use = "futures do nothing unless polled"] +#[stable(feature = "futures_api", since = "1.36.0")] pub trait Future { /// The type of value produced on completion. + #[stable(feature = "futures_api", since = "1.36.0")] type Output; /// Attempt to resolve the future to a final value, registering @@ -92,9 +92,11 @@ pub trait Future { /// [`Context`]: ../task/struct.Context.html /// [`Waker`]: ../task/struct.Waker.html /// [`Waker::wake`]: ../task/struct.Waker.html#method.wake + #[stable(feature = "futures_api", since = "1.36.0")] fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll; } +#[stable(feature = "futures_api", since = "1.36.0")] impl Future for &mut F { type Output = F::Output; @@ -103,6 +105,7 @@ impl Future for &mut F { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl

Future for Pin

where P: Unpin + ops::DerefMut, diff --git a/src/libcore/future/mod.rs b/src/libcore/future/mod.rs index 6693ecbac41fa..89ea4713cfdaa 100644 --- a/src/libcore/future/mod.rs +++ b/src/libcore/future/mod.rs @@ -1,8 +1,7 @@ -#![unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#![stable(feature = "futures_api", since = "1.36.0")] //! Asynchronous values. mod future; +#[stable(feature = "futures_api", since = "1.36.0")] pub use self::future::Future; diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index c8a4ff7ca61e7..f1325f383eedb 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -377,6 +377,8 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn rotate_left(self, n: u32) -> Self { (self as $UnsignedT).rotate_left(n) as Self @@ -401,6 +403,8 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn rotate_right(self, n: u32) -> Self { (self as $UnsignedT).rotate_right(n) as Self @@ -598,6 +602,8 @@ assert_eq!((", stringify!($SelfT), "::max_value() - 2).checked_add(3), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_add(self, rhs: Self) -> Option { let (a, b) = self.overflowing_add(rhs); @@ -620,6 +626,8 @@ assert_eq!((", stringify!($SelfT), "::min_value() + 2).checked_sub(3), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_sub(self, rhs: Self) -> Option { let (a, b) = self.overflowing_sub(rhs); @@ -642,6 +650,8 @@ assert_eq!(", stringify!($SelfT), "::max_value().checked_mul(2), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_mul(self, rhs: Self) -> Option { let (a, b) = self.overflowing_mul(rhs); @@ -665,6 +675,8 @@ assert_eq!((1", stringify!($SelfT), ").checked_div(0), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_div(self, rhs: Self) -> Option { if rhs == 0 || (self == Self::min_value() && rhs == -1) { @@ -691,6 +703,8 @@ assert_eq!(", stringify!($SelfT), "::min_value().checked_div_euclid(-1), None); assert_eq!((1", stringify!($SelfT), ").checked_div_euclid(0), None); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_div_euclid(self, rhs: Self) -> Option { if rhs == 0 || (self == Self::min_value() && rhs == -1) { @@ -718,6 +732,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_rem(self, rhs: Self) -> Option { if rhs == 0 || (self == Self::min_value() && rhs == -1) { @@ -745,6 +761,8 @@ assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(0), None); assert_eq!(", stringify!($SelfT), "::MIN.checked_rem_euclid(-1), None); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_rem_euclid(self, rhs: Self) -> Option { if rhs == 0 || (self == Self::min_value() && rhs == -1) { @@ -791,6 +809,8 @@ assert_eq!(0x1", stringify!($SelfT), ".checked_shl(129), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_shl(self, rhs: u32) -> Option { let (a, b) = self.overflowing_shl(rhs); @@ -812,6 +832,8 @@ assert_eq!(0x10", stringify!($SelfT), ".checked_shr(128), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_shr(self, rhs: u32) -> Option { let (a, b) = self.overflowing_shr(rhs); @@ -860,6 +882,8 @@ $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_pow(self, mut exp: u32) -> Option { let mut base = self; @@ -901,6 +925,8 @@ $EndFeature, " #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_saturating_int_methods")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn saturating_add(self, rhs: Self) -> Self { intrinsics::saturating_add(self, rhs) @@ -924,6 +950,8 @@ $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_saturating_int_methods")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn saturating_sub(self, rhs: Self) -> Self { intrinsics::saturating_sub(self, rhs) @@ -947,6 +975,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($Self $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn saturating_mul(self, rhs: Self) -> Self { self.checked_mul(rhs).unwrap_or_else(|| { @@ -976,6 +1006,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(3), ", stringify!($SelfT $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn saturating_pow(self, exp: u32) -> Self { match self.checked_pow(exp) { @@ -1001,6 +1033,8 @@ assert_eq!(", stringify!($SelfT), "::max_value().wrapping_add(2), ", stringify!( $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { intrinsics::overflowing_add(self, rhs) @@ -1022,6 +1056,8 @@ stringify!($SelfT), "::max_value());", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { intrinsics::overflowing_sub(self, rhs) @@ -1042,6 +1078,8 @@ assert_eq!(11i8.wrapping_mul(12), -124);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { intrinsics::overflowing_mul(self, rhs) @@ -1070,6 +1108,8 @@ assert_eq!((-128i8).wrapping_div(-1), -128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_div(self, rhs: Self) -> Self { self.overflowing_div(rhs).0 @@ -1098,6 +1138,8 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_div_euclid(10), 10); assert_eq!((-128i8).wrapping_div_euclid(-1), -128); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_div_euclid(self, rhs: Self) -> Self { self.overflowing_div_euclid(rhs).0 @@ -1126,6 +1168,8 @@ assert_eq!((-128i8).wrapping_rem(-1), 0);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_rem(self, rhs: Self) -> Self { self.overflowing_rem(rhs).0 @@ -1153,6 +1197,8 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_rem_euclid(10), 0); assert_eq!((-128i8).wrapping_rem_euclid(-1), 0); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_rem_euclid(self, rhs: Self) -> Self { self.overflowing_rem_euclid(rhs).0 @@ -1203,6 +1249,8 @@ assert_eq!((-1", stringify!($SelfT), ").wrapping_shl(128), -1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { unsafe { @@ -1230,6 +1278,8 @@ assert_eq!((-128i16).wrapping_shr(64), -128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { unsafe { @@ -1284,6 +1334,8 @@ assert_eq!(3i8.wrapping_pow(6), -39);", $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_pow(self, mut exp: u32) -> Self { let mut base = self; @@ -1326,6 +1378,8 @@ assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($Sel "::MIN, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); @@ -1351,6 +1405,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($Sel "::MAX, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT); @@ -1374,6 +1430,8 @@ assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); @@ -1405,6 +1463,8 @@ $EndFeature, " ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_div(self, rhs: Self) -> (Self, bool) { if self == Self::min_value() && rhs == -1 { (self, true) @@ -1438,6 +1498,8 @@ assert_eq!(", stringify!($SelfT), "::MIN.overflowing_div_euclid(-1), (", stringi ```"), #[inline] #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool) { if self == Self::min_value() && rhs == -1 { (self, true) @@ -1470,6 +1532,8 @@ $EndFeature, " ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_rem(self, rhs: Self) -> (Self, bool) { if self == Self::min_value() && rhs == -1 { (0, true) @@ -1502,6 +1566,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_rem_euclid(2), (1, false)); assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem_euclid(-1), (0, true)); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool) { if self == Self::min_value() && rhs == -1 { @@ -1555,6 +1621,8 @@ assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) @@ -1578,6 +1646,8 @@ assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) @@ -1630,6 +1700,8 @@ assert_eq!(3i8.overflowing_pow(5), (-13, true));", $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn overflowing_pow(self, mut exp: u32) -> (Self, bool) { let mut base = self; @@ -1677,6 +1749,8 @@ assert_eq!(x.pow(5), 32);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn pow(self, mut exp: u32) -> Self { @@ -1732,6 +1806,8 @@ assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2 assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2 ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn div_euclid(self, rhs: Self) -> Self { @@ -1770,6 +1846,8 @@ assert_eq!(a.rem_euclid(-b), 3); assert_eq!((-a).rem_euclid(-b), 1); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn rem_euclid(self, rhs: Self) -> Self { @@ -2277,6 +2355,8 @@ let m = ", $rot_result, "; assert_eq!(n.rotate_left(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn rotate_left(self, n: u32) -> Self { intrinsics::rotate_left(self, n as $SelfT) @@ -2301,6 +2381,8 @@ let m = ", $rot_op, "; assert_eq!(n.rotate_right(", $rot, "), m); ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn rotate_right(self, n: u32) -> Self { intrinsics::rotate_right(self, n as $SelfT) @@ -2496,6 +2578,8 @@ Basic usage: assert_eq!((", stringify!($SelfT), "::max_value() - 2).checked_add(3), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_add(self, rhs: Self) -> Option { let (a, b) = self.overflowing_add(rhs); @@ -2516,6 +2600,8 @@ Basic usage: assert_eq!(0", stringify!($SelfT), ".checked_sub(1), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_sub(self, rhs: Self) -> Option { let (a, b) = self.overflowing_sub(rhs); @@ -2536,6 +2622,8 @@ Basic usage: assert_eq!(", stringify!($SelfT), "::max_value().checked_mul(2), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_mul(self, rhs: Self) -> Option { let (a, b) = self.overflowing_mul(rhs); @@ -2556,6 +2644,8 @@ Basic usage: assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_div(self, rhs: Self) -> Option { match rhs { @@ -2579,6 +2669,8 @@ assert_eq!(128", stringify!($SelfT), ".checked_div_euclid(2), Some(64)); assert_eq!(1", stringify!($SelfT), ".checked_div_euclid(0), None); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_div_euclid(self, rhs: Self) -> Option { if rhs == 0 { @@ -2603,6 +2695,8 @@ Basic usage: assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_rem(self, rhs: Self) -> Option { if rhs == 0 { @@ -2627,6 +2721,8 @@ assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(2), Some(1)); assert_eq!(5", stringify!($SelfT), ".checked_rem_euclid(0), None); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_rem_euclid(self, rhs: Self) -> Option { if rhs == 0 { @@ -2672,6 +2768,8 @@ Basic usage: assert_eq!(0x10", stringify!($SelfT), ".checked_shl(129), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_shl(self, rhs: u32) -> Option { let (a, b) = self.overflowing_shl(rhs); @@ -2692,6 +2790,8 @@ Basic usage: assert_eq!(0x10", stringify!($SelfT), ".checked_shr(129), None);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_shr(self, rhs: u32) -> Option { let (a, b) = self.overflowing_shr(rhs); @@ -2712,6 +2812,8 @@ Basic usage: assert_eq!(", stringify!($SelfT), "::max_value().checked_pow(2), None);", $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn checked_pow(self, mut exp: u32) -> Option { let mut base = self; @@ -2750,6 +2852,8 @@ assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[rustc_const_unstable(feature = "const_saturating_int_methods")] #[inline] pub const fn saturating_add(self, rhs: Self) -> Self { @@ -2770,6 +2874,8 @@ Basic usage: assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[rustc_const_unstable(feature = "const_saturating_int_methods")] #[inline] pub const fn saturating_sub(self, rhs: Self) -> Self { @@ -2793,6 +2899,8 @@ assert_eq!((", stringify!($SelfT), "::MAX).saturating_mul(10), ", stringify!($Se "::MAX);", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn saturating_mul(self, rhs: Self) -> Self { self.checked_mul(rhs).unwrap_or(Self::max_value()) @@ -2815,6 +2923,8 @@ assert_eq!(", stringify!($SelfT), "::MAX.saturating_pow(2), ", stringify!($SelfT $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn saturating_pow(self, exp: u32) -> Self { match self.checked_pow(exp) { @@ -2838,6 +2948,8 @@ assert_eq!(200", stringify!($SelfT), ".wrapping_add(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { intrinsics::overflowing_add(self, rhs) @@ -2858,6 +2970,8 @@ assert_eq!(100", stringify!($SelfT), ".wrapping_sub(", stringify!($SelfT), "::ma $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { intrinsics::overflowing_sub(self, rhs) @@ -2879,6 +2993,8 @@ $EndFeature, " /// assert_eq!(25u8.wrapping_mul(12), 44); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { intrinsics::overflowing_mul(self, rhs) @@ -2899,6 +3015,8 @@ Basic usage: ", $Feature, "assert_eq!(100", stringify!($SelfT), ".wrapping_div(10), 10);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_div(self, rhs: Self) -> Self { self / rhs @@ -2924,6 +3042,8 @@ Basic usage: assert_eq!(100", stringify!($SelfT), ".wrapping_div_euclid(10), 10); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_div_euclid(self, rhs: Self) -> Self { self / rhs @@ -2946,6 +3066,8 @@ Basic usage: ", $Feature, "assert_eq!(100", stringify!($SelfT), ".wrapping_rem(10), 0);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_rem(self, rhs: Self) -> Self { self % rhs @@ -2972,6 +3094,8 @@ Basic usage: assert_eq!(100", stringify!($SelfT), ".wrapping_rem_euclid(10), 0); ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_rem_euclid(self, rhs: Self) -> Self { self % rhs @@ -3026,6 +3150,8 @@ Basic usage: assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { unsafe { @@ -3055,6 +3181,8 @@ Basic usage: assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, " ```"), #[stable(feature = "num_wrapping", since = "1.2.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { unsafe { @@ -3076,6 +3204,8 @@ Basic usage: assert_eq!(3u8.wrapping_pow(6), 217);", $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn wrapping_pow(self, mut exp: u32) -> Self { let mut base = self; @@ -3118,6 +3248,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false)); assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); @@ -3144,6 +3276,8 @@ assert_eq!(0", stringify!($SelfT), ".overflowing_sub(1), (", stringify!($SelfT), $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT); @@ -3169,6 +3303,8 @@ $EndFeature, " /// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true)); /// ``` #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); @@ -3196,6 +3332,8 @@ Basic usage ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_div(self, rhs: Self) -> (Self, bool) { (self / rhs, false) } @@ -3226,6 +3364,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_div_euclid(2), (2, false)); ```"), #[inline] #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool) { (self / rhs, false) } @@ -3252,6 +3392,8 @@ Basic usage ```"), #[inline] #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_rem(self, rhs: Self) -> (Self, bool) { (self % rhs, false) } @@ -3282,6 +3424,8 @@ assert_eq!(5", stringify!($SelfT), ".overflowing_rem_euclid(2), (1, false)); ```"), #[inline] #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] pub fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool) { (self % rhs, false) } @@ -3329,6 +3473,8 @@ Basic usage assert_eq!(0x1", stringify!($SelfT), ".overflowing_shl(132), (0x10, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) { (self.wrapping_shl(rhs), (rhs > ($BITS - 1))) @@ -3353,6 +3499,8 @@ Basic usage assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $EndFeature, " ```"), #[stable(feature = "wrapping", since = "1.7.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) { (self.wrapping_shr(rhs), (rhs > ($BITS - 1))) @@ -3374,6 +3522,8 @@ Basic usage: assert_eq!(3u8.overflowing_pow(6), (217, true));", $EndFeature, " ```"), #[stable(feature = "no_panic_pow", since = "1.34.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] pub fn overflowing_pow(self, mut exp: u32) -> (Self, bool) { let mut base = self; @@ -3418,6 +3568,8 @@ Basic usage: ", $Feature, "assert_eq!(2", stringify!($SelfT), ".pow(5), 32);", $EndFeature, " ```"), #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn pow(self, mut exp: u32) -> Self { @@ -3459,6 +3611,8 @@ Basic usage: assert_eq!(7", stringify!($SelfT), ".div_euclid(4), 1); // or any other integer type ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn div_euclid(self, rhs: Self) -> Self { @@ -3483,6 +3637,8 @@ Basic usage: assert_eq!(7", stringify!($SelfT), ".rem_euclid(4), 3); // or any other integer type ```"), #[unstable(feature = "euclidean_division", issue = "49048")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] #[inline] #[rustc_inherit_overflow_checks] pub fn rem_euclid(self, rhs: Self) -> Self { diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index 29bae69ea83c1..ef090928392cd 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -1,11 +1,11 @@ -#![unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#![stable(feature = "futures_api", since = "1.36.0")] //! Types and Traits for working with asynchronous tasks. mod poll; +#[stable(feature = "futures_api", since = "1.36.0")] pub use self::poll::Poll; mod wake; +#[stable(feature = "futures_api", since = "1.36.0")] pub use self::wake::{Context, Waker, RawWaker, RawWakerVTable}; diff --git a/src/libcore/task/poll.rs b/src/libcore/task/poll.rs index ecf03afb88e2a..3db70d5e7645f 100644 --- a/src/libcore/task/poll.rs +++ b/src/libcore/task/poll.rs @@ -1,6 +1,4 @@ -#![unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#![stable(feature = "futures_api", since = "1.36.0")] use crate::ops::Try; use crate::result::Result; @@ -9,20 +7,27 @@ use crate::result::Result; /// scheduled to receive a wakeup instead. #[must_use = "this `Poll` may be a `Pending` variant, which should be handled"] #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[stable(feature = "futures_api", since = "1.36.0")] pub enum Poll { /// Represents that a value is immediately ready. - Ready(T), + #[stable(feature = "futures_api", since = "1.36.0")] + Ready( + #[stable(feature = "futures_api", since = "1.36.0")] + T + ), /// Represents that a value is not ready yet. /// /// When a function returns `Pending`, the function *must* also /// ensure that the current task is scheduled to be awoken when /// progress can be made. + #[stable(feature = "futures_api", since = "1.36.0")] Pending, } impl Poll { /// Changes the ready value of this `Poll` with the closure provided. + #[stable(feature = "futures_api", since = "1.36.0")] pub fn map(self, f: F) -> Poll where F: FnOnce(T) -> U { @@ -34,6 +39,7 @@ impl Poll { /// Returns `true` if this is `Poll::Ready` #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub fn is_ready(&self) -> bool { match *self { Poll::Ready(_) => true, @@ -43,6 +49,7 @@ impl Poll { /// Returns `true` if this is `Poll::Pending` #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub fn is_pending(&self) -> bool { !self.is_ready() } @@ -50,6 +57,7 @@ impl Poll { impl Poll> { /// Changes the success value of this `Poll` with the closure provided. + #[stable(feature = "futures_api", since = "1.36.0")] pub fn map_ok(self, f: F) -> Poll> where F: FnOnce(T) -> U { @@ -61,6 +69,7 @@ impl Poll> { } /// Changes the error value of this `Poll` with the closure provided. + #[stable(feature = "futures_api", since = "1.36.0")] pub fn map_err(self, f: F) -> Poll> where F: FnOnce(E) -> U { @@ -72,12 +81,14 @@ impl Poll> { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl From for Poll { fn from(t: T) -> Poll { Poll::Ready(t) } } +#[stable(feature = "futures_api", since = "1.36.0")] impl Try for Poll> { type Ok = Poll; type Error = E; @@ -102,6 +113,7 @@ impl Try for Poll> { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl Try for Poll>> { type Ok = Poll>; type Error = E; diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index 94e31054a5812..b4e9124983205 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -1,6 +1,4 @@ -#![unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#![stable(feature = "futures_api", since = "1.36.0")] use crate::fmt; use crate::marker::{PhantomData, Unpin}; @@ -13,6 +11,7 @@ use crate::marker::{PhantomData, Unpin}; /// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that /// customizes the behavior of the `RawWaker`. #[derive(PartialEq, Debug)] +#[stable(feature = "futures_api", since = "1.36.0")] pub struct RawWaker { /// A data pointer, which can be used to store arbitrary data as required /// by the executor. This could be e.g. a type-erased pointer to an `Arc` @@ -37,9 +36,7 @@ impl RawWaker { /// from a `RawWaker`. For each operation on the `Waker`, the associated /// function in the `vtable` of the underlying `RawWaker` will be called. #[rustc_promotable] - #[unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] + #[stable(feature = "futures_api", since = "1.36.0")] pub const fn new(data: *const (), vtable: &'static RawWakerVTable) -> RawWaker { RawWaker { data, @@ -58,6 +55,7 @@ impl RawWaker { /// pointer of a properly constructed [`RawWaker`] object from inside the /// [`RawWaker`] implementation. Calling one of the contained functions using /// any other `data` pointer will cause undefined behavior. +#[stable(feature = "futures_api", since = "1.36.0")] #[derive(PartialEq, Copy, Clone, Debug)] pub struct RawWakerVTable { /// This function will be called when the [`RawWaker`] gets cloned, e.g. when @@ -131,9 +129,14 @@ impl RawWakerVTable { /// resources that are associated with this instance of a [`RawWaker`] and /// associated task. #[rustc_promotable] - #[unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] + #[cfg_attr(stage0, unstable(feature = "futures_api_const_fn_ptr", issue = "50547"))] + #[cfg_attr(not(stage0), stable(feature = "futures_api", since = "1.36.0"))] + // `rustc_allow_const_fn_ptr` is a hack that should not be used anywhere else + // without first consulting with T-Lang. + // + // FIXME: remove whenever we have a stable way to accept fn pointers from const fn + // (see https://github.com/rust-rfcs/const-eval/issues/19#issuecomment-472799062) + #[cfg_attr(not(stage0), rustc_allow_const_fn_ptr)] pub const fn new( clone: unsafe fn(*const ()) -> RawWaker, wake: unsafe fn(*const ()), @@ -153,6 +156,7 @@ impl RawWakerVTable { /// /// Currently, `Context` only serves to provide access to a `&Waker` /// which can be used to wake the current task. +#[stable(feature = "futures_api", since = "1.36.0")] pub struct Context<'a> { waker: &'a Waker, // Ensure we future-proof against variance changes by forcing @@ -164,6 +168,7 @@ pub struct Context<'a> { impl<'a> Context<'a> { /// Create a new `Context` from a `&Waker`. + #[stable(feature = "futures_api", since = "1.36.0")] #[inline] pub fn from_waker(waker: &'a Waker) -> Self { Context { @@ -173,12 +178,14 @@ impl<'a> Context<'a> { } /// Returns a reference to the `Waker` for the current task. + #[stable(feature = "futures_api", since = "1.36.0")] #[inline] pub fn waker(&self) -> &'a Waker { &self.waker } } +#[stable(feature = "futures_api", since = "1.36.0")] impl fmt::Debug for Context<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Context") @@ -195,17 +202,22 @@ impl fmt::Debug for Context<'_> { /// /// Implements [`Clone`], [`Send`], and [`Sync`]. #[repr(transparent)] +#[stable(feature = "futures_api", since = "1.36.0")] pub struct Waker { waker: RawWaker, } +#[stable(feature = "futures_api", since = "1.36.0")] impl Unpin for Waker {} +#[stable(feature = "futures_api", since = "1.36.0")] unsafe impl Send for Waker {} +#[stable(feature = "futures_api", since = "1.36.0")] unsafe impl Sync for Waker {} impl Waker { /// Wake up the task associated with this `Waker`. #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub fn wake(self) { // The actual wakeup call is delegated through a virtual function call // to the implementation which is defined by the executor. @@ -227,6 +239,7 @@ impl Waker { /// where an owned `Waker` is available. This method should be preferred to /// calling `waker.clone().wake()`. #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub fn wake_by_ref(&self) { // The actual wakeup call is delegated through a virtual function call // to the implementation which is defined by the executor. @@ -243,6 +256,7 @@ impl Waker { /// /// This function is primarily used for optimization purposes. #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub fn will_wake(&self, other: &Waker) -> bool { self.waker == other.waker } @@ -253,6 +267,7 @@ impl Waker { /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld. /// Therefore this method is unsafe. #[inline] + #[stable(feature = "futures_api", since = "1.36.0")] pub unsafe fn from_raw(waker: RawWaker) -> Waker { Waker { waker, @@ -260,6 +275,7 @@ impl Waker { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl Clone for Waker { #[inline] fn clone(&self) -> Self { @@ -272,6 +288,7 @@ impl Clone for Waker { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl Drop for Waker { #[inline] fn drop(&mut self) { @@ -282,6 +299,7 @@ impl Drop for Waker { } } +#[stable(feature = "futures_api", since = "1.36.0")] impl fmt::Debug for Waker { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let vtable_ptr = self.waker.vtable as *const RawWakerVTable; diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index 496ccc888b61a..40cce8e77c0e0 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -121,6 +121,7 @@ impl_stable_hash_for!(struct ::syntax::attr::Stability { feature, rustc_depr, promotable, + allow_const_fn_ptr, const_stability }); diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 747f0a6ae8723..f332503435131 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -111,31 +111,31 @@ pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { /// and for error reporting logic to read arbitrary node types. pub in_progress_tables: Option<&'a RefCell>>, - // Cache for projections. This cache is snapshotted along with the - // infcx. - // - // Public so that `traits::project` can use it. + /// Cache for projections. This cache is snapshotted along with the + /// infcx. + /// + /// Public so that `traits::project` can use it. pub projection_cache: RefCell>, - // We instantiate UnificationTable with bounds because the - // types that might instantiate a general type variable have an - // order, represented by its upper and lower bounds. + /// We instantiate `UnificationTable` with `bounds` because the + /// types that might instantiate a general type variable have an + /// order, represented by its upper and lower bounds. pub type_variables: RefCell>, - // Map from integral variable to the kind of integer it represents + /// Map from integral variable to the kind of integer it represents int_unification_table: RefCell>>, - // Map from floating variable to the kind of float it represents + /// Map from floating variable to the kind of float it represents float_unification_table: RefCell>>, - // Tracks the set of region variables and the constraints between - // them. This is initially `Some(_)` but when - // `resolve_regions_and_report_errors` is invoked, this gets set - // to `None` -- further attempts to perform unification etc may - // fail if new region constraints would've been added. + /// Tracks the set of region variables and the constraints between + /// them. This is initially `Some(_)` but when + /// `resolve_regions_and_report_errors` is invoked, this gets set + /// to `None` -- further attempts to perform unification etc may + /// fail if new region constraints would've been added. region_constraints: RefCell>>, - // Once region inference is done, the values for each variable. + /// Once region inference is done, the values for each variable. lexical_region_resolutions: RefCell>>, /// Caches the results of trait selection. This cache is used @@ -145,65 +145,65 @@ pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { /// Caches the results of trait evaluation. pub evaluation_cache: traits::EvaluationCache<'tcx>, - // the set of predicates on which errors have been reported, to - // avoid reporting the same error twice. + /// the set of predicates on which errors have been reported, to + /// avoid reporting the same error twice. pub reported_trait_errors: RefCell>>>, - // When an error occurs, we want to avoid reporting "derived" - // errors that are due to this original failure. Normally, we - // handle this with the `err_count_on_creation` count, which - // basically just tracks how many errors were reported when we - // started type-checking a fn and checks to see if any new errors - // have been reported since then. Not great, but it works. - // - // However, when errors originated in other passes -- notably - // resolve -- this heuristic breaks down. Therefore, we have this - // auxiliary flag that one can set whenever one creates a - // type-error that is due to an error in a prior pass. - // - // Don't read this flag directly, call `is_tainted_by_errors()` - // and `set_tainted_by_errors()`. + /// When an error occurs, we want to avoid reporting "derived" + /// errors that are due to this original failure. Normally, we + /// handle this with the `err_count_on_creation` count, which + /// basically just tracks how many errors were reported when we + /// started type-checking a fn and checks to see if any new errors + /// have been reported since then. Not great, but it works. + /// + /// However, when errors originated in other passes -- notably + /// resolve -- this heuristic breaks down. Therefore, we have this + /// auxiliary flag that one can set whenever one creates a + /// type-error that is due to an error in a prior pass. + /// + /// Don't read this flag directly, call `is_tainted_by_errors()` + /// and `set_tainted_by_errors()`. tainted_by_errors_flag: Cell, - // Track how many errors were reported when this infcx is created. - // If the number of errors increases, that's also a sign (line - // `tained_by_errors`) to avoid reporting certain kinds of errors. + /// Track how many errors were reported when this infcx is created. + /// If the number of errors increases, that's also a sign (line + /// `tained_by_errors`) to avoid reporting certain kinds of errors. err_count_on_creation: usize, - // This flag is true while there is an active snapshot. + /// This flag is true while there is an active snapshot. in_snapshot: Cell, - // A set of constraints that regionck must validate. Each - // constraint has the form `T:'a`, meaning "some type `T` must - // outlive the lifetime 'a". These constraints derive from - // instantiated type parameters. So if you had a struct defined - // like - // - // struct Foo { ... } - // - // then in some expression `let x = Foo { ... }` it will - // instantiate the type parameter `T` with a fresh type `$0`. At - // the same time, it will record a region obligation of - // `$0:'static`. This will get checked later by regionck. (We - // can't generally check these things right away because we have - // to wait until types are resolved.) - // - // These are stored in a map keyed to the id of the innermost - // enclosing fn body / static initializer expression. This is - // because the location where the obligation was incurred can be - // relevant with respect to which sublifetime assumptions are in - // place. The reason that we store under the fn-id, and not - // something more fine-grained, is so that it is easier for - // regionck to be sure that it has found *all* the region - // obligations (otherwise, it's easy to fail to walk to a - // particular node-id). - // - // Before running `resolve_regions_and_report_errors`, the creator - // of the inference context is expected to invoke - // `process_region_obligations` (defined in `self::region_obligations`) - // for each body-id in this map, which will process the - // obligations within. This is expected to be done 'late enough' - // that all type inference variables have been bound and so forth. + /// A set of constraints that regionck must validate. Each + /// constraint has the form `T:'a`, meaning "some type `T` must + /// outlive the lifetime 'a". These constraints derive from + /// instantiated type parameters. So if you had a struct defined + /// like + /// + /// struct Foo { ... } + /// + /// then in some expression `let x = Foo { ... }` it will + /// instantiate the type parameter `T` with a fresh type `$0`. At + /// the same time, it will record a region obligation of + /// `$0:'static`. This will get checked later by regionck. (We + /// can't generally check these things right away because we have + /// to wait until types are resolved.) + /// + /// These are stored in a map keyed to the id of the innermost + /// enclosing fn body / static initializer expression. This is + /// because the location where the obligation was incurred can be + /// relevant with respect to which sublifetime assumptions are in + /// place. The reason that we store under the fn-id, and not + /// something more fine-grained, is so that it is easier for + /// regionck to be sure that it has found *all* the region + /// obligations (otherwise, it's easy to fail to walk to a + /// particular node-id). + /// + /// Before running `resolve_regions_and_report_errors`, the creator + /// of the inference context is expected to invoke + /// `process_region_obligations` (defined in `self::region_obligations`) + /// for each body-id in this map, which will process the + /// obligations within. This is expected to be done 'late enough' + /// that all type inference variables have been bound and so forth. pub region_obligations: RefCell)>>, /// What is the innermost universe we have created? Starts out as @@ -247,85 +247,85 @@ pub struct TypeTrace<'tcx> { /// See `error_reporting` module for more details #[derive(Clone, Debug)] pub enum SubregionOrigin<'tcx> { - // Arose from a subtyping relation + /// Arose from a subtyping relation Subtype(TypeTrace<'tcx>), - // Stack-allocated closures cannot outlive innermost loop - // or function so as to ensure we only require finite stack + /// Stack-allocated closures cannot outlive innermost loop + /// or function so as to ensure we only require finite stack InfStackClosure(Span), - // Invocation of closure must be within its lifetime + /// Invocation of closure must be within its lifetime InvokeClosure(Span), - // Dereference of reference must be within its lifetime + /// Dereference of reference must be within its lifetime DerefPointer(Span), - // Closure bound must not outlive captured free variables + /// Closure bound must not outlive captured free variables FreeVariable(Span, ast::NodeId), - // Index into slice must be within its lifetime + /// Index into slice must be within its lifetime IndexSlice(Span), - // When casting `&'a T` to an `&'b Trait` object, - // relating `'a` to `'b` + /// When casting `&'a T` to an `&'b Trait` object, + /// relating `'a` to `'b` RelateObjectBound(Span), - // Some type parameter was instantiated with the given type, - // and that type must outlive some region. + /// Some type parameter was instantiated with the given type, + /// and that type must outlive some region. RelateParamBound(Span, Ty<'tcx>), - // The given region parameter was instantiated with a region - // that must outlive some other region. + /// The given region parameter was instantiated with a region + /// that must outlive some other region. RelateRegionParamBound(Span), - // A bound placed on type parameters that states that must outlive - // the moment of their instantiation. + /// A bound placed on type parameters that states that must outlive + /// the moment of their instantiation. RelateDefaultParamBound(Span, Ty<'tcx>), - // Creating a pointer `b` to contents of another reference + /// Creating a pointer `b` to contents of another reference Reborrow(Span), - // Creating a pointer `b` to contents of an upvar + /// Creating a pointer `b` to contents of an upvar ReborrowUpvar(Span, ty::UpvarId), - // Data with type `Ty<'tcx>` was borrowed + /// Data with type `Ty<'tcx>` was borrowed DataBorrowed(Ty<'tcx>, Span), - // (&'a &'b T) where a >= b + /// (&'a &'b T) where a >= b ReferenceOutlivesReferent(Ty<'tcx>, Span), - // Type or region parameters must be in scope. + /// Type or region parameters must be in scope. ParameterInScope(ParameterOrigin, Span), - // The type T of an expression E must outlive the lifetime for E. + /// The type T of an expression E must outlive the lifetime for E. ExprTypeIsNotInScope(Ty<'tcx>, Span), - // A `ref b` whose region does not enclose the decl site + /// A `ref b` whose region does not enclose the decl site BindingTypeIsNotValidAtDecl(Span), - // Regions appearing in a method receiver must outlive method call + /// Regions appearing in a method receiver must outlive method call CallRcvr(Span), - // Regions appearing in a function argument must outlive func call + /// Regions appearing in a function argument must outlive func call CallArg(Span), - // Region in return type of invoked fn must enclose call + /// Region in return type of invoked fn must enclose call CallReturn(Span), - // Operands must be in scope + /// Operands must be in scope Operand(Span), - // Region resulting from a `&` expr must enclose the `&` expr + /// Region resulting from a `&` expr must enclose the `&` expr AddrOf(Span), - // An auto-borrow that does not enclose the expr where it occurs + /// An auto-borrow that does not enclose the expr where it occurs AutoBorrow(Span), - // Region constraint arriving from destructor safety + /// Region constraint arriving from destructor safety SafeDestructor(Span), - // Comparing the signature and requirements of an impl method against - // the containing trait. + /// Comparing the signature and requirements of an impl method against + /// the containing trait. CompareImplMethodObligation { span: Span, item_name: ast::Name, @@ -361,35 +361,35 @@ pub enum LateBoundRegionConversionTime { /// See `error_reporting` module for more details #[derive(Copy, Clone, Debug)] pub enum RegionVariableOrigin { - // Region variables created for ill-categorized reasons, - // mostly indicates places in need of refactoring + /// Region variables created for ill-categorized reasons, + /// mostly indicates places in need of refactoring MiscVariable(Span), - // Regions created by a `&P` or `[...]` pattern + /// Regions created by a `&P` or `[...]` pattern PatternRegion(Span), - // Regions created by `&` operator + /// Regions created by `&` operator AddrOfRegion(Span), - // Regions created as part of an autoref of a method receiver + /// Regions created as part of an autoref of a method receiver Autoref(Span), - // Regions created as part of an automatic coercion + /// Regions created as part of an automatic coercion Coercion(Span), - // Region variables created as the values for early-bound regions + /// Region variables created as the values for early-bound regions EarlyBoundRegion(Span, InternedString), - // Region variables created for bound regions - // in a function or method that is called + /// Region variables created for bound regions + /// in a function or method that is called LateBoundRegion(Span, ty::BoundRegion, LateBoundRegionConversionTime), UpvarRegion(ty::UpvarId, Span), BoundRegionInCoherence(ast::Name), - // This origin is used for the inference variables that we create - // during NLL region processing. + /// This origin is used for the inference variables that we create + /// during NLL region processing. NLL(NLLRegionVariableOrigin), } @@ -686,22 +686,22 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } } - // Clear the "currently in a snapshot" flag, invoke the closure, - // then restore the flag to its original value. This flag is a - // debugging measure designed to detect cases where we start a - // snapshot, create type variables, and register obligations - // which may involve those type variables in the fulfillment cx, - // potentially leaving "dangling type variables" behind. - // In such cases, an assertion will fail when attempting to - // register obligations, within a snapshot. Very useful, much - // better than grovelling through megabytes of RUST_LOG output. - // - // HOWEVER, in some cases the flag is unhelpful. In particular, we - // sometimes create a "mini-fulfilment-cx" in which we enroll - // obligations. As long as this fulfillment cx is fully drained - // before we return, this is not a problem, as there won't be any - // escaping obligations in the main cx. In those cases, you can - // use this function. + /// Clear the "currently in a snapshot" flag, invoke the closure, + /// then restore the flag to its original value. This flag is a + /// debugging measure designed to detect cases where we start a + /// snapshot, create type variables, and register obligations + /// which may involve those type variables in the fulfillment cx, + /// potentially leaving "dangling type variables" behind. + /// In such cases, an assertion will fail when attempting to + /// register obligations, within a snapshot. Very useful, much + /// better than grovelling through megabytes of `RUST_LOG` output. + /// + /// HOWEVER, in some cases the flag is unhelpful. In particular, we + /// sometimes create a "mini-fulfilment-cx" in which we enroll + /// obligations. As long as this fulfillment cx is fully drained + /// before we return, this is not a problem, as there won't be any + /// escaping obligations in the main cx. In those cases, you can + /// use this function. pub fn save_and_restore_in_snapshot_flag(&self, func: F) -> R where F: FnOnce(&Self) -> R, @@ -828,7 +828,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { r } - // Execute `f` in a snapshot, and commit the bindings it creates + /// Execute `f` in a snapshot, and commit the bindings it creates. pub fn in_snapshot(&self, f: F) -> T where F: FnOnce(&CombinedSnapshot<'a, 'tcx>) -> T, @@ -854,9 +854,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { /// Scan the constraints produced since `snapshot` began and returns: /// - /// - None -- if none of them involve "region outlives" constraints - /// - Some(true) -- if there are `'a: 'b` constraints where `'a` or `'b` is a placehodler - /// - Some(false) -- if there are `'a: 'b` constraints but none involve placeholders + /// - `None` -- if none of them involve "region outlives" constraints + /// - `Some(true)` -- if there are `'a: 'b` constraints where `'a` or `'b` is a placeholder + /// - `Some(false)` -- if there are `'a: 'b` constraints but none involve placeholders pub fn region_constraints_added_in_snapshot( &self, snapshot: &CombinedSnapshot<'a, 'tcx>, @@ -1292,19 +1292,16 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { self.type_variables.borrow_mut().root_var(var) } + /// Where possible, replaces type/int/float variables in + /// `value` with their final value. Note that region variables + /// are unaffected. If a type variable has not been unified, it + /// is left as is. This is an idempotent operation that does + /// not affect inference state in any way and so you can do it + /// at will. pub fn resolve_type_vars_if_possible(&self, value: &T) -> T where T: TypeFoldable<'tcx>, { - /*! - * Where possible, replaces type/int/float variables in - * `value` with their final value. Note that region variables - * are unaffected. If a type variable has not been unified, it - * is left as is. This is an idempotent operation that does - * not affect inference state in any way and so you can do it - * at will. - */ - if !value.needs_infer() { return value.clone(); // avoid duplicated subst-folding } diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index ef1270d304523..8ce86f70a551f 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -441,6 +441,7 @@ impl<'a, 'tcx> Index<'tcx> { rustc_depr: None, const_stability: None, promotable: false, + allow_const_fn_ptr: false, }); annotator.parent_stab = Some(stability); } diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 8c1e345cdaec5..1861420b408b6 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -235,6 +235,8 @@ rustc_queries! { /// constructor function). query is_promotable_const_fn(_: DefId) -> bool {} + query const_fn_is_allowed_fn_ptr(_: DefId) -> bool {} + /// True if this is a foreign item (i.e., linked via `extern { ... }`). query is_foreign_item(_: DefId) -> bool {} diff --git a/src/librustc/ty/constness.rs b/src/librustc/ty/constness.rs index e33d0a74ea013..7298b548f3197 100644 --- a/src/librustc/ty/constness.rs +++ b/src/librustc/ty/constness.rs @@ -95,9 +95,16 @@ pub fn provide<'tcx>(providers: &mut Providers<'tcx>) { } } + fn const_fn_is_allowed_fn_ptr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> bool { + tcx.is_const_fn(def_id) && + tcx.lookup_stability(def_id) + .map(|stab| stab.allow_const_fn_ptr).unwrap_or(false) + } + *providers = Providers { is_const_fn_raw, is_promotable_const_fn, + const_fn_is_allowed_fn_ptr, ..*providers }; } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 56fafacd722be..67be228d232e1 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -438,12 +438,12 @@ bitflags! { // FIXME: Rename this to the actual property since it's used for generators too const HAS_TY_CLOSURE = 1 << 9; - // `true` if there are "names" of types and regions and so forth - // that are local to a particular fn + /// `true` if there are "names" of types and regions and so forth + /// that are local to a particular fn const HAS_FREE_LOCAL_NAMES = 1 << 10; - // Present if the type belongs in a local type context. - // Only set for Infer other than Fresh. + /// Present if the type belongs in a local type context. + /// Only set for Infer other than Fresh. const KEEP_IN_LOCAL_TCX = 1 << 11; // Is there a projection that does not involve a bound region? @@ -462,9 +462,9 @@ bitflags! { TypeFlags::HAS_SELF.bits | TypeFlags::HAS_RE_EARLY_BOUND.bits; - // Flags representing the nominal content of a type, - // computed by FlagsComputation. If you add a new nominal - // flag, it should be added here too. + /// Flags representing the nominal content of a type, + /// computed by FlagsComputation. If you add a new nominal + /// flag, it should be added here too. const NOMINAL_FLAGS = TypeFlags::HAS_PARAMS.bits | TypeFlags::HAS_SELF.bits | TypeFlags::HAS_TY_INFER.bits | diff --git a/src/librustc/ty/subst.rs b/src/librustc/ty/subst.rs index 3ba2c4cbf6c8c..b8ae0430502b5 100644 --- a/src/librustc/ty/subst.rs +++ b/src/librustc/ty/subst.rs @@ -439,16 +439,16 @@ struct SubstFolder<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { tcx: TyCtxt<'a, 'gcx, 'tcx>, substs: &'a [Kind<'tcx>], - // The location for which the substitution is performed, if available. + /// The location for which the substitution is performed, if available. span: Option, - // The root type that is being substituted, if available. + /// The root type that is being substituted, if available. root_ty: Option>, - // Depth of type stack + /// Depth of type stack ty_stack_depth: usize, - // Number of region binders we have passed through while doing the substitution + /// Number of region binders we have passed through while doing the substitution binders_passed: u32, } diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index fe21b19b52a3d..f1b8d532eeb76 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -145,6 +145,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[ ("bmi1", None), ("bmi2", None), ("cmpxchg16b", Some("cmpxchg16b_target_feature")), + ("f16c", Some("f16c_target_feature")), ("fma", None), ("fxsr", None), ("lzcnt", None), diff --git a/src/librustc_mir/transform/qualify_min_const_fn.rs b/src/librustc_mir/transform/qualify_min_const_fn.rs index 776985ab79802..d5f04ca64e4c4 100644 --- a/src/librustc_mir/transform/qualify_min_const_fn.rs +++ b/src/librustc_mir/transform/qualify_min_const_fn.rs @@ -60,13 +60,14 @@ pub fn is_min_const_fn( } for local in &mir.local_decls { - check_ty(tcx, local.ty, local.source_info.span)?; + check_ty(tcx, local.ty, local.source_info.span, def_id)?; } // impl trait is gone in MIR, so check the return type manually check_ty( tcx, tcx.fn_sig(def_id).output().skip_binder(), mir.local_decls.iter().next().unwrap().source_info.span, + def_id, )?; for bb in mir.basic_blocks() { @@ -82,6 +83,7 @@ fn check_ty( tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: ty::Ty<'tcx>, span: Span, + fn_def_id: DefId, ) -> McfResult { for ty in ty.walk() { match ty.sty { @@ -91,7 +93,9 @@ fn check_ty( )), ty::Opaque(..) => return Err((span, "`impl Trait` in const fn is unstable".into())), ty::FnPtr(..) => { - return Err((span, "function pointers in const fn are unstable".into())) + if !tcx.const_fn_is_allowed_fn_ptr(fn_def_id) { + return Err((span, "function pointers in const fn are unstable".into())) + } } ty::Dynamic(preds, _) => { for pred in preds.iter() { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index d91b78c8416b8..487c57172d9b1 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -930,13 +930,13 @@ themePicker.onblur = handleThemeButtonsBlur; static_files::source_serif_pro::BOLD)?; write(cx.dst.join("SourceSerifPro-It.ttf.woff"), static_files::source_serif_pro::ITALIC)?; - write(cx.dst.join("SourceSerifPro-LICENSE.txt"), + write(cx.dst.join("SourceSerifPro-LICENSE.md"), static_files::source_serif_pro::LICENSE)?; write(cx.dst.join("SourceCodePro-Regular.woff"), static_files::source_code_pro::REGULAR)?; write(cx.dst.join("SourceCodePro-Semibold.woff"), static_files::source_code_pro::SEMIBOLD)?; - write(cx.dst.join("SourceCodePro-LICENSE.txt"), + write(cx.dst.join("SourceCodePro-LICENSE.md"), static_files::source_code_pro::LICENSE)?; write(cx.dst.join("LICENSE-MIT.txt"), static_files::LICENSE_MIT)?; diff --git a/src/librustdoc/html/static/FiraSans-LICENSE.txt b/src/librustdoc/html/static/FiraSans-LICENSE.txt index b4a39671ee94d..d444ea92b6f12 100644 --- a/src/librustdoc/html/static/FiraSans-LICENSE.txt +++ b/src/librustdoc/html/static/FiraSans-LICENSE.txt @@ -1,10 +1,5 @@ -Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ -with Reserved Font Name Fira Sans. - -Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ -with Reserved Font Name Fira Mono. - -Copyright (c) 2014, Telefonica S.A. +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: @@ -24,7 +19,7 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The diff --git a/src/librustdoc/html/static/FiraSans-Medium.woff b/src/librustdoc/html/static/FiraSans-Medium.woff index 5627227744ae5..7d742c5fb7d45 100644 Binary files a/src/librustdoc/html/static/FiraSans-Medium.woff and b/src/librustdoc/html/static/FiraSans-Medium.woff differ diff --git a/src/librustdoc/html/static/FiraSans-Regular.woff b/src/librustdoc/html/static/FiraSans-Regular.woff index 9ff40445bf4a6..d8e0363f4e1a0 100644 Binary files a/src/librustdoc/html/static/FiraSans-Regular.woff and b/src/librustdoc/html/static/FiraSans-Regular.woff differ diff --git a/src/librustdoc/html/static/SourceCodePro-LICENSE.txt b/src/librustdoc/html/static/SourceCodePro-LICENSE.md similarity index 99% rename from src/librustdoc/html/static/SourceCodePro-LICENSE.txt rename to src/librustdoc/html/static/SourceCodePro-LICENSE.md index 07542572e33bd..1177330426de9 100644 --- a/src/librustdoc/html/static/SourceCodePro-LICENSE.txt +++ b/src/librustdoc/html/static/SourceCodePro-LICENSE.md @@ -18,7 +18,7 @@ with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, +fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The diff --git a/src/librustdoc/html/static/SourceCodePro-Regular.woff b/src/librustdoc/html/static/SourceCodePro-Regular.woff index 5576670903aea..117c7e5142c38 100644 Binary files a/src/librustdoc/html/static/SourceCodePro-Regular.woff and b/src/librustdoc/html/static/SourceCodePro-Regular.woff differ diff --git a/src/librustdoc/html/static/SourceCodePro-Semibold.woff b/src/librustdoc/html/static/SourceCodePro-Semibold.woff index ca972a11dc428..270873a86a09b 100644 Binary files a/src/librustdoc/html/static/SourceCodePro-Semibold.woff and b/src/librustdoc/html/static/SourceCodePro-Semibold.woff differ diff --git a/src/librustdoc/html/static/SourceSerifPro-Bold.ttf.woff b/src/librustdoc/html/static/SourceSerifPro-Bold.ttf.woff index e283dae58de6b..ca254318fe9ea 100644 Binary files a/src/librustdoc/html/static/SourceSerifPro-Bold.ttf.woff and b/src/librustdoc/html/static/SourceSerifPro-Bold.ttf.woff differ diff --git a/src/librustdoc/html/static/SourceSerifPro-It.ttf.woff b/src/librustdoc/html/static/SourceSerifPro-It.ttf.woff index 4bd621c9bd0ba..a287bbe6ed3f8 100644 Binary files a/src/librustdoc/html/static/SourceSerifPro-It.ttf.woff and b/src/librustdoc/html/static/SourceSerifPro-It.ttf.woff differ diff --git a/src/librustdoc/html/static/SourceSerifPro-LICENSE.txt b/src/librustdoc/html/static/SourceSerifPro-LICENSE.md similarity index 95% rename from src/librustdoc/html/static/SourceSerifPro-LICENSE.txt rename to src/librustdoc/html/static/SourceSerifPro-LICENSE.md index b77d653ad4f0d..22cb755f2f1db 100644 --- a/src/librustdoc/html/static/SourceSerifPro-LICENSE.txt +++ b/src/librustdoc/html/static/SourceSerifPro-LICENSE.md @@ -1,4 +1,4 @@ -Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. +Copyright 2014-2018 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. This Font Software is licensed under the SIL Open Font License, Version 1.1. diff --git a/src/librustdoc/html/static/SourceSerifPro-Regular.ttf.woff b/src/librustdoc/html/static/SourceSerifPro-Regular.ttf.woff index 96b36a0ed2366..a3d55cfdf2555 100644 Binary files a/src/librustdoc/html/static/SourceSerifPro-Regular.ttf.woff and b/src/librustdoc/html/static/SourceSerifPro-Regular.ttf.woff differ diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index a1d8cfacc54ad..24fe61e977a1e 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -91,7 +91,7 @@ pub mod source_serif_pro { pub static ITALIC: &'static [u8] = include_bytes!("static/SourceSerifPro-It.ttf.woff"); /// The file `SourceSerifPro-LICENSE.txt`, the license text for the Source Serif Pro font. - pub static LICENSE: &'static [u8] = include_bytes!("static/SourceSerifPro-LICENSE.txt"); + pub static LICENSE: &'static [u8] = include_bytes!("static/SourceSerifPro-LICENSE.md"); } /// Files related to the Source Code Pro font. @@ -103,7 +103,7 @@ pub mod source_code_pro { pub static SEMIBOLD: &'static [u8] = include_bytes!("static/SourceCodePro-Semibold.woff"); /// The file `SourceCodePro-LICENSE.txt`, the license text of the Source Code Pro font. - pub static LICENSE: &'static [u8] = include_bytes!("static/SourceCodePro-LICENSE.txt"); + pub static LICENSE: &'static [u8] = include_bytes!("static/SourceCodePro-LICENSE.md"); } /// Files related to the sidebar in rustdoc sources. diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 898387cb9f56d..c18a314116bf0 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -9,6 +9,7 @@ use core::task::{Context, Poll}; use core::ops::{Drop, Generator, GeneratorState}; #[doc(inline)] +#[stable(feature = "futures_api", since = "1.36.0")] pub use core::future::*; /// Wrap a generator in a future. diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 62bc1991cc93c..bdec0c347f546 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -263,7 +263,6 @@ #![feature(fixed_size_array)] #![feature(fn_traits)] #![feature(fnbox)] -#![feature(futures_api)] #![feature(generator_trait)] #![feature(hash_raw_entry)] #![feature(hashmap_internals)] @@ -458,18 +457,15 @@ pub mod process; pub mod sync; pub mod time; -#[unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#[stable(feature = "futures_api", since = "1.36.0")] pub mod task { //! Types and Traits for working with asynchronous tasks. #[doc(inline)] + #[stable(feature = "futures_api", since = "1.36.0")] pub use core::task::*; } -#[unstable(feature = "futures_api", - reason = "futures in libcore are unstable", - issue = "50547")] +#[stable(feature = "futures_api", since = "1.36.0")] pub mod future; // Platform-abstraction modules diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index 5a8101e230119..7a3b5d30500a9 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -319,7 +319,7 @@ impl fmt::Debug for AssertUnwindSafe { } } -#[unstable(feature = "futures_api", issue = "50547")] +#[stable(feature = "futures_api", since = "1.36.0")] impl Future for AssertUnwindSafe { type Output = F::Output; diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index 74c952b076cd7..db821f4e5369d 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -114,6 +114,8 @@ pub struct Stability { pub const_stability: Option, /// whether the function has a `#[rustc_promotable]` attribute pub promotable: bool, + /// whether the function has a `#[rustc_allow_const_fn_ptr]` attribute + pub allow_const_fn_ptr: bool, } /// The available stability levels. @@ -178,6 +180,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, let mut rustc_depr: Option = None; let mut rustc_const_unstable: Option = None; let mut promotable = false; + let mut allow_const_fn_ptr = false; let diagnostic = &sess.span_diagnostic; 'outer: for attr in attrs_iter { @@ -187,6 +190,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, "unstable", "stable", "rustc_promotable", + "rustc_allow_const_fn_ptr", ].iter().any(|&s| attr.path == s) { continue // not a stability level } @@ -198,6 +202,9 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, if attr.path == "rustc_promotable" { promotable = true; } + if attr.path == "rustc_allow_const_fn_ptr" { + allow_const_fn_ptr = true; + } // attributes with data else if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta { let meta = meta.as_ref().unwrap(); @@ -354,6 +361,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, rustc_depr: None, const_stability: None, promotable: false, + allow_const_fn_ptr: false, }) } (None, _, _) => { @@ -418,6 +426,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, rustc_depr: None, const_stability: None, promotable: false, + allow_const_fn_ptr: false, }) } (None, _) => { @@ -458,13 +467,14 @@ fn find_stability_generic<'a, I>(sess: &ParseSess, } // Merge the const-unstable info into the stability info - if promotable { + if promotable || allow_const_fn_ptr { if let Some(ref mut stab) = stab { - stab.promotable = true; + stab.promotable = promotable; + stab.allow_const_fn_ptr = allow_const_fn_ptr; } else { span_err!(diagnostic, item_sp, E0717, - "rustc_promotable attribute must be paired with \ - either stable or unstable attribute"); + "rustc_promotable and rustc_allow_const_fn_ptr attributes \ + must be paired with either stable or unstable attribute"); } } diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs index 1ffecea44edf2..c806020039d26 100644 --- a/src/libsyntax_pos/hygiene.rs +++ b/src/libsyntax_pos/hygiene.rs @@ -24,11 +24,11 @@ struct SyntaxContextData { outer_mark: Mark, transparency: Transparency, prev_ctxt: SyntaxContext, - // This context, but with all transparent and semi-transparent marks filtered away. + /// This context, but with all transparent and semi-transparent marks filtered away. opaque: SyntaxContext, - // This context, but with all transparent marks filtered away. + /// This context, but with all transparent marks filtered away. opaque_and_semitransparent: SyntaxContext, - // Name of the crate to which `$crate` with this context would resolve. + /// Name of the crate to which `$crate` with this context would resolve. dollar_crate_name: Symbol, } diff --git a/src/test/codegen-units/item-collection/cross-crate-closures.rs b/src/test/codegen-units/item-collection/cross-crate-closures.rs index bd04422c39f76..6af344fab1512 100644 --- a/src/test/codegen-units/item-collection/cross-crate-closures.rs +++ b/src/test/codegen-units/item-collection/cross-crate-closures.rs @@ -3,7 +3,6 @@ // ignoring this test until MIR codegen has taken over completely // ignore-test -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs b/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs index cf7bde4a091d2..e1991046d4366 100644 --- a/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs +++ b/src/test/codegen-units/item-collection/cross-crate-generic-functions.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs b/src/test/codegen-units/item-collection/cross-crate-trait-method.rs index 8a19a7bd9f8fa..442438b64b66f 100644 --- a/src/test/codegen-units/item-collection/cross-crate-trait-method.rs +++ b/src/test/codegen-units/item-collection/cross-crate-trait-method.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/function-as-argument.rs b/src/test/codegen-units/item-collection/function-as-argument.rs index bdf6826f21aa8..3f61f124d2409 100644 --- a/src/test/codegen-units/item-collection/function-as-argument.rs +++ b/src/test/codegen-units/item-collection/function-as-argument.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/generic-functions.rs b/src/test/codegen-units/item-collection/generic-functions.rs index f879724c9a16c..8390970420482 100644 --- a/src/test/codegen-units/item-collection/generic-functions.rs +++ b/src/test/codegen-units/item-collection/generic-functions.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/generic-impl.rs b/src/test/codegen-units/item-collection/generic-impl.rs index 01b4e5301833e..571bb4fa867cb 100644 --- a/src/test/codegen-units/item-collection/generic-impl.rs +++ b/src/test/codegen-units/item-collection/generic-impl.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs b/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs index 702ecba321e3e..e45644cd37562 100644 --- a/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs +++ b/src/test/codegen-units/item-collection/impl-in-non-instantiated-generic.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/items-within-generic-items.rs b/src/test/codegen-units/item-collection/items-within-generic-items.rs index 748b6094a2a40..10bc52f6a8d22 100644 --- a/src/test/codegen-units/item-collection/items-within-generic-items.rs +++ b/src/test/codegen-units/item-collection/items-within-generic-items.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/non-generic-functions.rs b/src/test/codegen-units/item-collection/non-generic-functions.rs index e147b54fdaf08..26d2fb1b42194 100644 --- a/src/test/codegen-units/item-collection/non-generic-functions.rs +++ b/src/test/codegen-units/item-collection/non-generic-functions.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/overloaded-operators.rs b/src/test/codegen-units/item-collection/overloaded-operators.rs index db91486012ddf..2358d38942a71 100644 --- a/src/test/codegen-units/item-collection/overloaded-operators.rs +++ b/src/test/codegen-units/item-collection/overloaded-operators.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/static-init.rs b/src/test/codegen-units/item-collection/static-init.rs index 397bccc4bf834..f6005eed43c7d 100644 --- a/src/test/codegen-units/item-collection/static-init.rs +++ b/src/test/codegen-units/item-collection/static-init.rs @@ -1,5 +1,4 @@ // compile-flags:-Zprint-mono-items=eager -// ignore-tidy-linelength #![feature(start)] diff --git a/src/test/codegen-units/item-collection/statics-and-consts.rs b/src/test/codegen-units/item-collection/statics-and-consts.rs index db2d83aeefabd..7e28ba58b63fa 100644 --- a/src/test/codegen-units/item-collection/statics-and-consts.rs +++ b/src/test/codegen-units/item-collection/statics-and-consts.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/trait-implementations.rs b/src/test/codegen-units/item-collection/trait-implementations.rs index 004198a624ef6..f090c0c8d130a 100644 --- a/src/test/codegen-units/item-collection/trait-implementations.rs +++ b/src/test/codegen-units/item-collection/trait-implementations.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/trait-method-as-argument.rs b/src/test/codegen-units/item-collection/trait-method-as-argument.rs index cab4a70913422..27ace8e31add3 100644 --- a/src/test/codegen-units/item-collection/trait-method-as-argument.rs +++ b/src/test/codegen-units/item-collection/trait-method-as-argument.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/trait-method-default-impl.rs b/src/test/codegen-units/item-collection/trait-method-default-impl.rs index ba99d430acc62..11f6cc62d49e3 100644 --- a/src/test/codegen-units/item-collection/trait-method-default-impl.rs +++ b/src/test/codegen-units/item-collection/trait-method-default-impl.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs index 5fae72f711d75..ec6be0ecf43ef 100644 --- a/src/test/codegen-units/item-collection/unreferenced-const-fn.rs +++ b/src/test/codegen-units/item-collection/unreferenced-const-fn.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=lazy #![deny(dead_code)] diff --git a/src/test/codegen-units/item-collection/unreferenced-inline-function.rs b/src/test/codegen-units/item-collection/unreferenced-inline-function.rs index 4c8d1215c0425..4d095e4d6c7e9 100644 --- a/src/test/codegen-units/item-collection/unreferenced-inline-function.rs +++ b/src/test/codegen-units/item-collection/unreferenced-inline-function.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=lazy // N.B., we do not expect *any* monomorphization to be generated here. diff --git a/src/test/codegen-units/item-collection/unsizing.rs b/src/test/codegen-units/item-collection/unsizing.rs index 6b2acab7f7b73..fd794df37608b 100644 --- a/src/test/codegen-units/item-collection/unsizing.rs +++ b/src/test/codegen-units/item-collection/unsizing.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager // compile-flags:-Zinline-in-all-cgus diff --git a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs b/src/test/codegen-units/item-collection/unused-traits-and-generics.rs index 598efdbdad1bc..4a5e294ea0f4a 100644 --- a/src/test/codegen-units/item-collection/unused-traits-and-generics.rs +++ b/src/test/codegen-units/item-collection/unused-traits-and-generics.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags:-Zprint-mono-items=eager #![crate_type="lib"] diff --git a/src/test/codegen-units/partitioning/statics.rs b/src/test/codegen-units/partitioning/statics.rs index 40483318795b1..bbded480b0c15 100644 --- a/src/test/codegen-units/partitioning/statics.rs +++ b/src/test/codegen-units/partitioning/statics.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // We specify -Z incremental here because we want to test the partitioning for // incremental compilation // compile-flags:-Zprint-mono-items=lazy -Zincremental=tmp/partitioning-tests/statics diff --git a/src/test/codegen/adjustments.rs b/src/test/codegen/adjustments.rs index b8398f6ac8421..ae2ff9994fdf0 100644 --- a/src/test/codegen/adjustments.rs +++ b/src/test/codegen/adjustments.rs @@ -1,5 +1,4 @@ // compile-flags: -C no-prepopulate-passes -// ignore-tidy-linelength #![crate_type = "lib"] diff --git a/src/test/codegen/enum-debug-niche.rs b/src/test/codegen/enum-debug-niche.rs index 93eebde7b8f42..2272488375fdd 100644 --- a/src/test/codegen/enum-debug-niche.rs +++ b/src/test/codegen/enum-debug-niche.rs @@ -2,7 +2,6 @@ // before 7.0, then backported to the Rust LLVM fork. It tests that // optimized enum debug info accurately reflects the enum layout. -// ignore-tidy-linelength // ignore-windows // min-system-llvm-version 8.0 diff --git a/src/test/codegen/enum-debug-tagged.rs b/src/test/codegen/enum-debug-tagged.rs index 84976ce97af4b..3539aae42eae7 100644 --- a/src/test/codegen/enum-debug-tagged.rs +++ b/src/test/codegen/enum-debug-tagged.rs @@ -2,7 +2,6 @@ // before 7.0, then backported to the Rust LLVM fork. It tests that // debug info for tagged (ordinary) enums is properly emitted. -// ignore-tidy-linelength // ignore-windows // min-system-llvm-version 8.0 diff --git a/src/test/codegen/generic-debug.rs b/src/test/codegen/generic-debug.rs index 0bee2a1a8689f..eea16805c5968 100644 --- a/src/test/codegen/generic-debug.rs +++ b/src/test/codegen/generic-debug.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // ignore-windows // compile-flags: -g -C no-prepopulate-passes diff --git a/src/test/codegen/mainsubprogram.rs b/src/test/codegen/mainsubprogram.rs index d886cb88004cb..7f1b0e17f871e 100644 --- a/src/test/codegen/mainsubprogram.rs +++ b/src/test/codegen/mainsubprogram.rs @@ -1,7 +1,6 @@ // This test depends on a patch that was committed to upstream LLVM // before 4.0, formerly backported to the Rust LLVM fork. -// ignore-tidy-linelength // ignore-windows // ignore-macos diff --git a/src/test/codegen/mainsubprogramstart.rs b/src/test/codegen/mainsubprogramstart.rs index d91f91ee7ab68..b03290af0e3b7 100644 --- a/src/test/codegen/mainsubprogramstart.rs +++ b/src/test/codegen/mainsubprogramstart.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // ignore-windows // ignore-macos diff --git a/src/test/codegen/noreturn-uninhabited.rs b/src/test/codegen/noreturn-uninhabited.rs index 1b65da9f2877a..49f93cf62c754 100644 --- a/src/test/codegen/noreturn-uninhabited.rs +++ b/src/test/codegen/noreturn-uninhabited.rs @@ -1,5 +1,4 @@ // compile-flags: -g -C no-prepopulate-passes -// ignore-tidy-linelength #![crate_type = "lib"] diff --git a/src/test/codegen/noreturnflag.rs b/src/test/codegen/noreturnflag.rs index fc288eb0cf1e2..95c100571ce6e 100644 --- a/src/test/codegen/noreturnflag.rs +++ b/src/test/codegen/noreturnflag.rs @@ -1,5 +1,4 @@ // compile-flags: -g -C no-prepopulate-passes -// ignore-tidy-linelength #![crate_type = "lib"] diff --git a/src/test/codegen/panic-abort-windows.rs b/src/test/codegen/panic-abort-windows.rs index e2d942e869992..bbe0d81de3d42 100644 --- a/src/test/codegen/panic-abort-windows.rs +++ b/src/test/codegen/panic-abort-windows.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // This test is for *-windows-msvc only. // ignore-android // ignore-bitrig diff --git a/src/test/codegen/refs.rs b/src/test/codegen/refs.rs index 9583730e9dd5b..cbb9942347673 100644 --- a/src/test/codegen/refs.rs +++ b/src/test/codegen/refs.rs @@ -1,5 +1,4 @@ // compile-flags: -C no-prepopulate-passes -// ignore-tidy-linelength #![crate_type = "lib"] diff --git a/src/test/codegen/remap_path_prefix/xcrate-generic.rs b/src/test/codegen/remap_path_prefix/xcrate-generic.rs index 70d29577b2f2c..30d6112fd02f6 100644 --- a/src/test/codegen/remap_path_prefix/xcrate-generic.rs +++ b/src/test/codegen/remap_path_prefix/xcrate-generic.rs @@ -1,5 +1,4 @@ // ignore-windows -// ignore-tidy-linelength // compile-flags: -g -C metadata=foo -C no-prepopulate-passes // aux-build:xcrate-generic.rs diff --git a/src/test/codegen/vtabletype.rs b/src/test/codegen/vtabletype.rs index 70b97a67bbcfd..82d65b101b06d 100644 --- a/src/test/codegen/vtabletype.rs +++ b/src/test/codegen/vtabletype.rs @@ -1,7 +1,6 @@ // This test depends on a patch that was committed to upstream LLVM // after 5.0, then backported to the Rust LLVM fork. -// ignore-tidy-linelength // ignore-windows // ignore-macos diff --git a/src/test/compile-fail/must_use-in-stdlib-traits.rs b/src/test/compile-fail/must_use-in-stdlib-traits.rs index 503b39e181ab7..39472ae11fbc5 100644 --- a/src/test/compile-fail/must_use-in-stdlib-traits.rs +++ b/src/test/compile-fail/must_use-in-stdlib-traits.rs @@ -1,5 +1,5 @@ #![deny(unused_must_use)] -#![feature(arbitrary_self_types, futures_api)] +#![feature(arbitrary_self_types)] use std::iter::Iterator; use std::future::Future; diff --git a/src/test/debuginfo/enum-thinlto.rs b/src/test/debuginfo/enum-thinlto.rs index 7f15ed90e67b3..13577b0587ff0 100644 --- a/src/test/debuginfo/enum-thinlto.rs +++ b/src/test/debuginfo/enum-thinlto.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // Require LLVM with DW_TAG_variant_part and a gdb that can read it. // min-system-llvm-version: 8.0 // min-gdb-version: 8.2 diff --git a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs index e26294cb730a0..72d38a6f04544 100644 --- a/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs +++ b/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // ignore-lldb: FIXME(#27089) // min-lldb-version: 310 diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs index 8fb83b7956be3..4f75ef4fa9b9a 100644 --- a/src/test/debuginfo/recursive-struct.rs +++ b/src/test/debuginfo/recursive-struct.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // ignore-lldb // Require LLVM with DW_TAG_variant_part and a gdb that can read it. diff --git a/src/test/debuginfo/unique-enum.rs b/src/test/debuginfo/unique-enum.rs index 32bd93f1ed2ce..c440ce059f721 100644 --- a/src/test/debuginfo/unique-enum.rs +++ b/src/test/debuginfo/unique-enum.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // Require LLVM with DW_TAG_variant_part and a gdb and lldb that can // read it. // min-system-llvm-version: 8.0 diff --git a/src/test/incremental/remapped_paths_cc/auxiliary/extern_crate.rs b/src/test/incremental/remapped_paths_cc/auxiliary/extern_crate.rs index 52e7f4bd7c782..627b99445ea81 100644 --- a/src/test/incremental/remapped_paths_cc/auxiliary/extern_crate.rs +++ b/src/test/incremental/remapped_paths_cc/auxiliary/extern_crate.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - //[rpass1] compile-flags: -g //[rpass2] compile-flags: -g //[rpass3] compile-flags: -g --remap-path-prefix={{src-base}}=/the/src diff --git a/src/test/mir-opt/basic_assignment.rs b/src/test/mir-opt/basic_assignment.rs index c771013f72814..ca0e9fa811a26 100644 --- a/src/test/mir-opt/basic_assignment.rs +++ b/src/test/mir-opt/basic_assignment.rs @@ -5,8 +5,6 @@ // so subtle breakage in them can leave a quite hard-to-find trail of // destruction. -// ignore-tidy-linelength - fn main() { let nodrop_x = false; let nodrop_y; diff --git a/src/test/mir-opt/nll/named-lifetimes-basic.rs b/src/test/mir-opt/nll/named-lifetimes-basic.rs index 4833ba19554b9..2a6c2db03bec1 100644 --- a/src/test/mir-opt/nll/named-lifetimes-basic.rs +++ b/src/test/mir-opt/nll/named-lifetimes-basic.rs @@ -5,7 +5,6 @@ // compile-flags:-Zborrowck=mir -Zverbose // ^^^^^^^^^ force compiler to dump more region information -// ignore-tidy-linelength #![allow(warnings)] diff --git a/src/test/mir-opt/storage_ranges.rs b/src/test/mir-opt/storage_ranges.rs index 9a22f57116ed8..c099b1dccb668 100644 --- a/src/test/mir-opt/storage_ranges.rs +++ b/src/test/mir-opt/storage_ranges.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - fn main() { let a = 0; { diff --git a/src/test/run-pass/async-await.rs b/src/test/run-pass/async-await.rs index 518452aefc152..e1b4328debd9a 100644 --- a/src/test/run-pass/async-await.rs +++ b/src/test/run-pass/async-await.rs @@ -1,7 +1,7 @@ // edition:2018 // aux-build:arc_wake.rs -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] extern crate arc_wake; diff --git a/src/test/run-pass/auxiliary/arc_wake.rs b/src/test/run-pass/auxiliary/arc_wake.rs index 93e074e7ee55c..c21886f26f467 100644 --- a/src/test/run-pass/auxiliary/arc_wake.rs +++ b/src/test/run-pass/auxiliary/arc_wake.rs @@ -1,7 +1,5 @@ // edition:2018 -#![feature(futures_api)] - use std::sync::Arc; use std::task::{ Waker, RawWaker, RawWakerVTable, diff --git a/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs b/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs index fb0bc3c436d9b..6d5a9876c373c 100644 --- a/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs +++ b/src/test/run-pass/functions-closures/closure-expected-type/expect-infer-supply-two-infers.rs @@ -12,7 +12,7 @@ fn expect_free_supply_free<'x>(x: &'x u32) { x.push(22_u32); // ...since we now know the type of `y` and can resolve the method call. - y.wrapping_add(1); + let _ = y.wrapping_add(1); }); } diff --git a/src/test/run-pass/futures-api.rs b/src/test/run-pass/futures-api.rs index 6094f15569bb6..ee77053fd5b6a 100644 --- a/src/test/run-pass/futures-api.rs +++ b/src/test/run-pass/futures-api.rs @@ -1,7 +1,5 @@ // aux-build:arc_wake.rs -#![feature(futures_api)] - extern crate arc_wake; use std::future::Future; diff --git a/src/test/run-pass/issue-55809.rs b/src/test/run-pass/issue-55809.rs index 86b0977bebe1d..12be6582a21e8 100644 --- a/src/test/run-pass/issue-55809.rs +++ b/src/test/run-pass/issue-55809.rs @@ -1,7 +1,7 @@ // edition:2018 // run-pass -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] trait Foo { } diff --git a/src/test/run-pass/issues/issue-16278.rs b/src/test/run-pass/issues/issue-16278.rs index ad9af8473defe..2f47b694ae912 100644 --- a/src/test/run-pass/issues/issue-16278.rs +++ b/src/test/run-pass/issues/issue-16278.rs @@ -3,8 +3,8 @@ // this file has some special \r\n endings (use xxd to see them) -fn main() {assert_eq!(b"", b"\ +fn main() {assert_eq!(b"", b"\ "); -assert_eq!(b"\n", b" +assert_eq!(b"\n", b" "); } diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs index 5891a553e3255..c7a13bbf606cb 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.rs @@ -1,5 +1,3 @@ -// ignore-tidy-end-whitespace - #![deny(intra_doc_link_resolution_failure)] // An error in calculating spans while reporting intra-doc link resolution errors caused rustdoc to diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr index 7ee9ca4792395..79702a1a546b7 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr @@ -1,11 +1,11 @@ error: `[i]` cannot be resolved, ignoring it... - --> $DIR/intra-link-span-ice-55723.rs:11:10 + --> $DIR/intra-link-span-ice-55723.rs:9:10 | LL | /// (arr[i]) | ^ cannot be resolved, ignoring | note: lint level defined here - --> $DIR/intra-link-span-ice-55723.rs:3:9 + --> $DIR/intra-link-span-ice-55723.rs:1:9 | LL | #![deny(intra_doc_link_resolution_failure)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc/async-fn.rs b/src/test/rustdoc/async-fn.rs index ba4997a7f9b5b..7384f7027d185 100644 --- a/src/test/rustdoc/async-fn.rs +++ b/src/test/rustdoc/async-fn.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(async_await, futures_api)] +#![feature(async_await)] // @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option' pub async fn foo() -> Option { diff --git a/src/test/rustdoc/empty-mod-private.rs b/src/test/rustdoc/empty-mod-private.rs index 12576a1b535f7..c2a98049a48cb 100644 --- a/src/test/rustdoc/empty-mod-private.rs +++ b/src/test/rustdoc/empty-mod-private.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags: --document-private-items // @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo' diff --git a/src/test/rustdoc/extern-html-root-url.rs b/src/test/rustdoc/extern-html-root-url.rs index 674d0305f2eae..60b7b28ae4acf 100644 --- a/src/test/rustdoc/extern-html-root-url.rs +++ b/src/test/rustdoc/extern-html-root-url.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // compile-flags:-Z unstable-options --extern-html-root-url core=https://example.com/core/0.1.0 // @has extern_html_root_url/index.html diff --git a/src/test/rustdoc/method-list.rs b/src/test/rustdoc/method-list.rs index f84be3eb3f718..9f24e817fd3eb 100644 --- a/src/test/rustdoc/method-list.rs +++ b/src/test/rustdoc/method-list.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![crate_name = "foo"] // @has foo/struct.Foo.html diff --git a/src/test/rustdoc/pub-method.rs b/src/test/rustdoc/pub-method.rs index 01e5141fe2584..8e88b2b59015d 100644 --- a/src/test/rustdoc/pub-method.rs +++ b/src/test/rustdoc/pub-method.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // compile-flags: --document-private-items #![crate_name = "foo"] diff --git a/src/test/ui/async-fn-multiple-lifetimes.rs b/src/test/ui/async-fn-multiple-lifetimes.rs index fccc4fdb91725..e3ac817b15ca5 100644 --- a/src/test/ui/async-fn-multiple-lifetimes.rs +++ b/src/test/ui/async-fn-multiple-lifetimes.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)] +#![feature(arbitrary_self_types, async_await, await_macro, pin)] use std::ops::Add; diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr index 8370aad6f3046..40786c032b180 100644 --- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:32:15 + --> $DIR/two-phase-activation-sharing-interference.rs:30:15 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -10,7 +10,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:40:13 + --> $DIR/two-phase-activation-sharing-interference.rs:38:13 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -21,7 +21,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:51:13 + --> $DIR/two-phase-activation-sharing-interference.rs:49:13 | LL | let y = &mut x; | ------ mutable borrow occurs here @@ -32,7 +32,7 @@ LL | *y += 1; | ------- mutable borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/two-phase-activation-sharing-interference.rs:62:14 + --> $DIR/two-phase-activation-sharing-interference.rs:60:14 | LL | let y = &mut x; | ------ mutable borrow occurs here diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs index 55a8ae7a49ef3..4d77ac915b1e7 100644 --- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs +++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // revisions: nll_target // The following revisions are disabled due to missing support from two-phase beyond autorefs diff --git a/src/test/ui/consts/const-array-oob.rs b/src/test/ui/consts/const-array-oob.rs index 39ef45175f9e3..1174a76adabcb 100644 --- a/src/test/ui/consts/const-array-oob.rs +++ b/src/test/ui/consts/const-array-oob.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(const_indexing)] const FOO: [usize; 3] = [1, 2, 3]; diff --git a/src/test/ui/consts/const-array-oob.stderr b/src/test/ui/consts/const-array-oob.stderr index 2d9a4fd0dea27..f25cac5cddd47 100644 --- a/src/test/ui/consts/const-array-oob.stderr +++ b/src/test/ui/consts/const-array-oob.stderr @@ -1,5 +1,5 @@ error[E0080]: evaluation of constant value failed - --> $DIR/const-array-oob.rs:8:19 + --> $DIR/const-array-oob.rs:6:19 | LL | const BLUB: [u32; FOO[4]] = [5, 6]; | ^^^^^^ index out of bounds: the len is 3 but the index is 4 diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs new file mode 100644 index 0000000000000..3992607c387e1 --- /dev/null +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs @@ -0,0 +1,10 @@ +#![feature(rustc_attrs, staged_api)] + +#[stable(feature = "rust1", since = "1.0.0")] +const fn error(_: fn()) {} //~ ERROR function pointers in const fn are unstable + +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_allow_const_fn_ptr] +const fn compiles(_: fn()) {} + +fn main() {} diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr new file mode 100644 index 0000000000000..ed9cba9fa2fc4 --- /dev/null +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr @@ -0,0 +1,11 @@ +error[E0723]: function pointers in const fn are unstable (see issue #57563) + --> $DIR/allow_const_fn_ptr.rs:4:16 + | +LL | const fn error(_: fn()) {} + | ^ + | + = help: add #![feature(const_fn)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0723`. diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs new file mode 100644 index 0000000000000..0395795ef7bfe --- /dev/null +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs @@ -0,0 +1,11 @@ +#![feature(staged_api)] + +#[stable(feature = "rust1", since = "1.0.0")] +const fn error(_: fn()) {} + +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_allow_const_fn_ptr] +//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved +const fn compiles(_: fn()) {} + +fn main() {} diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr new file mode 100644 index 0000000000000..c934307e918b9 --- /dev/null +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr @@ -0,0 +1,12 @@ +error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics + --> $DIR/allow_const_fn_ptr_feature_gate.rs:7:3 + | +LL | #[rustc_allow_const_fn_ptr] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: for more information, see https://github.com/rust-lang/rust/issues/29642 + = help: add #![feature(rustc_attrs)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs new file mode 100644 index 0000000000000..1d8b95ab1a2fd --- /dev/null +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_run_pass.rs @@ -0,0 +1,18 @@ +// run-pass + +#![feature(rustc_attrs, staged_api)] +#![stable(feature = "rust1", since = "1.0.0")] + +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_allow_const_fn_ptr] +const fn takes_fn_ptr(_: fn()) {} + +const FN: fn() = || (); + +const fn gives_fn_ptr() { + takes_fn_ptr(FN) +} + +fn main() { + gives_fn_ptr(); +} diff --git a/src/test/ui/deprecation/deprecation-in-future.rs b/src/test/ui/deprecation/deprecation-in-future.rs index 138d902621cbc..c4f9fdce74907 100644 --- a/src/test/ui/deprecation/deprecation-in-future.rs +++ b/src/test/ui/deprecation/deprecation-in-future.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // run-pass #![deny(deprecated_in_future)] diff --git a/src/test/ui/deprecation/deprecation-in-future.stderr b/src/test/ui/deprecation/deprecation-in-future.stderr index 81d2461c1bd83..2284cfa8d685b 100644 --- a/src/test/ui/deprecation/deprecation-in-future.stderr +++ b/src/test/ui/deprecation/deprecation-in-future.stderr @@ -1,5 +1,5 @@ warning: use of deprecated item 'deprecated_future': text - --> $DIR/deprecation-in-future.rs:11:5 + --> $DIR/deprecation-in-future.rs:9:5 | LL | deprecated_future(); // ok; deprecated_in_future only applies to rustc_deprecated | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.rs b/src/test/ui/derives/deriving-meta-unknown-trait.rs index 2b29f10150b96..f4a6f3fd62a05 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.rs +++ b/src/test/ui/derives/deriving-meta-unknown-trait.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #[derive(Eqr)] //~^ ERROR cannot find derive macro `Eqr` in this scope struct Foo; diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index 2b121ac679ae0..cf0173dfad5cd 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -1,5 +1,5 @@ error: cannot find derive macro `Eqr` in this scope - --> $DIR/deriving-meta-unknown-trait.rs:3:10 + --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] | ^^^ help: try: `Eq` diff --git a/src/test/ui/discrim/discrim-overflow-2.rs b/src/test/ui/discrim/discrim-overflow-2.rs index 9ff39cd048454..f8f565f4d9c14 100644 --- a/src/test/ui/discrim/discrim-overflow-2.rs +++ b/src/test/ui/discrim/discrim-overflow-2.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // Issue 23030: Detect overflowing discriminant // // Check that we detect the overflow even if enum is not used. diff --git a/src/test/ui/discrim/discrim-overflow-2.stderr b/src/test/ui/discrim/discrim-overflow-2.stderr index 744324d1f0ff5..198ebe9eb51f9 100644 --- a/src/test/ui/discrim/discrim-overflow-2.stderr +++ b/src/test/ui/discrim/discrim-overflow-2.stderr @@ -1,5 +1,5 @@ error[E0370]: enum discriminant overflowed - --> $DIR/discrim-overflow-2.rs:17:9 + --> $DIR/discrim-overflow-2.rs:15: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:26:9 + --> $DIR/discrim-overflow-2.rs:24: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:35:9 + --> $DIR/discrim-overflow-2.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-2.rs:44:9 + --> $DIR/discrim-overflow-2.rs:42: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:53:9 + --> $DIR/discrim-overflow-2.rs:51: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:62:9 + --> $DIR/discrim-overflow-2.rs:60: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:71:9 + --> $DIR/discrim-overflow-2.rs:69: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:80:9 + --> $DIR/discrim-overflow-2.rs:78:9 | LL | OhNo, | ^^^^ overflowed on value after 18446744073709551615 diff --git a/src/test/ui/discrim/discrim-overflow.rs b/src/test/ui/discrim/discrim-overflow.rs index c612661178cf6..d8a9dacfa5180 100644 --- a/src/test/ui/discrim/discrim-overflow.rs +++ b/src/test/ui/discrim/discrim-overflow.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - // Issue 23030: Detect overflowing discriminant // See also run-pass/discrim-explicit-23030.rs where the suggested diff --git a/src/test/ui/discrim/discrim-overflow.stderr b/src/test/ui/discrim/discrim-overflow.stderr index c831fdfe1a34d..a2ae4863f9f79 100644 --- a/src/test/ui/discrim/discrim-overflow.stderr +++ b/src/test/ui/discrim/discrim-overflow.stderr @@ -1,5 +1,5 @@ error[E0370]: enum discriminant overflowed - --> $DIR/discrim-overflow.rs:15:9 + --> $DIR/discrim-overflow.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.rs:26:9 + --> $DIR/discrim-overflow.rs:24: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:37:9 + --> $DIR/discrim-overflow.rs:35: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:48:9 + --> $DIR/discrim-overflow.rs:46: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:60:9 + --> $DIR/discrim-overflow.rs:58: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:72:9 + --> $DIR/discrim-overflow.rs:70: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:84:9 + --> $DIR/discrim-overflow.rs:82: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:96:9 + --> $DIR/discrim-overflow.rs:94:9 | LL | OhNo, | ^^^^ overflowed on value after 18446744073709551615 diff --git a/src/test/ui/editions/edition-deny-async-fns-2015.rs b/src/test/ui/editions/edition-deny-async-fns-2015.rs index 2105aa5835d0d..e1111f9e0e4b9 100644 --- a/src/test/ui/editions/edition-deny-async-fns-2015.rs +++ b/src/test/ui/editions/edition-deny-async-fns-2015.rs @@ -1,6 +1,6 @@ // edition:2015 -#![feature(futures_api, async_await)] +#![feature(async_await)] async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition diff --git a/src/test/ui/editions/edition-raw-pointer-method-2015.rs b/src/test/ui/editions/edition-raw-pointer-method-2015.rs index a538bca75f67d..3631415fc5f98 100644 --- a/src/test/ui/editions/edition-raw-pointer-method-2015.rs +++ b/src/test/ui/editions/edition-raw-pointer-method-2015.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // edition:2015 // tests that editions work with the tyvar warning-turned-error diff --git a/src/test/ui/editions/edition-raw-pointer-method-2015.stderr b/src/test/ui/editions/edition-raw-pointer-method-2015.stderr index deea6a71b24f3..508d5df2a7160 100644 --- a/src/test/ui/editions/edition-raw-pointer-method-2015.stderr +++ b/src/test/ui/editions/edition-raw-pointer-method-2015.stderr @@ -1,11 +1,11 @@ error: type annotations needed - --> $DIR/edition-raw-pointer-method-2015.rs:10:15 + --> $DIR/edition-raw-pointer-method-2015.rs:9:15 | LL | let _ = y.is_null(); | ^^^^^^^ | note: lint level defined here - --> $DIR/edition-raw-pointer-method-2015.rs:6:8 + --> $DIR/edition-raw-pointer-method-2015.rs:5:8 | LL | #[deny(warnings)] | ^^^^^^^^ diff --git a/src/test/ui/editions/edition-raw-pointer-method-2018.rs b/src/test/ui/editions/edition-raw-pointer-method-2018.rs index eabab5e4739ab..af0b2d6bd4aa6 100644 --- a/src/test/ui/editions/edition-raw-pointer-method-2018.rs +++ b/src/test/ui/editions/edition-raw-pointer-method-2018.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength // edition:2018 // tests that editions work with the tyvar warning-turned-error diff --git a/src/test/ui/editions/edition-raw-pointer-method-2018.stderr b/src/test/ui/editions/edition-raw-pointer-method-2018.stderr index 03e7f3a9449d6..23452495b4bc6 100644 --- a/src/test/ui/editions/edition-raw-pointer-method-2018.stderr +++ b/src/test/ui/editions/edition-raw-pointer-method-2018.stderr @@ -1,5 +1,5 @@ error[E0699]: the type of this value must be known to call a method on a raw pointer on it - --> $DIR/edition-raw-pointer-method-2018.rs:10:15 + --> $DIR/edition-raw-pointer-method-2018.rs:9:15 | LL | let _ = y.is_null(); | ^^^^^^^ diff --git a/src/test/ui/error-codes/E0375.rs b/src/test/ui/error-codes/E0375.rs index 362854a53aa63..0c03a8761df01 100644 --- a/src/test/ui/error-codes/E0375.rs +++ b/src/test/ui/error-codes/E0375.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(coerce_unsized)] use std::ops::CoerceUnsized; diff --git a/src/test/ui/error-codes/E0375.stderr b/src/test/ui/error-codes/E0375.stderr index 18416e9b7d8b9..a68b3af5aaf76 100644 --- a/src/test/ui/error-codes/E0375.stderr +++ b/src/test/ui/error-codes/E0375.stderr @@ -1,5 +1,5 @@ error[E0375]: implementing the trait `CoerceUnsized` requires multiple coercions - --> $DIR/E0375.rs:12:12 + --> $DIR/E0375.rs:10:12 | LL | impl CoerceUnsized> for Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^ requires multiple coercions diff --git a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs index b6ab8ae0a9bc7..801aeb82aa266 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs +++ b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs @@ -1,7 +1,5 @@ // edition:2015 -#![feature(futures_api)] - async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition //~^ ERROR async fn is unstable diff --git a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr index cec211fef1351..b419f1232dfab 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr +++ b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr @@ -1,23 +1,23 @@ error[E0670]: `async fn` is not permitted in the 2015 edition - --> $DIR/feature-gate-async-await-2015-edition.rs:5:1 + --> $DIR/feature-gate-async-await-2015-edition.rs:3:1 | LL | async fn foo() {} | ^^^^^ error[E0422]: cannot find struct, variant or union type `async` in this scope - --> $DIR/feature-gate-async-await-2015-edition.rs:9:13 + --> $DIR/feature-gate-async-await-2015-edition.rs:7:13 | LL | let _ = async {}; | ^^^^^ not found in this scope error[E0425]: cannot find value `async` in this scope - --> $DIR/feature-gate-async-await-2015-edition.rs:10:13 + --> $DIR/feature-gate-async-await-2015-edition.rs:8:13 | LL | let _ = async || { true }; | ^^^^^ not found in this scope error[E0658]: async fn is unstable - --> $DIR/feature-gate-async-await-2015-edition.rs:5:1 + --> $DIR/feature-gate-async-await-2015-edition.rs:3:1 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-async-await.rs b/src/test/ui/feature-gates/feature-gate-async-await.rs index 1fdaec75e9d5a..9cfefef4129de 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.rs +++ b/src/test/ui/feature-gates/feature-gate-async-await.rs @@ -1,7 +1,5 @@ // edition:2018 -#![feature(futures_api)] - struct S; impl S { diff --git a/src/test/ui/feature-gates/feature-gate-async-await.stderr b/src/test/ui/feature-gates/feature-gate-async-await.stderr index 1fa21f52045fc..43e41b4545869 100644 --- a/src/test/ui/feature-gates/feature-gate-async-await.stderr +++ b/src/test/ui/feature-gates/feature-gate-async-await.stderr @@ -1,11 +1,11 @@ error[E0706]: trait fns cannot be declared `async` - --> $DIR/feature-gate-async-await.rs:12:5 + --> $DIR/feature-gate-async-await.rs:10:5 | LL | async fn foo(); | ^^^^^^^^^^^^^^^ error[E0658]: async fn is unstable - --> $DIR/feature-gate-async-await.rs:8:5 + --> $DIR/feature-gate-async-await.rs:6:5 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | async fn foo() {} = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async fn is unstable - --> $DIR/feature-gate-async-await.rs:12:5 + --> $DIR/feature-gate-async-await.rs:10:5 | LL | async fn foo(); | ^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | async fn foo(); = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async fn is unstable - --> $DIR/feature-gate-async-await.rs:16:1 + --> $DIR/feature-gate-async-await.rs:14:1 | LL | async fn foo() {} | ^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | async fn foo() {} = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async blocks are unstable - --> $DIR/feature-gate-async-await.rs:19:13 + --> $DIR/feature-gate-async-await.rs:17:13 | LL | let _ = async {}; | ^^^^^^^^ @@ -41,7 +41,7 @@ LL | let _ = async {}; = help: add #![feature(async_await)] to the crate attributes to enable error[E0658]: async closures are unstable - --> $DIR/feature-gate-async-await.rs:20:13 + --> $DIR/feature-gate-async-await.rs:18:13 | LL | let _ = async || {}; | ^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.rs b/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.rs index 2ea60029492af..d118b7f4ff2b2 100644 --- a/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.rs +++ b/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength #![crate_type = "lib"] extern { diff --git a/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.stderr b/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.stderr index c28d45df7cd41..72e414eab9248 100644 --- a/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.stderr +++ b/src/test/ui/feature-gates/feature-gate-ffi_returns_twice.stderr @@ -1,5 +1,5 @@ error[E0658]: the `#[ffi_returns_twice]` attribute is an experimental feature - --> $DIR/feature-gate-ffi_returns_twice.rs:5:5 + --> $DIR/feature-gate-ffi_returns_twice.rs:4:5 | LL | #[ffi_returns_twice] | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/ffi_returns_twice.rs b/src/test/ui/ffi_returns_twice.rs index 93c372e1d83dc..845e18df11b54 100644 --- a/src/test/ui/ffi_returns_twice.rs +++ b/src/test/ui/ffi_returns_twice.rs @@ -1,4 +1,3 @@ -// ignore-tidy-linelength #![feature(ffi_returns_twice)] #![crate_type = "lib"] diff --git a/src/test/ui/ffi_returns_twice.stderr b/src/test/ui/ffi_returns_twice.stderr index e51d3d8c146b4..862892e27be98 100644 --- a/src/test/ui/ffi_returns_twice.stderr +++ b/src/test/ui/ffi_returns_twice.stderr @@ -1,5 +1,5 @@ error[E0724]: `#[ffi_returns_twice]` may only be used on foreign functions - --> $DIR/ffi_returns_twice.rs:5:1 + --> $DIR/ffi_returns_twice.rs:4:1 | LL | #[ffi_returns_twice] | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/impl-trait/auto-trait-leak.rs b/src/test/ui/impl-trait/auto-trait-leak.rs index ea0be0b346cbe..1c601bc3c34ea 100644 --- a/src/test/ui/impl-trait/auto-trait-leak.rs +++ b/src/test/ui/impl-trait/auto-trait-leak.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - use std::cell::Cell; use std::rc::Rc; diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr index de0043eee8fd7..61450d3203cd8 100644 --- a/src/test/ui/impl-trait/auto-trait-leak.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak.stderr @@ -1,29 +1,29 @@ error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0` - --> $DIR/auto-trait-leak.rs:14:16 + --> $DIR/auto-trait-leak.rs:12:16 | LL | fn cycle1() -> impl Clone { | ^^^^^^^^^^ | note: ...which requires processing `cycle1`... - --> $DIR/auto-trait-leak.rs:14:1 + --> $DIR/auto-trait-leak.rs:12:1 | LL | fn cycle1() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`... note: ...which requires processing `cycle2::{{opaque}}#0`... - --> $DIR/auto-trait-leak.rs:23:16 + --> $DIR/auto-trait-leak.rs:21:16 | LL | fn cycle2() -> impl Clone { | ^^^^^^^^^^ note: ...which requires processing `cycle2`... - --> $DIR/auto-trait-leak.rs:23:1 + --> $DIR/auto-trait-leak.rs:21:1 | LL | fn cycle2() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`... = note: ...which again requires processing `cycle1::{{opaque}}#0`, completing the cycle note: cycle used when checking item types in top-level module - --> $DIR/auto-trait-leak.rs:3:1 + --> $DIR/auto-trait-leak.rs:1:1 | LL | / use std::cell::Cell; LL | | use std::rc::Rc; @@ -35,30 +35,30 @@ LL | | } | |_^ error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0` - --> $DIR/auto-trait-leak.rs:14:16 + --> $DIR/auto-trait-leak.rs:12:16 | LL | fn cycle1() -> impl Clone { | ^^^^^^^^^^ | note: ...which requires processing `cycle1`... - --> $DIR/auto-trait-leak.rs:14:1 + --> $DIR/auto-trait-leak.rs:12:1 | LL | fn cycle1() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`... note: ...which requires processing `cycle2::{{opaque}}#0`... - --> $DIR/auto-trait-leak.rs:23:16 + --> $DIR/auto-trait-leak.rs:21:16 | LL | fn cycle2() -> impl Clone { | ^^^^^^^^^^ note: ...which requires processing `cycle2`... - --> $DIR/auto-trait-leak.rs:23:1 + --> $DIR/auto-trait-leak.rs:21:1 | LL | fn cycle2() -> impl Clone { | ^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...which again requires processing `cycle1::{{opaque}}#0`, completing the cycle note: cycle used when checking item types in top-level module - --> $DIR/auto-trait-leak.rs:3:1 + --> $DIR/auto-trait-leak.rs:1:1 | LL | / use std::cell::Cell; LL | | use std::rc::Rc; @@ -70,7 +70,7 @@ LL | | } | |_^ error[E0277]: `std::rc::Rc` cannot be sent between threads safely - --> $DIR/auto-trait-leak.rs:17:5 + --> $DIR/auto-trait-leak.rs:15:5 | LL | send(cycle2().clone()); | ^^^^ `std::rc::Rc` cannot be sent between threads safely @@ -78,7 +78,7 @@ LL | send(cycle2().clone()); = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc` = note: required because it appears within the type `impl std::clone::Clone` note: required by `send` - --> $DIR/auto-trait-leak.rs:6:1 + --> $DIR/auto-trait-leak.rs:4:1 | LL | fn send(_: T) {} | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/impl-trait/auto-trait-leak2.rs b/src/test/ui/impl-trait/auto-trait-leak2.rs index e529b4757ed1e..fb4b54051237c 100644 --- a/src/test/ui/impl-trait/auto-trait-leak2.rs +++ b/src/test/ui/impl-trait/auto-trait-leak2.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - use std::cell::Cell; use std::rc::Rc; diff --git a/src/test/ui/impl-trait/auto-trait-leak2.stderr b/src/test/ui/impl-trait/auto-trait-leak2.stderr index 4e427d3d6b388..19899ff83f7c3 100644 --- a/src/test/ui/impl-trait/auto-trait-leak2.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak2.stderr @@ -1,29 +1,29 @@ error[E0277]: `std::rc::Rc>` cannot be sent between threads safely - --> $DIR/auto-trait-leak2.rs:15:5 + --> $DIR/auto-trait-leak2.rs:13:5 | LL | send(before()); | ^^^^ `std::rc::Rc>` cannot be sent between threads safely | = help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc>` - = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:9:5: 9:22 p:std::rc::Rc>]` + = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22 p:std::rc::Rc>]` = note: required because it appears within the type `impl std::ops::Fn<(i32,)>` note: required by `send` - --> $DIR/auto-trait-leak2.rs:12:1 + --> $DIR/auto-trait-leak2.rs:10:1 | LL | fn send(_: T) {} | ^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `std::rc::Rc>` cannot be sent between threads safely - --> $DIR/auto-trait-leak2.rs:18:5 + --> $DIR/auto-trait-leak2.rs:16:5 | LL | send(after()); | ^^^^ `std::rc::Rc>` cannot be sent between threads safely | = help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc>` - = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:26:5: 26:22 p:std::rc::Rc>]` + = note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22 p:std::rc::Rc>]` = note: required because it appears within the type `impl std::ops::Fn<(i32,)>` note: required by `send` - --> $DIR/auto-trait-leak2.rs:12:1 + --> $DIR/auto-trait-leak2.rs:10:1 | LL | fn send(_: T) {} | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs index 32f3517167349..c5c966a959ae9 100644 --- a/src/test/ui/impl-trait/method-suggestion-no-duplication.rs +++ b/src/test/ui/impl-trait/method-suggestion-no-duplication.rs @@ -1,6 +1,4 @@ // issue #21405 -// ignore-tidy-linelength - struct Foo; fn foo(f: F) where F: FnMut(Foo) {} diff --git a/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr b/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr index 8da1ce41a0f94..afb3376638a96 100644 --- a/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr +++ b/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `is_empty` found for type `Foo` in the current scope - --> $DIR/method-suggestion-no-duplication.rs:9:15 + --> $DIR/method-suggestion-no-duplication.rs:7:15 | LL | struct Foo; | ----------- method `is_empty` not found for this diff --git a/src/test/ui/impl-trait/recursive-async-impl-trait-type.rs b/src/test/ui/impl-trait/recursive-async-impl-trait-type.rs index 40642523be255..a4e080119345e 100644 --- a/src/test/ui/impl-trait/recursive-async-impl-trait-type.rs +++ b/src/test/ui/impl-trait/recursive-async-impl-trait-type.rs @@ -2,7 +2,7 @@ // Test that impl trait does not allow creating recursive types that are // otherwise forbidden when using `async` and `await`. -#![feature(await_macro, async_await, futures_api, generators)] +#![feature(await_macro, async_await, generators)] async fn recursive_async_function() -> () { //~ ERROR await!(recursive_async_function()); diff --git a/src/test/ui/impl-trait/recursive-impl-trait-type.rs b/src/test/ui/impl-trait/recursive-impl-trait-type.rs index 869876dc6a88a..2428b560b7001 100644 --- a/src/test/ui/impl-trait/recursive-impl-trait-type.rs +++ b/src/test/ui/impl-trait/recursive-impl-trait-type.rs @@ -1,7 +1,7 @@ // Test that impl trait does not allow creating recursive types that are // otherwise forbidden. -#![feature(futures_api, generators)] +#![feature(generators)] fn option(i: i32) -> impl Sized { //~ ERROR if i < 0 { diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs index 3b1cd9fbdc80e..254d810d79dbc 100644 --- a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - mod auxiliary { mod foo; } diff --git a/src/test/ui/issues/issue-21950.rs b/src/test/ui/issues/issue-21950.rs index 0f78b37fedba3..b902893bf8224 100644 --- a/src/test/ui/issues/issue-21950.rs +++ b/src/test/ui/issues/issue-21950.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - use std::ops::Add; fn main() { diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr index d40893b942376..7655e0811e066 100644 --- a/src/test/ui/issues/issue-21950.stderr +++ b/src/test/ui/issues/issue-21950.stderr @@ -1,5 +1,5 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-21950.rs:7:14 + --> $DIR/issue-21950.rs:5:14 | LL | &Add; | ^^^ missing reference to `Rhs` @@ -7,7 +7,7 @@ LL | &Add; = note: because of the default `Self` reference, type parameters must be specified on object types error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified - --> $DIR/issue-21950.rs:7:14 + --> $DIR/issue-21950.rs:5:14 | LL | &Add; | ^^^ associated type `Output` must be specified diff --git a/src/test/ui/issues/issue-22370.rs b/src/test/ui/issues/issue-22370.rs index 44eef2da83ce3..90912cfda0d4e 100644 --- a/src/test/ui/issues/issue-22370.rs +++ b/src/test/ui/issues/issue-22370.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - trait A {} fn f(a: &A) {} diff --git a/src/test/ui/issues/issue-22370.stderr b/src/test/ui/issues/issue-22370.stderr index 5d76d84d11e6f..f21551a55bc9a 100644 --- a/src/test/ui/issues/issue-22370.stderr +++ b/src/test/ui/issues/issue-22370.stderr @@ -1,5 +1,5 @@ error[E0393]: the type parameter `T` must be explicitly specified - --> $DIR/issue-22370.rs:5:10 + --> $DIR/issue-22370.rs:3:10 | LL | fn f(a: &A) {} | ^ missing reference to `T` diff --git a/src/test/ui/issues/issue-22560.rs b/src/test/ui/issues/issue-22560.rs index d91211e556b11..4b8e3aa9eb3e1 100644 --- a/src/test/ui/issues/issue-22560.rs +++ b/src/test/ui/issues/issue-22560.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - use std::ops::{Add, Sub}; type Test = Add + diff --git a/src/test/ui/issues/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr index a0ad1fd1279d7..5a056dff590fe 100644 --- a/src/test/ui/issues/issue-22560.stderr +++ b/src/test/ui/issues/issue-22560.stderr @@ -1,5 +1,5 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-22560.rs:5:13 + --> $DIR/issue-22560.rs:3:13 | LL | type Test = Add + | ^^^ missing reference to `Rhs` @@ -7,7 +7,7 @@ LL | type Test = Add + = note: because of the default `Self` reference, type parameters must be specified on object types error[E0393]: the type parameter `Rhs` must be explicitly specified - --> $DIR/issue-22560.rs:8:13 + --> $DIR/issue-22560.rs:6:13 | LL | Sub; | ^^^ missing reference to `Rhs` @@ -15,13 +15,13 @@ LL | Sub; = note: because of the default `Self` reference, type parameters must be specified on object types error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/issue-22560.rs:8:13 + --> $DIR/issue-22560.rs:6:13 | LL | Sub; | ^^^ non-auto additional trait error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified - --> $DIR/issue-22560.rs:5:13 + --> $DIR/issue-22560.rs:3:13 | LL | type Test = Add + | _____________^ diff --git a/src/test/ui/issues/issue-23080-2.rs b/src/test/ui/issues/issue-23080-2.rs index 750b7e19d89df..319aa2a5cce9e 100644 --- a/src/test/ui/issues/issue-23080-2.rs +++ b/src/test/ui/issues/issue-23080-2.rs @@ -1,6 +1,4 @@ -// ignore-tidy-linelength - -//~^^ ERROR +//~ ERROR #![feature(optin_builtin_traits)] diff --git a/src/test/ui/issues/issue-23080-2.stderr b/src/test/ui/issues/issue-23080-2.stderr index 4179ca37a54cb..1103de0d91043 100644 --- a/src/test/ui/issues/issue-23080-2.stderr +++ b/src/test/ui/issues/issue-23080-2.stderr @@ -1,5 +1,5 @@ error[E0380]: auto traits cannot have methods or associated items - --> $DIR/issue-23080-2.rs:7:1 + --> $DIR/issue-23080-2.rs:5:1 | LL | / unsafe auto trait Trait { LL | | diff --git a/src/test/ui/issues/issue-23080.rs b/src/test/ui/issues/issue-23080.rs index e25a2d916f5f2..fdfee6981447d 100644 --- a/src/test/ui/issues/issue-23080.rs +++ b/src/test/ui/issues/issue-23080.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(optin_builtin_traits)] unsafe auto trait Trait { diff --git a/src/test/ui/issues/issue-23080.stderr b/src/test/ui/issues/issue-23080.stderr index ed843e793beeb..91c2721732426 100644 --- a/src/test/ui/issues/issue-23080.stderr +++ b/src/test/ui/issues/issue-23080.stderr @@ -1,5 +1,5 @@ error[E0380]: auto traits cannot have methods or associated items - --> $DIR/issue-23080.rs:5:1 + --> $DIR/issue-23080.rs:3:1 | LL | / unsafe auto trait Trait { LL | | diff --git a/src/test/ui/issues/issue-23281.rs b/src/test/ui/issues/issue-23281.rs index 98a0495451d04..2b457a57d3ede 100644 --- a/src/test/ui/issues/issue-23281.rs +++ b/src/test/ui/issues/issue-23281.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - pub struct Struct; impl Struct { diff --git a/src/test/ui/issues/issue-23281.stderr b/src/test/ui/issues/issue-23281.stderr index 1e57774afe55a..e540d4e819242 100644 --- a/src/test/ui/issues/issue-23281.stderr +++ b/src/test/ui/issues/issue-23281.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `(dyn std::ops::Fn() + 'static)` cannot be known at compilation time - --> $DIR/issue-23281.rs:6:5 + --> $DIR/issue-23281.rs:4:5 | LL | pub fn function(funs: Vec ()>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/issues/issue-54974.rs b/src/test/ui/issues/issue-54974.rs index b2624ec92a184..d6f18875c9e3a 100644 --- a/src/test/ui/issues/issue-54974.rs +++ b/src/test/ui/issues/issue-54974.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] use std::sync::Arc; diff --git a/src/test/ui/issues/issue-55324.rs b/src/test/ui/issues/issue-55324.rs index 6160fbabd96d7..4572e543f22de 100644 --- a/src/test/ui/issues/issue-55324.rs +++ b/src/test/ui/issues/issue-55324.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] use std::future::Future; diff --git a/src/test/ui/issues/issue-58885.rs b/src/test/ui/issues/issue-58885.rs index 559899194fbe7..99d87b2273c2f 100644 --- a/src/test/ui/issues/issue-58885.rs +++ b/src/test/ui/issues/issue-58885.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] struct Xyz { a: u64, diff --git a/src/test/ui/issues/issue-59001.rs b/src/test/ui/issues/issue-59001.rs index a310653fbce48..c758244002ff6 100644 --- a/src/test/ui/issues/issue-59001.rs +++ b/src/test/ui/issues/issue-59001.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro, futures_api)] +#![feature(async_await, await_macro)] use std::future::Future; diff --git a/src/test/ui/issues/issue-59488.rs b/src/test/ui/issues/issue-59488.rs index e0a37f6adcc3b..6fa9961f26cc8 100644 --- a/src/test/ui/issues/issue-59488.rs +++ b/src/test/ui/issues/issue-59488.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - fn foo() -> i32 { 42 } diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr index e8f0f7bbebf86..e0cb1f7b96df8 100644 --- a/src/test/ui/issues/issue-59488.stderr +++ b/src/test/ui/issues/issue-59488.stderr @@ -1,5 +1,5 @@ error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}` - --> $DIR/issue-59488.rs:16:9 + --> $DIR/issue-59488.rs:14:9 | LL | foo > 12; | --- ^ -- {integer} @@ -8,7 +8,7 @@ LL | foo > 12; | help: you might have forgotten to call this function: `foo()` error[E0308]: mismatched types - --> $DIR/issue-59488.rs:16:11 + --> $DIR/issue-59488.rs:14:11 | LL | foo > 12; | ^^ expected fn item, found integer @@ -17,7 +17,7 @@ LL | foo > 12; found type `i32` error[E0369]: binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}` - --> $DIR/issue-59488.rs:20:9 + --> $DIR/issue-59488.rs:18:9 | LL | bar > 13; | --- ^ -- {integer} @@ -26,7 +26,7 @@ LL | bar > 13; | help: you might have forgotten to call this function: `bar( /* arguments */ )` error[E0308]: mismatched types - --> $DIR/issue-59488.rs:20:11 + --> $DIR/issue-59488.rs:18:11 | LL | bar > 13; | ^^ expected fn item, found integer @@ -35,7 +35,7 @@ LL | bar > 13; found type `i64` error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}` - --> $DIR/issue-59488.rs:24:9 + --> $DIR/issue-59488.rs:22:9 | LL | foo > foo; | --- ^ --- fn() -> i32 {foo} @@ -51,7 +51,7 @@ LL | foo > foo(); | ^^^^^ error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}` - --> $DIR/issue-59488.rs:27:9 + --> $DIR/issue-59488.rs:25:9 | LL | foo > bar; | --- ^ --- fn(i64) -> i64 {bar} @@ -61,7 +61,7 @@ LL | foo > bar; = note: an implementation of `std::cmp::PartialOrd` might be missing for `fn() -> i32 {foo}` error[E0308]: mismatched types - --> $DIR/issue-59488.rs:27:11 + --> $DIR/issue-59488.rs:25:11 | LL | foo > bar; | ^^^ expected fn item, found a different fn item @@ -70,7 +70,7 @@ LL | foo > bar; found type `fn(i64) -> i64 {bar}` error[E0369]: binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` - --> $DIR/issue-59488.rs:32:5 + --> $DIR/issue-59488.rs:30:5 | LL | assert_eq!(Foo::Bar, i); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -82,7 +82,7 @@ LL | assert_eq!(Foo::Bar, i); = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` - --> $DIR/issue-59488.rs:32:5 + --> $DIR/issue-59488.rs:30:5 | LL | assert_eq!(Foo::Bar, i); | ^^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` @@ -93,7 +93,7 @@ LL | assert_eq!(Foo::Bar, i); = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` - --> $DIR/issue-59488.rs:32:5 + --> $DIR/issue-59488.rs:30:5 | LL | assert_eq!(Foo::Bar, i); | ^^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` diff --git a/src/test/ui/lint/lint-incoherent-auto-trait-objects.rs b/src/test/ui/lint/lint-incoherent-auto-trait-objects.rs index 0d18965ee7338..d53b514476025 100644 --- a/src/test/ui/lint/lint-incoherent-auto-trait-objects.rs +++ b/src/test/ui/lint/lint-incoherent-auto-trait-objects.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - trait Foo {} impl Foo for dyn Send {} diff --git a/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr b/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr index 928c92ef91655..448cc953d40ad 100644 --- a/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr +++ b/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr @@ -1,5 +1,5 @@ error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + 'static)`: (E0119) - --> $DIR/lint-incoherent-auto-trait-objects.rs:7:1 + --> $DIR/lint-incoherent-auto-trait-objects.rs:5:1 | LL | impl Foo for dyn Send {} | --------------------- first implementation here @@ -12,7 +12,7 @@ LL | impl Foo for dyn Send + Send {} = note: for more information, see issue #56484 error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) - --> $DIR/lint-incoherent-auto-trait-objects.rs:13:1 + --> $DIR/lint-incoherent-auto-trait-objects.rs:11:1 | LL | impl Foo for dyn Send + Sync {} | ---------------------------- first implementation here @@ -24,7 +24,7 @@ LL | impl Foo for dyn Sync + Send {} = note: for more information, see issue #56484 error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) - --> $DIR/lint-incoherent-auto-trait-objects.rs:17:1 + --> $DIR/lint-incoherent-auto-trait-objects.rs:15:1 | LL | impl Foo for dyn Sync + Send {} | ---------------------------- first implementation here diff --git a/src/test/ui/moves/moves-based-on-type-block-bad.rs b/src/test/ui/moves/moves-based-on-type-block-bad.rs index 99928caa926a4..516325ce1d797 100644 --- a/src/test/ui/moves/moves-based-on-type-block-bad.rs +++ b/src/test/ui/moves/moves-based-on-type-block-bad.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/src/test/ui/moves/moves-based-on-type-block-bad.stderr b/src/test/ui/moves/moves-based-on-type-block-bad.stderr index b83a15c9d4dac..e28b22035f5d4 100644 --- a/src/test/ui/moves/moves-based-on-type-block-bad.stderr +++ b/src/test/ui/moves/moves-based-on-type-block-bad.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/moves-based-on-type-block-bad.rs:24:19 + --> $DIR/moves-based-on-type-block-bad.rs:22:19 | LL | match hellothere.x { | ^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL | box E::Bar(x) => println!("{}", x.to_string()), | - data moved here | note: move occurs because `x` has type `std::boxed::Box`, which does not implement the `Copy` trait - --> $DIR/moves-based-on-type-block-bad.rs:27:28 + --> $DIR/moves-based-on-type-block-bad.rs:25:28 | LL | box E::Bar(x) => println!("{}", x.to_string()), | ^ diff --git a/src/test/ui/no-args-non-move-async-closure.rs b/src/test/ui/no-args-non-move-async-closure.rs index 4f5b2ea3783aa..345f19b06233b 100644 --- a/src/test/ui/no-args-non-move-async-closure.rs +++ b/src/test/ui/no-args-non-move-async-closure.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)] +#![feature(async_await, await_macro)] fn main() { let _ = async |x: u8| {}; diff --git a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs b/src/test/ui/on-unimplemented/auxiliary/no_debug.rs index f240d0e1f1fab..fd3dc0abdc8fc 100644 --- a/src/test/ui/on-unimplemented/auxiliary/no_debug.rs +++ b/src/test/ui/on-unimplemented/auxiliary/no_debug.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![crate_type = "lib"] pub struct Bar; diff --git a/src/test/ui/on-unimplemented/slice-index.rs b/src/test/ui/on-unimplemented/slice-index.rs index b5e18e2397e00..758220d3c4ecd 100644 --- a/src/test/ui/on-unimplemented/slice-index.rs +++ b/src/test/ui/on-unimplemented/slice-index.rs @@ -1,7 +1,4 @@ // Test new Index error message for slices -// ignore-tidy-linelength - - use std::ops::Index; diff --git a/src/test/ui/on-unimplemented/slice-index.stderr b/src/test/ui/on-unimplemented/slice-index.stderr index c1d884929a0c1..25a65460071da 100644 --- a/src/test/ui/on-unimplemented/slice-index.stderr +++ b/src/test/ui/on-unimplemented/slice-index.stderr @@ -1,5 +1,5 @@ error[E0277]: the type `[i32]` cannot be indexed by `i32` - --> $DIR/slice-index.rs:11:5 + --> $DIR/slice-index.rs:8:5 | LL | x[1i32]; | ^^^^^^^ slice indices are of type `usize` or ranges of `usize` @@ -8,7 +8,7 @@ LL | x[1i32]; = note: required because of the requirements on the impl of `std::ops::Index` for `[i32]` error[E0277]: the type `[i32]` cannot be indexed by `std::ops::RangeTo` - --> $DIR/slice-index.rs:12:5 + --> $DIR/slice-index.rs:9:5 | LL | x[..1i32]; | ^^^^^^^^^ slice indices are of type `usize` or ranges of `usize` diff --git a/src/test/ui/parser/byte-string-literals.rs b/src/test/ui/parser/byte-string-literals.rs index d028f28655b8e..8d8ee4da98717 100644 --- a/src/test/ui/parser/byte-string-literals.rs +++ b/src/test/ui/parser/byte-string-literals.rs @@ -1,8 +1,5 @@ // compile-flags: -Z continue-parse-after-error - -// ignore-tidy-tab - static FOO: &'static [u8] = b"\f"; //~ ERROR unknown byte escape pub fn main() { diff --git a/src/test/ui/parser/byte-string-literals.stderr b/src/test/ui/parser/byte-string-literals.stderr index 6701cfd8e66c2..b855484444010 100644 --- a/src/test/ui/parser/byte-string-literals.stderr +++ b/src/test/ui/parser/byte-string-literals.stderr @@ -1,29 +1,29 @@ error: unknown byte escape: f - --> $DIR/byte-string-literals.rs:6:32 + --> $DIR/byte-string-literals.rs:3:32 | LL | static FOO: &'static [u8] = b"\f"; | ^ unknown byte escape error: unknown byte escape: f - --> $DIR/byte-string-literals.rs:9:8 + --> $DIR/byte-string-literals.rs:6:8 | LL | b"\f"; | ^ unknown byte escape error: invalid character in numeric character escape: Z - --> $DIR/byte-string-literals.rs:10:10 + --> $DIR/byte-string-literals.rs:7:10 | LL | b"\x0Z"; | ^ error: byte constant must be ASCII. Use a \xHH escape for a non-ASCII byte - --> $DIR/byte-string-literals.rs:11:7 + --> $DIR/byte-string-literals.rs:8:7 | LL | b"é"; | ^ error: unterminated double quote byte string - --> $DIR/byte-string-literals.rs:12:7 + --> $DIR/byte-string-literals.rs:9:7 | LL | b"a | _______^ diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs index 9e81ee4616951..5297d0d9842e2 100644 --- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs +++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - /* * We don't infer `T: 'static` outlives relationships by default. * Instead an additional feature gate `infer_static_outlives_requirements` diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr index 26cbeeaf5acde..b049d8a4ab3c3 100644 --- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `U` may not live long enough - --> $DIR/dont-infer-static.rs:10:5 + --> $DIR/dont-infer-static.rs:8:5 | LL | struct Foo { | - help: consider adding an explicit lifetime bound `U: 'static`... @@ -7,7 +7,7 @@ LL | bar: Bar | ^^^^^^^^^^^ | note: ...so that the type `U` will meet its required lifetime bounds - --> $DIR/dont-infer-static.rs:10:5 + --> $DIR/dont-infer-static.rs:8:5 | LL | bar: Bar | ^^^^^^^^^^^ diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.rs b/src/test/ui/rfc-2093-infer-outlives/enum.rs index 622794ea9ac3b..71d2d32226556 100644 --- a/src/test/ui/rfc-2093-infer-outlives/enum.rs +++ b/src/test/ui/rfc-2093-infer-outlives/enum.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(rustc_attrs)] // Needs an explicit where clause stating outlives condition. (RFC 2093) diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr index e81d10a66dff3..dd56c1f79c712 100644 --- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr +++ b/src/test/ui/rfc-2093-infer-outlives/enum.stderr @@ -1,5 +1,5 @@ error: rustc_outlives - --> $DIR/enum.rs:9:1 + --> $DIR/enum.rs:7:1 | LL | / enum Foo<'a, T> { LL | | One(Bar<'a, T>) @@ -9,7 +9,7 @@ LL | | } = note: T : 'a error: rustc_outlives - --> $DIR/enum.rs:15:1 + --> $DIR/enum.rs:13:1 | LL | / struct Bar<'b, U> { LL | | field2: &'b U @@ -19,7 +19,7 @@ LL | | } = note: U : 'b error: rustc_outlives - --> $DIR/enum.rs:21:1 + --> $DIR/enum.rs:19:1 | LL | / enum Ying<'c, K> { LL | | One(&'c Yang) diff --git a/src/test/ui/span/issue-24356.rs b/src/test/ui/span/issue-24356.rs index 7696bd54226da..7ec05aab29a71 100644 --- a/src/test/ui/span/issue-24356.rs +++ b/src/test/ui/span/issue-24356.rs @@ -1,7 +1,5 @@ // Regression test for #24356 -// ignore-tidy-linelength - fn main() { { use std::ops::Deref; diff --git a/src/test/ui/span/issue-24356.stderr b/src/test/ui/span/issue-24356.stderr index 102cc4201e2ec..4827e9ddd50fd 100644 --- a/src/test/ui/span/issue-24356.stderr +++ b/src/test/ui/span/issue-24356.stderr @@ -1,5 +1,5 @@ error[E0046]: not all trait items implemented, missing: `Target` - --> $DIR/issue-24356.rs:20:9 + --> $DIR/issue-24356.rs:18:9 | LL | impl Deref for Thing { | ^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs index c33398cd39cab..ea0a66540b931 100644 --- a/src/test/ui/span/issue-7575.rs +++ b/src/test/ui/span/issue-7575.rs @@ -1,6 +1,4 @@ // Test the mechanism for warning about possible missing `self` declarations. -// ignore-tidy-linelength - trait CtxtFn { fn f8(self, _: usize) -> usize; fn f9(_: usize) -> usize; diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index b2c9e505f07b6..614638752f166 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -1,24 +1,24 @@ error[E0599]: no method named `f9` found for type `usize` in the current scope - --> $DIR/issue-7575.rs:64:18 + --> $DIR/issue-7575.rs:62:18 | LL | u.f8(42) + u.f9(342) + m.fff(42) | ^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: candidate #1 is defined in the trait `CtxtFn` - --> $DIR/issue-7575.rs:6:5 + --> $DIR/issue-7575.rs:4:5 | LL | fn f9(_: usize) -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `CtxtFn::f9(u, 342)` instead note: candidate #2 is defined in the trait `OtherTrait` - --> $DIR/issue-7575.rs:10:5 + --> $DIR/issue-7575.rs:8:5 | LL | fn f9(_: usize) -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^ = help: to disambiguate the method call, write `OtherTrait::f9(u, 342)` instead note: candidate #3 is defined in the trait `UnusedTrait` - --> $DIR/issue-7575.rs:19:5 + --> $DIR/issue-7575.rs:17:5 | LL | fn f9(_: usize) -> usize; | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -30,7 +30,7 @@ LL | fn f9(_: usize) -> usize; candidate #3: `UnusedTrait` error[E0599]: no method named `fff` found for type `Myisize` in the current scope - --> $DIR/issue-7575.rs:64:30 + --> $DIR/issue-7575.rs:62:30 | LL | struct Myisize(isize); | ---------------------- method `fff` not found for this @@ -43,20 +43,20 @@ LL | u.f8(42) + u.f9(342) + m.fff(42) | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `Myisize` - --> $DIR/issue-7575.rs:41:5 + --> $DIR/issue-7575.rs:39:5 | LL | fn fff(i: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0599]: no method named `is_str` found for type `T` in the current scope - --> $DIR/issue-7575.rs:72:7 + --> $DIR/issue-7575.rs:70:7 | LL | t.is_str() | ^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `ManyImplTrait` - --> $DIR/issue-7575.rs:47:5 + --> $DIR/issue-7575.rs:45:5 | LL | fn is_str() -> bool { | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/stability-attribute/stability-attribute-issue.rs b/src/test/ui/stability-attribute/stability-attribute-issue.rs index ca4d7cc6a6ccf..cda1aff133f94 100644 --- a/src/test/ui/stability-attribute/stability-attribute-issue.rs +++ b/src/test/ui/stability-attribute/stability-attribute-issue.rs @@ -1,6 +1,4 @@ // aux-build:stability_attribute_issue.rs -// ignore-tidy-linelength - #![deny(deprecated)] extern crate stability_attribute_issue; diff --git a/src/test/ui/stability-attribute/stability-attribute-issue.stderr b/src/test/ui/stability-attribute/stability-attribute-issue.stderr index 36e192e583e62..7e6fbe1600d1e 100644 --- a/src/test/ui/stability-attribute/stability-attribute-issue.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-issue.stderr @@ -1,5 +1,5 @@ error[E0658]: use of unstable library feature 'unstable_test_feature' - --> $DIR/stability-attribute-issue.rs:10:5 + --> $DIR/stability-attribute-issue.rs:8:5 | LL | unstable(); | ^^^^^^^^ @@ -8,7 +8,7 @@ LL | unstable(); = help: add #![feature(unstable_test_feature)] to the crate attributes to enable error[E0658]: use of unstable library feature 'unstable_test_feature': message - --> $DIR/stability-attribute-issue.rs:12:5 + --> $DIR/stability-attribute-issue.rs:10:5 | LL | unstable_msg(); | ^^^^^^^^^^^^ diff --git a/src/test/ui/try-poll.rs b/src/test/ui/try-poll.rs index 3d7115c522346..f63950ad5e905 100644 --- a/src/test/ui/try-poll.rs +++ b/src/test/ui/try-poll.rs @@ -1,7 +1,6 @@ // compile-pass #![allow(dead_code, unused)] -#![feature(futures_api)] use std::task::Poll; diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.rs b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.rs index f31dac27caec4..e4487fb110cf1 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.rs +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.rs @@ -1,5 +1,3 @@ -// ignore-tidy-linelength - #![feature(optin_builtin_traits)] struct Managed; diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr index 5330c04074b2f..4d435bf4e8b24 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr @@ -1,18 +1,18 @@ error[E0277]: `MyNotSync` cannot be shared between threads safely - --> $DIR/typeck-default-trait-impl-negation-sync.rs:35:5 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:33:5 | LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^ `MyNotSync` cannot be shared between threads safely | = help: the trait `std::marker::Sync` is not implemented for `MyNotSync` note: required by `is_sync` - --> $DIR/typeck-default-trait-impl-negation-sync.rs:31:1 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:1 | LL | fn is_sync() {} | ^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads safely - --> $DIR/typeck-default-trait-impl-negation-sync.rs:38:5 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:36:5 | LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely @@ -20,13 +20,13 @@ LL | is_sync::(); = help: within `MyTypeWUnsafe`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell` = note: required because it appears within the type `MyTypeWUnsafe` note: required by `is_sync` - --> $DIR/typeck-default-trait-impl-negation-sync.rs:31:1 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:1 | LL | fn is_sync() {} | ^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `Managed` cannot be shared between threads safely - --> $DIR/typeck-default-trait-impl-negation-sync.rs:41:5 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:39:5 | LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely @@ -34,7 +34,7 @@ LL | is_sync::(); = help: within `MyTypeManaged`, the trait `std::marker::Sync` is not implemented for `Managed` = note: required because it appears within the type `MyTypeManaged` note: required by `is_sync` - --> $DIR/typeck-default-trait-impl-negation-sync.rs:31:1 + --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:1 | LL | fn is_sync() {} | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index fb2bfb13a7478..9ab88d6e9aeac 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -9,8 +9,8 @@ //! * No `TODO` or `XXX` directives. //! * No unexplained ` ```ignore ` or ` ```rust,ignore ` doc tests. //! -//! A number of these checks can be opted-out of with various directives like -//! `// ignore-tidy-linelength`. +//! A number of these checks can be opted-out of with various directives of the form: +//! `// ignore-tidy-CHECK-NAME`. use std::fs::File; use std::io::prelude::*; @@ -90,6 +90,36 @@ fn long_line_is_ok(line: &str) -> bool { false } +enum Directive { + /// By default, tidy always warns against style issues. + Deny, + + /// `Ignore(false)` means that an `ignore-tidy-*` directive + /// has been provided, but is unnecessary. `Ignore(true)` + /// means that it is necessary (i.e. a warning would be + /// produced if `ignore-tidy-*` was not present). + Ignore(bool), +} + +fn contains_ignore_directive(contents: &String, check: &str) -> Directive { + if contents.contains(&format!("// ignore-tidy-{}", check)) || + contents.contains(&format!("# ignore-tidy-{}", check)) { + Directive::Ignore(false) + } else { + Directive::Deny + } +} + +macro_rules! suppressible_tidy_err { + ($err:ident, $skip:ident, $msg:expr) => { + if let Directive::Deny = $skip { + $err($msg); + } else { + $skip = Directive::Ignore(true); + } + }; +} + pub fn check(path: &Path, bad: &mut bool) { let mut contents = String::new(); super::walk(path, &mut super::filter_dirs, &mut |file| { @@ -107,29 +137,32 @@ pub fn check(path: &Path, bad: &mut bool) { tidy_error!(bad, "{}: empty file", file.display()); } - let skip_cr = contents.contains("ignore-tidy-cr"); - let skip_tab = contents.contains("ignore-tidy-tab"); - let skip_length = contents.contains("ignore-tidy-linelength"); - let skip_end_whitespace = contents.contains("ignore-tidy-end-whitespace"); - let skip_copyright = contents.contains("ignore-tidy-copyright"); + let mut skip_cr = contains_ignore_directive(&contents, "cr"); + let mut skip_tab = contains_ignore_directive(&contents, "tab"); + let mut skip_length = contains_ignore_directive(&contents, "linelength"); + let mut skip_end_whitespace = contains_ignore_directive(&contents, "end-whitespace"); + let mut skip_copyright = contains_ignore_directive(&contents, "copyright"); let mut leading_new_lines = false; let mut trailing_new_lines = 0; for (i, line) in contents.split('\n').enumerate() { let mut err = |msg: &str| { tidy_error!(bad, "{}:{}: {}", file.display(), i + 1, msg); }; - if !skip_length && line.chars().count() > COLS - && !long_line_is_ok(line) { - err(&format!("line longer than {} chars", COLS)); + if line.chars().count() > COLS && !long_line_is_ok(line) { + suppressible_tidy_err!( + err, + skip_length, + &format!("line longer than {} chars", COLS) + ); } - if !skip_tab && line.contains('\t') { - err("tab character"); + if line.contains('\t') { + suppressible_tidy_err!(err, skip_tab, "tab character"); } - if !skip_end_whitespace && (line.ends_with(' ') || line.ends_with('\t')) { - err("trailing whitespace"); + if line.ends_with(' ') || line.ends_with('\t') { + suppressible_tidy_err!(err, skip_end_whitespace, "trailing whitespace"); } - if !skip_cr && line.contains('\r') { - err("CR character"); + if line.contains('\r') { + suppressible_tidy_err!(err, skip_cr, "CR character"); } if filename != "style.rs" { if line.contains("TODO") { @@ -139,12 +172,16 @@ pub fn check(path: &Path, bad: &mut bool) { err("XXX is deprecated; use FIXME") } } - if !skip_copyright && (line.starts_with("// Copyright") || - line.starts_with("# Copyright") || - line.starts_with("Copyright")) - && (line.contains("Rust Developers") || - line.contains("Rust Project Developers")) { - err("copyright notices attributed to the Rust Project Developers are deprecated"); + if (line.starts_with("// Copyright") || + line.starts_with("# Copyright") || + line.starts_with("Copyright")) + && (line.contains("Rust Developers") || + line.contains("Rust Project Developers")) { + suppressible_tidy_err!( + err, + skip_copyright, + "copyright notices attributed to the Rust Project Developers are deprecated" + ); } if line.ends_with("```ignore") || line.ends_with("```rust,ignore") { err(UNEXPLAINED_IGNORE_DOCTEST_INFO); @@ -169,5 +206,21 @@ pub fn check(path: &Path, bad: &mut bool) { 1 => {} n => tidy_error!(bad, "{}: too many trailing newlines ({})", file.display(), n), }; + + if let Directive::Ignore(false) = skip_cr { + tidy_error!(bad, "{}: ignoring CR characters unnecessarily", file.display()); + } + if let Directive::Ignore(false) = skip_tab { + tidy_error!(bad, "{}: ignoring tab characters unnecessarily", file.display()); + } + if let Directive::Ignore(false) = skip_length { + tidy_error!(bad, "{}: ignoring line length unnecessarily", file.display()); + } + if let Directive::Ignore(false) = skip_end_whitespace { + tidy_error!(bad, "{}: ignoring trailing whitespace unnecessarily", file.display()); + } + if let Directive::Ignore(false) = skip_copyright { + tidy_error!(bad, "{}: ignoring copyright unnecessarily", file.display()); + } }) }