Skip to content

Commit d1d2aa2

Browse files
committed
reduce list to functions callable in const ctx.
1 parent 53fe629 commit d1d2aa2

File tree

26 files changed

+55
-55
lines changed

26 files changed

+55
-55
lines changed

src/liballoc/collections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ impl<K, V> BTreeMap<K, V> {
20742074
/// assert_eq!(a.len(), 1);
20752075
/// ```
20762076
#[stable(feature = "rust1", since = "1.0.0")]
2077-
pub const fn len(&self) -> usize {
2077+
pub fn len(&self) -> usize {
20782078
self.length
20792079
}
20802080

@@ -2093,7 +2093,7 @@ impl<K, V> BTreeMap<K, V> {
20932093
/// assert!(!a.is_empty());
20942094
/// ```
20952095
#[stable(feature = "rust1", since = "1.0.0")]
2096-
pub const fn is_empty(&self) -> bool {
2096+
pub fn is_empty(&self) -> bool {
20972097
self.len() == 0
20982098
}
20992099
}

src/liballoc/collections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ impl<T> BTreeSet<T> {
730730
/// assert_eq!(v.len(), 1);
731731
/// ```
732732
#[stable(feature = "rust1", since = "1.0.0")]
733-
pub const fn len(&self) -> usize {
733+
pub fn len(&self) -> usize {
734734
self.map.len()
735735
}
736736

@@ -747,7 +747,7 @@ impl<T> BTreeSet<T> {
747747
/// assert!(!v.is_empty());
748748
/// ```
749749
#[stable(feature = "rust1", since = "1.0.0")]
750-
pub const fn is_empty(&self) -> bool {
750+
pub fn is_empty(&self) -> bool {
751751
self.len() == 0
752752
}
753753
}

src/liballoc/collections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ impl<T> VecDeque<T> {
933933
/// assert!(!v.is_empty());
934934
/// ```
935935
#[stable(feature = "rust1", since = "1.0.0")]
936-
pub const fn is_empty(&self) -> bool {
936+
pub fn is_empty(&self) -> bool {
937937
self.tail == self.head
938938
}
939939

src/liballoc/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ impl String {
13741374
/// ```
13751375
#[inline]
13761376
#[stable(feature = "rust1", since = "1.0.0")]
1377-
pub const fn len(&self) -> usize {
1377+
pub fn len(&self) -> usize {
13781378
self.vec.len()
13791379
}
13801380

@@ -1395,7 +1395,7 @@ impl String {
13951395
/// ```
13961396
#[inline]
13971397
#[stable(feature = "rust1", since = "1.0.0")]
1398-
pub const fn is_empty(&self) -> bool {
1398+
pub fn is_empty(&self) -> bool {
13991399
self.len() == 0
14001400
}
14011401

@@ -1662,7 +1662,7 @@ impl FromUtf8Error {
16621662
/// assert_eq!(1, error.valid_up_to());
16631663
/// ```
16641664
#[stable(feature = "rust1", since = "1.0.0")]
1665-
pub const fn utf8_error(&self) -> Utf8Error {
1665+
pub fn utf8_error(&self) -> Utf8Error {
16661666
self.error
16671667
}
16681668
}

src/liballoc/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ impl<T> Vec<T> {
11651165
/// ```
11661166
#[inline]
11671167
#[stable(feature = "rust1", since = "1.0.0")]
1168-
pub const fn len(&self) -> usize {
1168+
pub fn len(&self) -> usize {
11691169
self.len
11701170
}
11711171

@@ -1181,7 +1181,7 @@ impl<T> Vec<T> {
11811181
/// assert!(!v.is_empty());
11821182
/// ```
11831183
#[stable(feature = "rust1", since = "1.0.0")]
1184-
pub const fn is_empty(&self) -> bool {
1184+
pub fn is_empty(&self) -> bool {
11851185
self.len() == 0
11861186
}
11871187

src/libcore/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Layout {
116116
/// The minimum size in bytes for a memory block of this layout.
117117
#[stable(feature = "alloc_layout", since = "1.28.0")]
118118
#[inline]
119-
pub const fn size(&self) -> usize { self.size_ }
119+
pub fn size(&self) -> usize { self.size_ }
120120

121121
/// The minimum byte alignment for a memory block of this layout.
122122
#[stable(feature = "alloc_layout", since = "1.28.0")]

src/libcore/char/decode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<I: Iterator<Item = u16>> Iterator for DecodeUtf16<I> {
130130
impl DecodeUtf16Error {
131131
/// Returns the unpaired surrogate which caused this error.
132132
#[stable(feature = "decode_utf16", since = "1.9.0")]
133-
pub const fn unpaired_surrogate(&self) -> u16 {
133+
pub fn unpaired_surrogate(&self) -> u16 {
134134
self.code
135135
}
136136
}

src/libcore/fmt/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'a> Arguments<'a> {
341341
#[doc(hidden)] #[inline]
342342
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
343343
issue = "0")]
344-
pub const fn new_v1(pieces: &'a [&'a str],
344+
pub fn new_v1(pieces: &'a [&'a str],
345345
args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
346346
Arguments {
347347
pieces,
@@ -359,7 +359,7 @@ impl<'a> Arguments<'a> {
359359
#[doc(hidden)] #[inline]
360360
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
361361
issue = "0")]
362-
pub const fn new_v1_formatted(pieces: &'a [&'a str],
362+
pub fn new_v1_formatted(pieces: &'a [&'a str],
363363
args: &'a [ArgumentV1<'a>],
364364
fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {
365365
Arguments {
@@ -1492,7 +1492,7 @@ impl<'a> Formatter<'a> {
14921492
/// assert_eq!(&format!("{:t>6}", Foo), "tttttt");
14931493
/// ```
14941494
#[stable(feature = "fmt_flags", since = "1.5.0")]
1495-
pub const fn fill(&self) -> char { self.fill }
1495+
pub fn fill(&self) -> char { self.fill }
14961496

14971497
/// Flag indicating what form of alignment was requested.
14981498
///
@@ -1562,7 +1562,7 @@ impl<'a> Formatter<'a> {
15621562
/// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
15631563
/// ```
15641564
#[stable(feature = "fmt_flags", since = "1.5.0")]
1565-
pub const fn width(&self) -> Option<usize> { self.width }
1565+
pub fn width(&self) -> Option<usize> { self.width }
15661566

15671567
/// Optionally specified precision for numeric types.
15681568
///
@@ -1589,7 +1589,7 @@ impl<'a> Formatter<'a> {
15891589
/// assert_eq!(&format!("{}", Foo(23.2)), "Foo(23.20)");
15901590
/// ```
15911591
#[stable(feature = "fmt_flags", since = "1.5.0")]
1592-
pub const fn precision(&self) -> Option<usize> { self.precision }
1592+
pub fn precision(&self) -> Option<usize> { self.precision }
15931593

15941594
/// Determines if the `+` flag was specified.
15951595
///
@@ -1617,7 +1617,7 @@ impl<'a> Formatter<'a> {
16171617
/// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
16181618
/// ```
16191619
#[stable(feature = "fmt_flags", since = "1.5.0")]
1620-
pub const fn sign_plus(&self) -> bool {
1620+
pub fn sign_plus(&self) -> bool {
16211621
self.flags & (1 << FlagV1::SignPlus as u32) != 0
16221622
}
16231623

@@ -1645,7 +1645,7 @@ impl<'a> Formatter<'a> {
16451645
/// assert_eq!(&format!("{}", Foo(23)), "Foo(23)");
16461646
/// ```
16471647
#[stable(feature = "fmt_flags", since = "1.5.0")]
1648-
pub const fn sign_minus(&self) -> bool {
1648+
pub fn sign_minus(&self) -> bool {
16491649
self.flags & (1 << FlagV1::SignMinus as u32) != 0
16501650
}
16511651

@@ -1672,7 +1672,7 @@ impl<'a> Formatter<'a> {
16721672
/// assert_eq!(&format!("{}", Foo(23)), "23");
16731673
/// ```
16741674
#[stable(feature = "fmt_flags", since = "1.5.0")]
1675-
pub const fn alternate(&self) -> bool {
1675+
pub fn alternate(&self) -> bool {
16761676
self.flags & (1 << FlagV1::Alternate as u32) != 0
16771677
}
16781678

@@ -1697,7 +1697,7 @@ impl<'a> Formatter<'a> {
16971697
/// assert_eq!(&format!("{:04}", Foo(23)), "23");
16981698
/// ```
16991699
#[stable(feature = "fmt_flags", since = "1.5.0")]
1700-
pub const fn sign_aware_zero_pad(&self) -> bool {
1700+
pub fn sign_aware_zero_pad(&self) -> bool {
17011701
self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0
17021702
}
17031703

src/libcore/panic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a> PanicInfo<'a> {
5555
issue = "0")]
5656
#[doc(hidden)]
5757
#[inline]
58-
pub const fn internal_constructor(message: Option<&'a fmt::Arguments<'a>>,
58+
pub fn internal_constructor(message: Option<&'a fmt::Arguments<'a>>,
5959
location: Location<'a>)
6060
-> Self {
6161
struct NoPayload;
@@ -96,7 +96,7 @@ impl<'a> PanicInfo<'a> {
9696
///
9797
/// [`fmt::write`]: ../fmt/fn.write.html
9898
#[unstable(feature = "panic_info_message", issue = "44489")]
99-
pub const fn message(&self) -> Option<&fmt::Arguments> {
99+
pub fn message(&self) -> Option<&fmt::Arguments> {
100100
self.message
101101
}
102102

@@ -125,7 +125,7 @@ impl<'a> PanicInfo<'a> {
125125
/// panic!("Normal panic");
126126
/// ```
127127
#[stable(feature = "panic_hooks", since = "1.10.0")]
128-
pub const fn location(&self) -> Option<&Location> {
128+
pub fn location(&self) -> Option<&Location> {
129129
// NOTE: If this is changed to sometimes return None,
130130
// deal with that case in std::panicking::default_hook and std::panicking::begin_panic_fmt.
131131
Some(&self.location)
@@ -186,7 +186,7 @@ impl<'a> Location<'a> {
186186
and related macros",
187187
issue = "0")]
188188
#[doc(hidden)]
189-
pub const fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self {
189+
pub fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self {
190190
Location { file, line, col }
191191
}
192192

@@ -208,7 +208,7 @@ impl<'a> Location<'a> {
208208
/// panic!("Normal panic");
209209
/// ```
210210
#[stable(feature = "panic_hooks", since = "1.10.0")]
211-
pub const fn file(&self) -> &str {
211+
pub fn file(&self) -> &str {
212212
self.file
213213
}
214214

@@ -230,7 +230,7 @@ impl<'a> Location<'a> {
230230
/// panic!("Normal panic");
231231
/// ```
232232
#[stable(feature = "panic_hooks", since = "1.10.0")]
233-
pub const fn line(&self) -> u32 {
233+
pub fn line(&self) -> u32 {
234234
self.line
235235
}
236236

@@ -252,7 +252,7 @@ impl<'a> Location<'a> {
252252
/// panic!("Normal panic");
253253
/// ```
254254
#[stable(feature = "panic_col", since = "1.25.0")]
255-
pub const fn column(&self) -> u32 {
255+
pub fn column(&self) -> u32 {
256256
self.col
257257
}
258258
}

src/libcore/pin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
207207
/// with the same lifetime as the original `Pin`.
208208
#[unstable(feature = "pin", issue = "49150")]
209209
#[inline(always)]
210-
pub const fn get_ref(this: Pin<&'a T>) -> &'a T {
210+
pub fn get_ref(this: Pin<&'a T>) -> &'a T {
211211
this.pointer
212212
}
213213
}
@@ -216,7 +216,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
216216
/// Convert this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
217217
#[unstable(feature = "pin", issue = "49150")]
218218
#[inline(always)]
219-
pub const fn into_ref(this: Pin<&'a mut T>) -> Pin<&'a T> {
219+
pub fn into_ref(this: Pin<&'a mut T>) -> Pin<&'a T> {
220220
Pin { pointer: this.pointer }
221221
}
222222

0 commit comments

Comments
 (0)