From d1d2aa22c0d15465af1daccdb3821450c98d0ed0 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 23 Oct 2018 18:06:11 +0200 Subject: [PATCH] reduce list to functions callable in const ctx. --- src/liballoc/collections/btree/map.rs | 4 ++-- src/liballoc/collections/btree/set.rs | 4 ++-- src/liballoc/collections/vec_deque.rs | 2 +- src/liballoc/string.rs | 6 +++--- src/liballoc/vec.rs | 4 ++-- src/libcore/alloc.rs | 2 +- src/libcore/char/decode.rs | 2 +- src/libcore/fmt/mod.rs | 18 +++++++++--------- src/libcore/panic.rs | 14 +++++++------- src/libcore/pin.rs | 4 ++-- src/libcore/slice/mod.rs | 4 ++-- src/libcore/str/lossy.rs | 2 +- src/libcore/str/mod.rs | 2 +- src/libcore/task/wake.rs | 2 +- src/libstd/collections/hash/map.rs | 2 +- src/libstd/ffi/c_str.rs | 4 ++-- src/libstd/io/buffered.rs | 2 +- src/libstd/io/mod.rs | 6 +++--- src/libstd/net/addr.rs | 4 ++-- src/libstd/net/ip.rs | 2 +- src/libstd/path.rs | 8 ++++---- src/libstd/sync/condvar.rs | 2 +- src/libstd/sync/mpsc/mod.rs | 4 ++-- src/libstd/sync/once.rs | 2 +- src/libstd/thread/mod.rs | 2 +- src/libstd/time.rs | 2 +- 26 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index 8a721a50b46..24c8fd3a969 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -2074,7 +2074,7 @@ pub fn values_mut(&mut self) -> ValuesMut { /// assert_eq!(a.len(), 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn len(&self) -> usize { + pub fn len(&self) -> usize { self.length } @@ -2093,7 +2093,7 @@ pub const fn len(&self) -> usize { /// assert!(!a.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn is_empty(&self) -> bool { + pub fn is_empty(&self) -> bool { self.len() == 0 } } diff --git a/src/liballoc/collections/btree/set.rs b/src/liballoc/collections/btree/set.rs index 6a0ecfd3f58..af9a7074e4a 100644 --- a/src/liballoc/collections/btree/set.rs +++ b/src/liballoc/collections/btree/set.rs @@ -730,7 +730,7 @@ pub fn iter(&self) -> Iter { /// assert_eq!(v.len(), 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn len(&self) -> usize { + pub fn len(&self) -> usize { self.map.len() } @@ -747,7 +747,7 @@ pub const fn len(&self) -> usize { /// assert!(!v.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn is_empty(&self) -> bool { + pub fn is_empty(&self) -> bool { self.len() == 0 } } diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index b139b440fe1..e0ae7561d45 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -933,7 +933,7 @@ pub fn len(&self) -> usize { /// assert!(!v.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn is_empty(&self) -> bool { + pub fn is_empty(&self) -> bool { self.tail == self.head } diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 8f379c4cfb4..5c776292f53 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1374,7 +1374,7 @@ pub unsafe fn as_mut_vec(&mut self) -> &mut Vec { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub const fn len(&self) -> usize { + pub fn len(&self) -> usize { self.vec.len() } @@ -1395,7 +1395,7 @@ pub const fn len(&self) -> usize { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub const fn is_empty(&self) -> bool { + pub fn is_empty(&self) -> bool { self.len() == 0 } @@ -1662,7 +1662,7 @@ pub fn into_bytes(self) -> Vec { /// assert_eq!(1, error.valid_up_to()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn utf8_error(&self) -> Utf8Error { + pub fn utf8_error(&self) -> Utf8Error { self.error } } diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 78e9da2084d..f7a0bbdceaf 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1165,7 +1165,7 @@ pub fn clear(&mut self) { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub const fn len(&self) -> usize { + pub fn len(&self) -> usize { self.len } @@ -1181,7 +1181,7 @@ pub const fn len(&self) -> usize { /// assert!(!v.is_empty()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn is_empty(&self) -> bool { + pub fn is_empty(&self) -> bool { self.len() == 0 } diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 8b9f7f2c816..045fabca268 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -116,7 +116,7 @@ pub unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self { /// The minimum size in bytes for a memory block of this layout. #[stable(feature = "alloc_layout", since = "1.28.0")] #[inline] - pub const fn size(&self) -> usize { self.size_ } + pub fn size(&self) -> usize { self.size_ } /// The minimum byte alignment for a memory block of this layout. #[stable(feature = "alloc_layout", since = "1.28.0")] diff --git a/src/libcore/char/decode.rs b/src/libcore/char/decode.rs index bcd1e92c6d8..cc52f048b89 100644 --- a/src/libcore/char/decode.rs +++ b/src/libcore/char/decode.rs @@ -130,7 +130,7 @@ fn size_hint(&self) -> (usize, Option) { impl DecodeUtf16Error { /// Returns the unpaired surrogate which caused this error. #[stable(feature = "decode_utf16", since = "1.9.0")] - pub const fn unpaired_surrogate(&self) -> u16 { + pub fn unpaired_surrogate(&self) -> u16 { self.code } } diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 56576f8334b..4fde4e79ee2 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -341,7 +341,7 @@ impl<'a> Arguments<'a> { #[doc(hidden)] #[inline] #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "0")] - pub const fn new_v1(pieces: &'a [&'a str], + pub fn new_v1(pieces: &'a [&'a str], args: &'a [ArgumentV1<'a>]) -> Arguments<'a> { Arguments { pieces, @@ -359,7 +359,7 @@ pub const fn new_v1(pieces: &'a [&'a str], #[doc(hidden)] #[inline] #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "0")] - pub const fn new_v1_formatted(pieces: &'a [&'a str], + pub fn new_v1_formatted(pieces: &'a [&'a str], args: &'a [ArgumentV1<'a>], fmt: &'a [rt::v1::Argument]) -> Arguments<'a> { Arguments { @@ -1492,7 +1492,7 @@ pub fn flags(&self) -> u32 { self.flags } /// assert_eq!(&format!("{:t>6}", Foo), "tttttt"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn fill(&self) -> char { self.fill } + pub fn fill(&self) -> char { self.fill } /// Flag indicating what form of alignment was requested. /// @@ -1562,7 +1562,7 @@ pub fn align(&self) -> Option { /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn width(&self) -> Option { self.width } + pub fn width(&self) -> Option { self.width } /// Optionally specified precision for numeric types. /// @@ -1589,7 +1589,7 @@ pub const fn width(&self) -> Option { self.width } /// assert_eq!(&format!("{}", Foo(23.2)), "Foo(23.20)"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn precision(&self) -> Option { self.precision } + pub fn precision(&self) -> Option { self.precision } /// Determines if the `+` flag was specified. /// @@ -1617,7 +1617,7 @@ pub const fn precision(&self) -> Option { self.precision } /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn sign_plus(&self) -> bool { + pub fn sign_plus(&self) -> bool { self.flags & (1 << FlagV1::SignPlus as u32) != 0 } @@ -1645,7 +1645,7 @@ pub const fn sign_plus(&self) -> bool { /// assert_eq!(&format!("{}", Foo(23)), "Foo(23)"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn sign_minus(&self) -> bool { + pub fn sign_minus(&self) -> bool { self.flags & (1 << FlagV1::SignMinus as u32) != 0 } @@ -1672,7 +1672,7 @@ pub const fn sign_minus(&self) -> bool { /// assert_eq!(&format!("{}", Foo(23)), "23"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn alternate(&self) -> bool { + pub fn alternate(&self) -> bool { self.flags & (1 << FlagV1::Alternate as u32) != 0 } @@ -1697,7 +1697,7 @@ pub const fn alternate(&self) -> bool { /// assert_eq!(&format!("{:04}", Foo(23)), "23"); /// ``` #[stable(feature = "fmt_flags", since = "1.5.0")] - pub const fn sign_aware_zero_pad(&self) -> bool { + pub fn sign_aware_zero_pad(&self) -> bool { self.flags & (1 << FlagV1::SignAwareZeroPad as u32) != 0 } diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index af9d1596938..f0efeb59e8d 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -55,7 +55,7 @@ impl<'a> PanicInfo<'a> { issue = "0")] #[doc(hidden)] #[inline] - pub const fn internal_constructor(message: Option<&'a fmt::Arguments<'a>>, + pub fn internal_constructor(message: Option<&'a fmt::Arguments<'a>>, location: Location<'a>) -> Self { struct NoPayload; @@ -96,7 +96,7 @@ pub fn payload(&self) -> &(dyn Any + Send) { /// /// [`fmt::write`]: ../fmt/fn.write.html #[unstable(feature = "panic_info_message", issue = "44489")] - pub const fn message(&self) -> Option<&fmt::Arguments> { + pub fn message(&self) -> Option<&fmt::Arguments> { self.message } @@ -125,7 +125,7 @@ pub const fn message(&self) -> Option<&fmt::Arguments> { /// panic!("Normal panic"); /// ``` #[stable(feature = "panic_hooks", since = "1.10.0")] - pub const fn location(&self) -> Option<&Location> { + pub fn location(&self) -> Option<&Location> { // NOTE: If this is changed to sometimes return None, // deal with that case in std::panicking::default_hook and std::panicking::begin_panic_fmt. Some(&self.location) @@ -186,7 +186,7 @@ impl<'a> Location<'a> { and related macros", issue = "0")] #[doc(hidden)] - pub const fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self { + pub fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self { Location { file, line, col } } @@ -208,7 +208,7 @@ pub const fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self { /// panic!("Normal panic"); /// ``` #[stable(feature = "panic_hooks", since = "1.10.0")] - pub const fn file(&self) -> &str { + pub fn file(&self) -> &str { self.file } @@ -230,7 +230,7 @@ pub const fn file(&self) -> &str { /// panic!("Normal panic"); /// ``` #[stable(feature = "panic_hooks", since = "1.10.0")] - pub const fn line(&self) -> u32 { + pub fn line(&self) -> u32 { self.line } @@ -252,7 +252,7 @@ pub const fn line(&self) -> u32 { /// panic!("Normal panic"); /// ``` #[stable(feature = "panic_col", since = "1.25.0")] - pub const fn column(&self) -> u32 { + pub fn column(&self) -> u32 { self.col } } diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index 63a433a8b23..68de82d2945 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -207,7 +207,7 @@ pub unsafe fn map_unchecked(this: Pin<&'a T>, func: F) -> Pin<&'a U> where /// with the same lifetime as the original `Pin`. #[unstable(feature = "pin", issue = "49150")] #[inline(always)] - pub const fn get_ref(this: Pin<&'a T>) -> &'a T { + pub fn get_ref(this: Pin<&'a T>) -> &'a T { this.pointer } } @@ -216,7 +216,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> { /// Convert this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime. #[unstable(feature = "pin", issue = "49150")] #[inline(always)] - pub const fn into_ref(this: Pin<&'a mut T>) -> Pin<&'a T> { + pub fn into_ref(this: Pin<&'a mut T>) -> Pin<&'a T> { Pin { pointer: this.pointer } } diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index f8dee537062..dae425da789 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -4021,7 +4021,7 @@ impl<'a, T> ChunksExact<'a, T> { /// returned by the iterator. The returned slice has at most `chunk_size-1` /// elements. #[stable(feature = "chunks_exact", since = "1.31.0")] - pub const fn remainder(&self) -> &'a [T] { + pub fn remainder(&self) -> &'a [T] { self.rem } } @@ -4517,7 +4517,7 @@ impl<'a, T> RChunksExact<'a, T> { /// returned by the iterator. The returned slice has at most `chunk_size-1` /// elements. #[stable(feature = "rchunks", since = "1.31.0")] - pub const fn remainder(&self) -> &'a [T] { + pub fn remainder(&self) -> &'a [T] { self.rem } } diff --git a/src/libcore/str/lossy.rs b/src/libcore/str/lossy.rs index 950552fc6b1..186d6adbc91 100644 --- a/src/libcore/str/lossy.rs +++ b/src/libcore/str/lossy.rs @@ -29,7 +29,7 @@ pub fn from_bytes(bytes: &[u8]) -> &Utf8Lossy { unsafe { mem::transmute(bytes) } } - pub const fn chunks(&self) -> Utf8LossyChunksIter { + pub fn chunks(&self) -> Utf8LossyChunksIter { Utf8LossyChunksIter { source: &self.bytes } } } diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index d73e5db727c..f5bfe804899 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -231,7 +231,7 @@ impl Utf8Error { /// assert_eq!(1, error.valid_up_to()); /// ``` #[stable(feature = "utf8_error", since = "1.5.0")] - pub const fn valid_up_to(&self) -> usize { self.valid_up_to } + pub fn valid_up_to(&self) -> usize { self.valid_up_to } /// Provide more information about the failure: /// diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index 1db3a290e04..c9fb22e0080 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -141,7 +141,7 @@ pub unsafe fn new(inner: NonNull) -> Self { /// `Waker` is nearly identical to `LocalWaker`, but is threadsafe /// (implements `Send` and `Sync`). #[inline] - pub const fn as_waker(&self) -> &Waker { + pub fn as_waker(&self) -> &Waker { &self.0 } diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index b95449d11ea..c18f200872d 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -3013,7 +3013,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> { /// assert_eq!(map.entry("poneyland").key(), &"poneyland"); /// ``` #[stable(feature = "map_entry_keys", since = "1.10.0")] - pub const fn key(&self) -> &K { + pub fn key(&self) -> &K { &self.key } diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index feff65bff3f..e2dc02e40bf 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -833,7 +833,7 @@ impl NulError { /// assert_eq!(nul_error.nul_position(), 7); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn nul_position(&self) -> usize { self.0 } + pub fn nul_position(&self) -> usize { self.0 } /// Consumes this error, returning the underlying vector of bytes which /// generated the error in the first place. @@ -909,7 +909,7 @@ pub fn into_cstring(self) -> CString { /// Access the underlying UTF-8 error that was the cause of this error. #[stable(feature = "cstring_into", since = "1.7.0")] - pub const fn utf8_error(&self) -> Utf8Error { + pub fn utf8_error(&self) -> Utf8Error { self.error } } diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index bde9c57c57c..e26e6d391f8 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -633,7 +633,7 @@ impl IntoInnerError { /// }; /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn error(&self) -> &Error { &self.1 } + pub fn error(&self) -> &Error { &self.1 } /// Returns the buffered writer instance which generated the error. /// diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 4c3117260fe..c07d4a2e755 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1653,7 +1653,7 @@ pub fn into_inner(self) -> (T, U) { /// } /// ``` #[stable(feature = "more_io_inner_methods", since = "1.20.0")] - pub const fn get_ref(&self) -> (&T, &U) { + pub fn get_ref(&self) -> (&T, &U) { (&self.first, &self.second) } @@ -1780,7 +1780,7 @@ impl Take { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn limit(&self) -> u64 { self.limit } + pub fn limit(&self) -> u64 { self.limit } /// Sets the number of bytes that can be read before this instance will /// return EOF. This is the same as constructing a new `Take` instance, so @@ -1856,7 +1856,7 @@ pub fn into_inner(self) -> T { /// } /// ``` #[stable(feature = "more_io_inner_methods", since = "1.20.0")] - pub const fn get_ref(&self) -> &T { + pub fn get_ref(&self) -> &T { &self.inner } diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index fc2e8104782..ff35325ab4f 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -475,7 +475,7 @@ pub fn set_port(&mut self, new_port: u16) { /// assert_eq!(socket.flowinfo(), 10); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn flowinfo(&self) -> u32 { + pub fn flowinfo(&self) -> u32 { self.inner.sin6_flowinfo } @@ -515,7 +515,7 @@ pub fn set_flowinfo(&mut self, new_flowinfo: u32) { /// assert_eq!(socket.scope_id(), 78); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn scope_id(&self) -> u32 { + pub fn scope_id(&self) -> u32 { self.inner.sin6_scope_id } diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index c5106c9abb9..2517c45696a 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -402,7 +402,7 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { /// assert_eq!(addr.octets(), [127, 0, 0, 1]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub fn octets(&self) -> [u8; 4] { + pub fn octets(&self) -> [u8; 4] { let bits = u32::from_be(self.inner.s_addr); [(bits >> 24) as u8, (bits >> 16) as u8, (bits >> 8) as u8, bits as u8] } diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 71f39ff85e7..a153456370c 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -439,7 +439,7 @@ impl<'a> PrefixComponent<'a> { /// /// [`Prefix`]: enum.Prefix.html #[stable(feature = "rust1", since = "1.0.0")] - pub const fn kind(&self) -> Prefix<'a> { + pub fn kind(&self) -> Prefix<'a> { self.parsed } @@ -447,7 +447,7 @@ pub const fn kind(&self) -> Prefix<'a> { /// /// [`OsStr`]: ../../std/ffi/struct.OsStr.html #[stable(feature = "rust1", since = "1.0.0")] - pub const fn as_os_str(&self) -> &'a OsStr { + pub fn as_os_str(&self) -> &'a OsStr { self.raw } } @@ -1918,7 +1918,7 @@ pub fn parent(&self) -> Option<&Path> { /// [`None`]: ../../std/option/enum.Option.html#variant.None /// [`parent`]: struct.Path.html#method.parent #[stable(feature = "path_ancestors", since = "1.28.0")] - pub const fn ancestors(&self) -> Ancestors { + pub fn ancestors(&self) -> Ancestors { Ancestors { next: Some(&self), } @@ -2267,7 +2267,7 @@ pub fn iter(&self) -> Iter { /// println!("{}", path.display()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn display(&self) -> Display { + pub fn display(&self) -> Display { Display { path: self } } diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 1c6cc9cb361..3014283da5b 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -72,7 +72,7 @@ impl WaitTimeoutResult { /// } /// ``` #[stable(feature = "wait_timeout", since = "1.5.0")] - pub const fn timed_out(&self) -> bool { + pub fn timed_out(&self) -> bool { self.0 } } diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 2a2e5c030b3..b726168c7c6 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1469,7 +1469,7 @@ pub fn recv_deadline(&self, deadline: Instant) -> Result { /// assert_eq!(iter.next(), None); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter { Iter { rx: self } } @@ -1512,7 +1512,7 @@ pub const fn iter(&self) -> Iter { /// assert_eq!(iter.next(), None); /// ``` #[stable(feature = "receiver_try_iter", since = "1.15.0")] - pub const fn try_iter(&self) -> TryIter { + pub fn try_iter(&self) -> TryIter { TryIter { rx: self } } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 4dd37ec3878..cf9698cb2a9 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -517,7 +517,7 @@ impl OnceState { /// assert!(!state.poisoned()); /// }); #[unstable(feature = "once_poison", issue = "33577")] - pub const fn poisoned(&self) -> bool { + pub fn poisoned(&self) -> bool { self.poisoned } } diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 3a3d2450014..e9a97f7c747 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1391,7 +1391,7 @@ impl JoinHandle { /// println!("thread id: {:?}", thread.id()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn thread(&self) -> &Thread { + pub fn thread(&self) -> &Thread { &self.0.thread } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index a9344941f42..90ab3491599 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -449,7 +449,7 @@ impl SystemTimeError { /// } /// ``` #[stable(feature = "time2", since = "1.8.0")] - pub const fn duration(&self) -> Duration { + pub fn duration(&self) -> Duration { self.0 } } -- 2.44.0