diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-10-23 18:06:11 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-11-10 01:10:07 +0100 |
| commit | d1d2aa22c0d15465af1daccdb3821450c98d0ed0 (patch) | |
| tree | 18c62f427f6e1efd2edd878b565fcfd1e2897c5c /src/libstd | |
| parent | 53fe6294170e5f872877e87c1b05795b2b4d11d1 (diff) | |
| download | rust-d1d2aa22c0d15465af1daccdb3821450c98d0ed0.tar.gz rust-d1d2aa22c0d15465af1daccdb3821450c98d0ed0.zip | |
reduce list to functions callable in const ctx.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 2 | ||||
| -rw-r--r-- | src/libstd/ffi/c_str.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/buffered.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/mod.rs | 6 | ||||
| -rw-r--r-- | src/libstd/net/addr.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net/ip.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/condvar.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/once.rs | 2 | ||||
| -rw-r--r-- | src/libstd/thread/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/time.rs | 2 |
12 files changed, 20 insertions, 20 deletions
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 @@ impl IntoStringError { /// 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<W> IntoInnerError<W> { /// }; /// ``` #[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 @@ impl<T, U> Chain<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<T> Take<T> { /// } /// ``` #[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 @@ impl<T> Take<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 @@ impl SocketAddrV6 { /// 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 @@ impl SocketAddrV6 { /// 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 @@ impl 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 @@ impl<'a> PrefixComponent<'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 @@ impl 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 @@ impl Path { /// 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 @@ impl<T> Receiver<T> { /// assert_eq!(iter.next(), None); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - pub const fn iter(&self) -> Iter<T> { + pub fn iter(&self) -> Iter<T> { Iter { rx: self } } @@ -1512,7 +1512,7 @@ impl<T> Receiver<T> { /// assert_eq!(iter.next(), None); /// ``` #[stable(feature = "receiver_try_iter", since = "1.15.0")] - pub const fn try_iter(&self) -> TryIter<T> { + pub fn try_iter(&self) -> TryIter<T> { 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<T> JoinHandle<T> { /// 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 } } |
