7

Extend the const swap feature by est31 · Pull Request #90644 · rust-lang/rust ·...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/90644
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

est31 commented 16 days ago

edited

Adds the const_swap feature gate to three more swap functions. cc tracking issue #83163

impl<T> [T] {
    pub const fn swap(&mut self, a: usize, b: usize);
    pub const unsafe fn swap_unchecked(&mut self, a: usize, b: usize);
}
impl<T: ?Sized> *mut T {
    pub const unsafe fn swap(self, with: *mut T);
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK