Change History (5)
comment:1 by , 10 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Summary: | rustc-1.79,0 → rustc-1.79.0 |
comment:2 by , 10 months ago
Built fine. Test results is all clean!
- librsvg built and runs fine
- cbindgen built and runs fine
- rust-bindgen built and runs fine
- Mesa built fine, no way to test (I've no NVIDIA card for now)
- snapshot built and runs fine
comment:3 by , 10 months ago
- firefox built and runs fine
- thunderbird built and runs fine
I'll leave seamonkey because I don't want to install another Python. Personally I believe seamonkey should be archived.
comment:5 by , 10 months ago
What's in 1.79.0 stable
Inline const
expressions
const { ... }
blocks are now stable in expression position, permitting
explicitly entering a const context without requiring extra declarations (e.g.,
defining const
items or associated constants on a trait).
Unlike const items (const ITEM: ... = ...
), inline consts are able to make
use of in-scope generics, and have their type inferred rather than written explicitly, making them particularly useful for inline code snippets. For example, a pattern like:
const EMPTY: Option<Vec<u8>> = None; let foo = [EMPTY; 100];
can now be written like this:
let foo = [const { None }; 100];
Notably, this is also true of generic contexts, where previously a verbose trait declaration with an associated constant would be required:
fn create_none_array<T, const N: usize>() -> [Option<T>; N] { [const { None::<T> }; N] }
This makes this code much more succinct and easier to read.
See the reference documentation for details.
Bounds in associated type position
Rust 1.79 stabilizes the associated item bounds syntax, which allows us to put
bounds in associated type position within other bounds, i.e.
T: Trait<Assoc: Bounds...>
. This avoids the need to provide an extra,
explicit generic type just to constrain the associated type.
This feature allows specifying bounds in a few places that previously either were not possible or imposed extra, unnecessary constraints on usage:
where
clauses - in this position, this is equivalent to breaking up the bound into two (or more)where
clauses. For example,where T: Trait<Assoc: Bound>
is equivalent towhere T: Trait, <T as Trait>::Assoc: Bound
.- Supertraits - a bound specified via the new syntax is implied when the trait is used, unlike where clauses. Sample syntax:
trait CopyIterator: Iterator<Item: Copy> {}
. - Associated type item bounds - This allows constraining the *nested* rigid projections that are associated with a trait's associated types. e.g.
trait Trait { type Assoc: Trait2<Assoc2: Copy>; }
. - opaque type bounds (RPIT, TAIT) - This allows constraining associated types that are associated with the opaque type without having to *name* the opaque type. For example,
impl Iterator<Item: Copy>
defines an iterator whose item isCopy
without having to actually name that item bound.
See the stabilization report for more details.
Extending automatic temporary lifetime extension
Temporaries which are immediately referenced in construction are now
automatically lifetime extended in match
and if
constructs. This has the
same behavior as lifetime extension for temporaries in block constructs.
For example:
let a = if true { ..; &temp() // used to error, but now gets lifetime extended } else { ..; &temp() // used to error, but now gets lifetime extended };
and
let a = match () { _ => { ..; &temp() // used to error, but now gets lifetime extended } };
are now consistent with prior behavior:
let a = { ..; &temp() // lifetime is extended };
This behavior is backwards compatible since these programs used to fail compilation.
Frame pointers enabled in standard library builds
The standard library distributed by the Rust project is now compiled with
-Cforce-frame-pointers=yes
, enabling downstream users to more easily profile
their programs. Note that the standard library also continues to come up with
line-level debug info (e.g., DWARF), though that is stripped by default in Cargo's release profiles.
Stabilized APIs
- [
{integer}::unchecked_add
](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add) - [
{integer}::unchecked_mul
](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul) - [
{integer}::unchecked_sub
](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub) - [
<[T]>::split_at_unchecked
](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked) - [
<[T]>::split_at_mut_unchecked
](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked) - [
<[u8]>::utf8_chunks
](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8_chunks) - [
str::Utf8Chunks
](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html) - [
str::Utf8Chunk
](https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html) - [
<*const T>::is_aligned
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned) - [
<*mut T>::is_aligned
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1) - [
NonNull::is_aligned
](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned) - [
<*const [T]>::len
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len) - [
<*mut [T]>::len
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1) - [
<*const [T]>::is_empty
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty) - [
<*mut [T]>::is_empty
](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1) - [
NonNull::<[T]>::is_empty
](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty) - [
CStr::count_bytes
](https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes) - [
io::Error::downcast
](https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast) - [
num::NonZero<T>
](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html) - [
path::absolute
](https://doc.rust-lang.org/stable/std/path/fn.absolute.html) - [
proc_macro::Literal::byte_character
](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character) - [
proc_macro::Literal::c_string
](https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string)
These APIs are now stable in const contexts:
- [
Atomic*::into_inner
](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner) - [
io::Cursor::new
](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new) - [
io::Cursor::get_ref
](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref) - [
io::Cursor::position
](https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position) - [
io::empty
](https://doc.rust-lang.org/stable/std/io/fn.empty.html) - [
io::repeat
](https://doc.rust-lang.org/stable/std/io/fn.repeat.html) - [
io::sink
](https://doc.rust-lang.org/stable/std/io/fn.sink.html) - [
panic::Location::caller
](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller) - [
panic::Location::file
](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file) - [
panic::Location::line
](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line) - [
panic::Location::column
](https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column)
Other changes
Check out everything that changed in Rust, Cargo, and Clippy.
Contributors to 1.79.0
Many people came together to create Rust 1.79.0. We couldn't have done it without all of you. Thanks!
Mine.