Skip to content

Commit 71187b7

Browse files
authored
Make core::convert::identity a const fn.
1 parent c2217b7 commit 71187b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/libcore/convert.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@
104104
/// assert_eq!(vec![1, 3], filtered);
105105
/// ```
106106
#[unstable(feature = "convert_id", issue = "0")]
107+
#[rustc_const_unstable(feature = "const_convert_id")]
107108
#[inline]
108-
pub fn identity<T>(x: T) -> T { x }
109+
pub const fn identity<T>(x: T) -> T { x }
109110

110111
/// A cheap reference-to-reference conversion. Used to convert a value to a
111112
/// reference value within generic code.

0 commit comments

Comments
 (0)