Skip to content

Commit f47406e

Browse files
committed
#[allow(unused_parens)] no longer required
1 parent 0ca3a06 commit f47406e

File tree

36 files changed

+0
-89
lines changed

36 files changed

+0
-89
lines changed

library/alloc/src/collections/vec_deque/iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
144144
}
145145

146146
#[inline]
147-
#[allow(unused_parens)]
148147
#[core::contracts::requires(idx < self.len())]
149148
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item {
150149
// Safety: The TrustedRandomAccess contract requires that callers only pass an index

library/alloc/src/vec/into_iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
360360
R::from_output(accum)
361361
}
362362

363-
#[allow(unused_parens)]
364363
#[core::contracts::requires(i < self.len())]
365364
unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> Self::Item
366365
where

library/core/src/alloc/layout.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ impl Layout {
136136
#[inline]
137137
#[track_caller]
138138
#[rustc_allow_const_fn_unstable(contracts)]
139-
#[allow(unused_parens)]
140139
#[core::contracts::requires(Layout::from_size_align(size, align).is_ok())]
141140
#[core::contracts::ensures(
142141
move |result: &Self| result.size() == size && result.align() == align)]
@@ -200,7 +199,6 @@ impl Layout {
200199
#[must_use]
201200
#[inline]
202201
#[rustc_allow_const_fn_unstable(contracts)]
203-
#[allow(unused_parens)]
204202
#[core::contracts::requires(mem::align_of_val(t).is_power_of_two())]
205203
// FIXME: requires `&self` to be `'static`
206204
// #[core::contracts::ensures(move |result: &Self| result.align() == mem::align_of_val(t))]

library/core/src/array/iter.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ impl<T, const N: usize> IntoIter<T, N> {
139139
#[unstable(feature = "array_into_iter_constructors", issue = "91583")]
140140
#[inline]
141141
#[rustc_allow_const_fn_unstable(contracts)]
142-
#[allow(unused_parens)]
143142
#[core::contracts::requires(initialized.start <= initialized.end && initialized.end <= N)]
144143
pub const unsafe fn new_unchecked(
145144
buffer: [MaybeUninit<T>; N],
@@ -282,7 +281,6 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> {
282281
}
283282

284283
#[inline]
285-
#[allow(unused_parens)]
286284
#[core::contracts::requires(idx < self.len())]
287285
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item {
288286
// SAFETY: The caller must provide an idx that is in bound of the remainder.

library/core/src/ascii/ascii_char.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ impl AsciiChar {
480480
#[unstable(feature = "ascii_char", issue = "110998")]
481481
#[inline]
482482
#[rustc_allow_const_fn_unstable(contracts)]
483-
#[allow(unused_parens)]
484483
#[core::contracts::requires(b <= 127)]
485484
#[core::contracts::ensures(move |result: &Self| *result as u8 == b)]
486485
pub const unsafe fn from_u8_unchecked(b: u8) -> Self {
@@ -525,7 +524,6 @@ impl AsciiChar {
525524
// `assert_unsafe_precondition` inside. See https://github.com/rust-lang/rust/pull/129374 for
526525
// some context about the discrepancy.
527526
#[rustc_allow_const_fn_unstable(contracts)]
528-
#[allow(unused_parens)]
529527
#[core::contracts::requires(d < 10)]
530528
pub const unsafe fn digit_unchecked(d: u8) -> Self {
531529
assert_unsafe_precondition!(

library/core/src/char/convert.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
2424
#[allow(unnecessary_transmutes)]
2525
#[track_caller]
2626
#[rustc_allow_const_fn_unstable(contracts)]
27-
#[allow(unused_parens)]
2827
#[core::contracts::requires(char_try_from_u32(i).is_ok())]
2928
#[core::contracts::ensures(move |result: &char| *result as u32 == i)]
3029
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {

library/core/src/char/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ pub const fn from_u32(i: u32) -> Option<char> {
139139
#[must_use]
140140
#[inline]
141141
#[rustc_allow_const_fn_unstable(contracts)]
142-
#[allow(unused_parens)]
143142
#[core::contracts::requires(i <= 0x10FFFF && (i < 0xD800 || i > 0xDFFF))]
144143
pub const unsafe fn from_u32_unchecked(i: u32) -> char {
145144
// SAFETY: the safety contract must be upheld by the caller.
@@ -537,7 +536,6 @@ impl Iterator for CaseMappingIter {
537536
self.0.advance_by(n)
538537
}
539538

540-
#[allow(unused_parens)]
541539
#[core::contracts::requires(idx < self.len())]
542540
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item {
543541
// SAFETY: just forwarding requirements to caller

library/core/src/ffi/c_str.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ impl CStr {
251251
#[stable(feature = "rust1", since = "1.0.0")]
252252
#[rustc_const_stable(feature = "const_cstr_from_ptr", since = "1.81.0")]
253253
#[rustc_allow_const_fn_unstable(contracts)]
254-
#[allow(unused_parens)]
255254
#[core::contracts::requires(!ptr.is_null())]
256255
#[core::contracts::ensures(
257256
|result: &&CStr|
@@ -394,7 +393,6 @@ impl CStr {
394393
#[rustc_const_stable(feature = "const_cstr_unchecked", since = "1.59.0")]
395394
#[rustc_allow_const_fn_unstable(const_eval_select)]
396395
#[rustc_allow_const_fn_unstable(contracts)]
397-
#[allow(unused_parens)]
398396
#[core::contracts::requires(
399397
!bytes.is_empty() && bytes[bytes.len() - 1] == 0 && !bytes[..bytes.len()-1].contains(&0))]
400398
#[core::contracts::ensures(

library/core/src/intrinsics/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,6 @@ pub const fn is_val_statically_known<T: Copy>(_arg: T) -> bool {
25632563
#[inline]
25642564
#[rustc_intrinsic]
25652565
#[rustc_intrinsic_const_stable_indirect]
2566-
#[allow(unused_parens)]
25672566
#[rustc_allow_const_fn_unstable(contracts)]
25682567
#[core::contracts::requires(x.addr() != y.addr() || core::mem::size_of::<T>() == 0)]
25692568
pub const unsafe fn typed_swap_nonoverlapping<T>(x: *mut T, y: *mut T) {

library/core/src/iter/adapters/cloned.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ where
6161
self.it.map(T::clone).fold(init, f)
6262
}
6363

64-
#[allow(unused_parens)]
6564
#[core::contracts::requires(idx < self.it.size_hint().0)]
6665
unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> T
6766
where

0 commit comments

Comments
 (0)