Path to this page:
Subject: CVS commit: pkgsrc/lang/rust
From: Ryo ONODERA
Date: 2018-05-18 14:45:52
Message id: 20180518124552.EBA45FBEC@cvs.NetBSD.org
Log Message:
Update to 1.26.0
Changelog:
Version 1.26.0 (2018-05-10)
Language
Closures now implement Copy and/or Clone if all captured variables implement \
either or both traits.
The inclusive range syntax e.g. for x in 0..=10 is now stable.
Stablise '_. The underscore lifetime can be used anywhere where a lifetime \
can be elided.
impl Trait is now stable allowing you to have abstract types in returns or \
in function parameters. e.g. fn foo() -> impl Iterator<Item=u8> or fn \
open(path: impl AsRef<Path>).
Pattern matching will now automatically apply dereferences.
128-bit integers in the form of u128 and i128 are now stable.
main can now return Result<(), E: Debug> in addition to ().
A lot of operations are now available in a const context. E.g. You can now \
index into constant arrays, reference and dereference into constants, and use \
Tuple struct constructors.
Fixed entry slice patterns are now stable. e.g.
let points = [1, 2, 3, 4];
match points {
[1, 2, 3, 4] => println!("All points were sequential."),
_ => println!("Not all points were sequential."),
}
Compiler
LLD is now used as the default linker for wasm32-unknown-unknown.
Fixed exponential projection complexity on nested types. This can provide up \
to a ~12% reduction in compile times for certain crates.
Added the --remap-path-prefix option to rustc. Allowing you to remap path \
prefixes outputted by the compiler.
Added powerpc-unknown-netbsd target.
Libraries
Implemented From<u16> for usize & From<{u8, i16}> for isize.
Added hexadecimal formatting for integers with fmt::Debug e.g. \
assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, \
00]")
Implemented Default, Hash for cmp::Reverse.
Optimized str::repeat being 8x faster in large cases.
ascii::escape_default is now available in libcore.
Trailing commas are now supported in std and core macros.
Implemented Copy, Clone for cmp::Reverse
Implemented Clone for char::{ToLowercase, ToUppercase}.
Stabilized APIs
*const T::add
*const T::copy_to_nonoverlapping
*const T::copy_to
*const T::read_unaligned
*const T::read_volatile
*const T::read
*const T::sub
*const T::wrapping_add
*const T::wrapping_sub
*mut T::add
*mut T::copy_to_nonoverlapping
*mut T::copy_to
*mut T::read_unaligned
*mut T::read_volatile
*mut T::read
*mut T::replace
*mut T::sub
*mut T::swap
*mut T::wrapping_add
*mut T::wrapping_sub
*mut T::write_bytes
*mut T::write_unaligned
*mut T::write_volatile
*mut T::write
Box::leak
FromUtf8Error::as_bytes
LocalKey::try_with
Option::cloned
btree_map::Entry::and_modify
fs::read_to_string
fs::read
fs::write
hash_map::Entry::and_modify
iter::FusedIterator
ops::RangeInclusive
ops::RangeToInclusive
process::id
slice::rotate_left
slice::rotate_right
String::retain
Cargo
Cargo will now output path to custom commands when -v is passed with --list
The Cargo binary version is now the same as the Rust version
Cargo.lock files are now included in published crates.
Misc
The second edition of "The Rust Programming Language" book is now \
recommended over the first.
Compatibility Notes
aliasing a Fn trait as dyn no longer works. E.g. the following syntax is now \
invalid.
use std::ops::Fn as dyn;
fn g(_: Box<dyn(std::fmt::Debug)>) {}
The result of dereferences are no longer promoted to 'static. e.g.
fn main() {
const PAIR: &(i32, i32) = &(0, 1);
let _reversed_pair: &'static _ = &(PAIR.1, PAIR.0); // Doesn't work
}
Deprecate AsciiExt trait in favor of inherent methods.
".e0" will now no longer parse as 0.0 and will instead cause an error.
Removed hoedown from rustdoc.
Bounds on higher-kinded lifetimes a hard error.
Files: