Rust 1.3 发布,该版本最显著的变化是 announcement API 的稳定性及性能的提升。此外,还有新的子字符串匹配算法,一个快速的 zero-filling 方法用于初始化和调整向量,提升了 Read::read_to_end 函数的速度(via lwn.net) 。
Rust 1.3发行日志的更新列表如下:
Highlights
- The new object lifetime defaults have been turned on after a cycle of warnings about the change. Now types like
&'a Box<Trait>(or&'a Rc<Trait>, etc) will change from being interpreted as&'a Box<Trait+'a>to&'a Box<Trait+'static>. - The Rustonomicon is a new book in the official documentation that dives into writing unsafe Rust.
- The
DurationAPI, has been stabilized. This basic unit of timekeeping is employed by other std APIs, as well as out-of-tree time crates.
Breaking Changes
- The new object lifetime defaults have been turned on after a cycle of warnings about the change.
- There is a known regression in how object lifetime elision is interpreted, the proper solution for which is undetermined.
- The
#[prelude_import]attribute, an internal implementation detail, was accidentally stabilized previously. It has been put behind theprelude_importfeature gate. This change is believed to break no existing code. - The behavior of
size_of_valandalign_of_valismore sane for dynamically sized types. Code that relied on the previous behavior is thought to be broken. - The
dropckrules, which checks that destructors can't access destroyed values, have been updated to match theRFC. This fixes some soundness holes, and as such will cause some previously-compiling code to no longer build.
Language
- The new object lifetime defaults have been turned on after a cycle of warnings about the change.
- Semicolons may now follow types and paths in macros.
- The behavior of
size_of_valandalign_of_valismore sane for dynamically sized types. Code that relied on the previous behavior is not known to exist, and suspected to be broken. 'staticvariables may now be recursive.refbindings choose betweenDerefandDerefMutimplementations correctly.- The
dropckrules, which checks that destructors can't access destroyed values, have been updated to match theRFC.
Libraries
- The
DurationAPI, has been stabilized, as well as thestd::timemodule, which presently contains onlyDuration. Box<str>andBox<[T]>both implementClone.- The owned C string,
CString, implementsBorrowand the borrowed C string,CStr, implementsToOwned. The two of these allow C strings to be borrowed and cloned in generic code. CStrimplementsDebug.AtomicPtrimplementsDebug.Errortrait objects can be downcast to their concrete typesin many common configurations, using theis,downcast,downcast_refanddowncast_mutmethods, similarly to theAnytrait.- Searching for substrings now employs the two-way algorithminstead of doing a naive search. This gives major speedups to a number of methods, including
contains,find,rfind,split.starts_withandends_withare also faster. - The performance of
PartialEqfor slices is much faster. - The
Hashtrait offers the default method,hash_slice, which is overridden and optimized by the implementations for scalars. - The
Hashertrait now has a number of specializedwrite_*methods for primitive types, for efficiency. - The I/O-specific error type,
std::io::Error, gained a set of methods for accessing the 'inner error', if any:get_ref,get_mut,into_inner. As well, the implementation ofstd::error::Error::causealso delegates to the inner error. process::Childgained theidmethod, which returns au32representing the platform-specific process identifier.- The
connectmethod on slices is deprecated, replaced by the newjoinmethod (note that both of these are on the unstableSliceConcatExttrait, but through the magic of the prelude are available to stable code anyway). - The
Divoperator is implemented forWrappingtypes. DerefMutis implemented forString.- Performance of SipHash (the default hasher for
HashMap) isbetter for long data. AtomicPtrimplementsSend.- The
read_to_endimplementations forStdinandFileare now specialized to use uninitalized buffers for increased performance. - Lifetime parameters of foreign functions are now resolved properly.
Misc
- Rust can now, with some coercion, produce programs that run on Windows XP, though XP is not considered a supported platform.
- Porting Rust on Windows from the GNU toolchain to MSVC continues (1, 2, 3, 4). It is still not recommended for use in 1.3, though should be fully-functional in the 64-bit 1.4 beta.
- On Fedora-based systems installation will properly configure the dynamic linker.
- The compiler gained many new extended error descriptions, which can be accessed with the
--explainflag. - The
dropckpass, which checks that destructors can't access destroyed values, has been rewritten. This fixes some soundness holes, and as such will cause some previously-compiling code to no longer build. rustcnow uses LLVM to write archive files where possible. Eventually this will eliminate the compiler's dependency on the ar utility.- Rust has preliminary support for i686 FreeBSD (it has long supported FreeBSD on x86_64).
- The
unused_mut,unconditional_recursion,improper_ctypes, andnegate_unsignedlints are more strict. - If landing pads are disabled (with
-Z no-landing-pads),panic!will kill the process instead of leaking.
更多内容可查看:Rust-1.3。
Rust 是 Mozilla 的一个新的编程语言,由web语言的领军人物Brendan Eich(js之父),Dave Herman以及Mozilla公司的Graydon Hoare 合力开发。
Rust 1.2 稳定版发布下载,Mozilla 编程语言 http://www.linuxidc.com/Linux/2015-08/121290.htm
为什么我说 Rust 是靠谱的编程语言 http://www.linuxidc.com/Linux/2015-05/117711.htm
Rust 1.2带来了更快的编译速度和并行代码生成 http://www.linuxidc.com/Linux/2015-08/121830.htm
Rust 的详细介绍:请点这里
Rust 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-09/123225.htm
