Skip to content

Make slice::reverse const #100663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Tracking issue for const_reverse
  • Loading branch information
clarfonthey committed Aug 20, 2022
commit ae2b1dbc8915c2a41bc3555cceb65a07c0032b05
2 changes: 1 addition & 1 deletion library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ impl<T> [T] {
/// assert!(v == [3, 2, 1]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_reverse", issue = "none")]
#[rustc_const_unstable(feature = "const_reverse", issue = "100784")]
#[inline]
pub const fn reverse(&mut self) {
let half_len = self.len() / 2;
Expand Down