Skip to content

Commit 4c7293c

Browse files
committed
Add missed annotations for associated functions
1 parent 9d9681c commit 4c7293c

23 files changed

Lines changed: 879 additions & 0 deletions

File tree

ferrocene/doc/symbol-report.csv

Lines changed: 775 additions & 0 deletions
Large diffs are not rendered by default.

library/core/src/array/iter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ impl<T, const N: usize> IntoIter<T, N> {
223223
/// Returns a mutable slice of all elements that have not been yielded yet.
224224
#[stable(feature = "array_value_iter", since = "1.51.0")]
225225
#[inline]
226+
#[ferrocene::prevalidated]
226227
pub fn as_mut_slice(&mut self) -> &mut [T] {
227228
self.unsize_mut().as_mut_slice()
228229
}

library/core/src/array/iter/iter_inner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ impl<T> PolymorphicIter<[MaybeUninit<T>]> {
144144
}
145145

146146
#[inline]
147+
#[ferrocene::prevalidated]
147148
pub(super) fn as_mut_slice(&mut self) -> &mut [T] {
148149
// SAFETY: We know that all elements within `alive` are properly initialized.
149150
unsafe {

library/core/src/array/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ where
424424
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
425425
impl<T: [const] PartialOrd, const N: usize> const PartialOrd for [T; N] {
426426
#[inline]
427+
#[ferrocene::prevalidated]
427428
fn partial_cmp(&self, other: &[T; N]) -> Option<Ordering> {
428429
PartialOrd::partial_cmp(&&self[..], &&other[..])
429430
}
@@ -450,6 +451,7 @@ impl<T: [const] PartialOrd, const N: usize> const PartialOrd for [T; N] {
450451
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
451452
impl<T: [const] Ord, const N: usize> const Ord for [T; N] {
452453
#[inline]
454+
#[ferrocene::prevalidated]
453455
fn cmp(&self, other: &[T; N]) -> Ordering {
454456
Ord::cmp(&&self[..], &&other[..])
455457
}

library/core/src/char/methods.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ impl char {
464464
without modifying the original"]
465465
#[stable(feature = "rust1", since = "1.0.0")]
466466
#[inline]
467+
#[ferrocene::prevalidated]
467468
pub fn escape_unicode(self) -> EscapeUnicode {
468469
EscapeUnicode::new(self)
469470
}
@@ -587,6 +588,7 @@ impl char {
587588
without modifying the original"]
588589
#[stable(feature = "rust1", since = "1.0.0")]
589590
#[inline]
591+
#[ferrocene::prevalidated]
590592
pub fn escape_default(self) -> EscapeDefault {
591593
match self {
592594
'\t' => EscapeDefault::backslash(ascii::Char::SmallT),
@@ -998,6 +1000,7 @@ impl char {
9981000
#[stable(feature = "rust1", since = "1.0.0")]
9991001
#[rustc_const_stable(feature = "const_char_classify", since = "1.87.0")]
10001002
#[inline]
1003+
#[ferrocene::prevalidated]
10011004
pub const fn is_whitespace(self) -> bool {
10021005
match self {
10031006
' ' | '\x09'..='\x0d' => true,
@@ -1577,6 +1580,7 @@ impl char {
15771580
#[must_use]
15781581
#[unstable(feature = "ascii_char", issue = "110998")]
15791582
#[inline]
1583+
#[ferrocene::prevalidated]
15801584
pub const fn as_ascii(&self) -> Option<ascii::Char> {
15811585
if self.is_ascii() {
15821586
// SAFETY: Just checked that this is ASCII.
@@ -2118,6 +2122,7 @@ impl char {
21182122
#[stable(feature = "ascii_ctype_on_intrinsics", since = "1.24.0")]
21192123
#[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]
21202124
#[inline]
2125+
#[ferrocene::prevalidated]
21212126
pub const fn is_ascii_whitespace(&self) -> bool {
21222127
matches!(*self, '\t' | '\n' | '\x0C' | '\r' | ' ')
21232128
}

library/core/src/char/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ pub struct EscapeUnicode(EscapeIterInner<10, AlwaysEscaped>);
168168

169169
impl EscapeUnicode {
170170
#[inline]
171+
#[ferrocene::prevalidated]
171172
const fn new(c: char) -> Self {
172173
Self(EscapeIterInner::unicode(c))
173174
}
@@ -234,16 +235,19 @@ pub struct EscapeDefault(EscapeIterInner<10, AlwaysEscaped>);
234235

235236
impl EscapeDefault {
236237
#[inline]
238+
#[ferrocene::prevalidated]
237239
const fn printable(c: ascii::Char) -> Self {
238240
Self(EscapeIterInner::ascii(c.to_u8()))
239241
}
240242

241243
#[inline]
244+
#[ferrocene::prevalidated]
242245
const fn backslash(c: ascii::Char) -> Self {
243246
Self(EscapeIterInner::backslash(c))
244247
}
245248

246249
#[inline]
250+
#[ferrocene::prevalidated]
247251
const fn unicode(c: char) -> Self {
248252
Self(EscapeIterInner::unicode(c))
249253
}

library/core/src/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,7 @@ mod impls {
22442244
A: [const] Ord,
22452245
{
22462246
#[inline]
2247+
#[ferrocene::prevalidated]
22472248
fn cmp(&self, other: &Self) -> Ordering {
22482249
Ord::cmp(*self, *other)
22492250
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ where
118118
self.try_rfold((), |(), x| ControlFlow::Break(x)).break_value()
119119
}
120120

121+
#[ferrocene::prevalidated]
121122
fn try_rfold<B, F, R>(&mut self, init: B, mut f: F) -> R
122123
where
123124
Self: Sized,
@@ -151,6 +152,7 @@ where
151152
I: DoubleEndedIterator + ExactSizeIterator,
152153
{
153154
/// Updates `self.remainder` such that `self.iter.len` is divisible by `N`.
155+
#[ferrocene::prevalidated]
154156
fn next_back_remainder(&mut self) {
155157
// Make sure to not override `self.remainder` with an empty array
156158
// when `next_back` is called after `ArrayChunks` exhaustion.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ where
5252
}
5353

5454
#[inline]
55+
#[ferrocene::prevalidated]
5556
fn try_fold<Acc, Fold, R>(&mut self, init: Acc, mut fold: Fold) -> R
5657
where
5758
Self: Sized,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ where
186186
}
187187
}
188188

189+
#[ferrocene::prevalidated]
189190
fn try_fold<B, F, T>(&mut self, init: B, mut f: F) -> T
190191
where
191192
F: FnMut(B, Self::Item) -> T,

0 commit comments

Comments
 (0)