原文
Rust团队很高兴地声明推出Rust的新版本1.75.0.
如果你rustup安装了以前版本的Rust,你可如下取1.75.0:
$ rustup update stable
1.75.0稳定版中的功能
async fn和特征中的返回位置impl Trait.
指针字节偏移API
原始指针(*const T和*mutT)过去主要支持,T为单位的操作.如,<*constT>::add(1)会给指针地址加size_of::<T>()字节.
有时,使用字节偏移更方便,且这些新API避免了要求调用者先按*const u8/*mut u8转换.
pointer::byte_add
pointer::byte_offset
pointer::byte_offset_from
pointer::byte_sub
pointer::wrapping_byte_add
pointer::wrapping_byte_offset
pointer::wrapping_byte_sub
rustc优化代码布局
此工具优化了包含大部分rustc代码的librustc_driver.so库的布局,从而提高了高速缓存利用率.
现在还使用-Ccodegen-units=1构建rustc,这样可更多LLVM中的优化.为基准测试提高了1.5%.
在此版本中,优化仅限于x86_64-unknown-linux-gnu编译器,但想未来扩展来以包括更多平台.
稳定的API
Atomic*::from_ptr
FileTimes
FileTimesExt
File::set_modified
File::set_times
IpAddr::to_canonical
Ipv6Addr::to_canonical
Option::as_slice
Option::as_mut_slice
pointer::byte_add
pointer::byte_offset
pointer::byte_offset_from
pointer::byte_sub
pointer::wrapping_byte_add
pointer::wrapping_byte_offset
pointer::wrapping_byte_sub
这些API现在在常环境中是稳定的:
Ipv6Addr::to_ipv4_mapped
MaybeUninit::assume_init_read
MaybeUninit::zeroed
mem::discriminant
mem::zeroed