Mark 'make_ascii_uppercase' and 'make_ascii_lowercase' in 'char' as const;
This commit is contained in:
parent
82d17a4db3
commit
be9b3b459a
@ -1277,8 +1277,9 @@ impl char {
|
|||||||
///
|
///
|
||||||
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
|
/// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase
|
||||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||||
|
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn make_ascii_uppercase(&mut self) {
|
pub const fn make_ascii_uppercase(&mut self) {
|
||||||
*self = self.to_ascii_uppercase();
|
*self = self.to_ascii_uppercase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1302,8 +1303,9 @@ impl char {
|
|||||||
///
|
///
|
||||||
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
|
/// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase
|
||||||
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
|
||||||
|
#[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn make_ascii_lowercase(&mut self) {
|
pub const fn make_ascii_lowercase(&mut self) {
|
||||||
*self = self.to_ascii_lowercase();
|
*self = self.to_ascii_lowercase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user