* Add commented-out settings for cross-building to aarch64--netbsd
* Add clang wrappers (ultimately I could not complete the target build for
aarch64/8.0 using clang, due to the build wanting libgcc_s, and its
non-presence there, and I could not decipher the build logic)
* I built i386--netbsd version 1.31.1, point to my version, since
it's not available from ryoon@ and appears to be required to build 1.32.0
* Bump powerpc--netbsd version to 1.32.0
* Add pointer to cross-built aarch64--netbsd version 1.32.0,
targeting 8.99.34, using gcc as the target compiler. Untested so far.
1) bootstrap rustc adds -lgcc_s when linking
-> Dropped with a BUILDLINK_TRANSFORM
2) bootstrap rustc has shared linkage to libgcc_s.so.1
-> Until upstream changes this to static linkage, we look for
libgcc_s.so.1 in ${FILESDIR} where the user must place it manually.
3) newly built rustc adds -lstdc++ instead of -lc++ when linking llvm
-> fixed with patch-src_librustc__llvm_build.rs
4) newly built rustc adds -lgcc_s when linking
-> fixed with patch-src_libunwind_build.rs
Pkgsrc changes:
* Sadly, I had to reinstate the "make tar files" rust code to make
it possible to build cross-compiled bootstrap kits.
* Add an adjustable "BUILD_TARGET", "dist" for cross-building
a bootstrap kit, "build" for a normal native build.
* New bootstrap kits built for NetBSD/powerpc, NetBSD/earmv7hf,
and NetBSD/sparc64 version 1.31.1.
* gcc-wrap script amended to also drop -Wl,--enable-new-dtags
(so it could be used outside pkgsrc)
* Worked around use of AtomicU64 in release build tool (ugly band-aid patch).
Some platforms lack support for that type and associated operations.
Upstream changes:
- [Fix Rust failing to build on `powerpc-unknown-netbsd`][56562]
- [Fix broken go-to-definition in RLS][rls/1171]
- [Fix infinite loop on hover in RLS][rls/1170]
[56562]: https://github.com/rust-lang/rust/pull/56562
[rls/1171]: https://github.com/rust-lang/rls/issues/1171
[rls/1170]: https://github.com/rust-lang/rls/pull/1170
Changelog:
Version 1.31.0 (2018-12-06)
Language
This version marks the release of the 2018 edition of Rust.
New lifetime elision rules now allow for eliding lifetimes in functions and impl headers. E.g. impl<'a> Reader for BufReader<'a> {} can now be impl Reader for BufReader<'_> {}. Lifetimes are still required to be defined in structs.
You can now define and use const functions. These are currently a strict minimal subset of the const fn RFC. Refer to the language reference for what exactly is available.
You can now use tool lints, which allow you to scope lints from external tools using attributes. E.g. #[allow(clippy::filter_map)].
#[no_mangle] and #[export_name] attributes can now be located anywhere in a crate, not just in exported functions.
You can now use parentheses in pattern matches.
Compiler
Updated musl to 1.1.20
Libraries
You can now convert num::NonZero* types to their raw equivalvents using the From trait. E.g. u8 now implements From<NonZeroU8>.
You can now convert a &Option<T> into Option<&T> and &mut Option<T> into Option<&mut T> using the From trait.
You can now multiply (*) a time::Duration by a u32.
Stabilized APIs
slice::align_to
sl
ice::align_to_mut
slice::chunks_exact
slice::chunks_exact_mut
slice::rchunks
slice::rchunks_mut
slice::rchunks_exact
slice::rchunks_exact_mut
Option::replace
Cargo
Cargo will now download crates in parallel using HTTP/2.
You can now rename packages in your Cargo.toml We have a guide on how to use the package key in your dependencies.
- use 'build' target for building, not 'dist'
- set jobs also for install target
- do not generate tarballs; we don't need them, but they take a lot of disk-space
- do not install 'src'
- do not generate 'install.log' nor 'uninstall.sh'
- on Darwin, use headerpad_max_install_names to be able to fix all dylibs
- make optimized bootstrap
- pkglint fixes
- get ready to depend on lang/llvm and devel/jemalloc
SunOS now needs -D_POSIX_PTHREAD_SEMANTICS and a patch to the rand module
to work around getrandom() system call failures.
Add -j argument to x.py for the number of make jobs.
Upstream changes:
Language
* Procedural macros are now available. These kinds of macros allow
for more powerful code generation. There is a new chapter available
in the Rust Programming Language book that goes further in depth.
* You can now use keywords as identifiers using the raw identifiers
syntax (r#), e.g. let r#for = true;
* Using anonymous parameters in traits is now deprecated with a
warning and will be a hard error in the 2018 edition.
* You can now use crate in paths. This allows you to refer to the
crate root in the path, e.g. use crate::foo; refers to foo in
src/lib.rs.
* Using a external crate no longer requires being prefixed with
::. Previously, using a external crate in a module without a
use statement required let json = ::serde_json::from_str(foo);
but can now be written as let json = serde_json::from_str(foo);.
* You can now apply the #[used] attribute to static items to
prevent the compiler from optimising them away, even if they
appear to be unused, e.g. #[used] static FOO: u32 = 1;
* You can now import and reexport macros from other crates with
the use syntax. Macros exported with #[macro_export] are now
placed into the root module of the crate. If your macro relies
on calling other local macros, it is recommended to export with
the #[macro_export(local_inner_macros)] attribute so users won't
have to import those macros.
* You can now catch visibility keywords (e.g. pub, pub(crate)) in
macros using the vis specifier.
* Non-macro attributes now allow all forms of literals, not just
strings. Previously, you would write #[attr("true")], and you
can now write #[attr(true)].
* You can now specify a function to handle a panic in the Rust
runtime with the #[panic_handler] attribute.
Compiler
* Added the riscv32imc-unknown-none-elf target.
* Added the aarch64-unknown-netbsd target
Libraries
* ManuallyDrop now allows the inner type to be unsized.
Stabilized APIs
* Ipv4Addr::BROADCAST
* Ipv4Addr::LOCALHOST
* Ipv4Addr::UNSPECIFIED
* Ipv6Addr::LOCALHOST
* Ipv6Addr::UNSPECIFIED
* Iterator::find_map
* The following methods are replacement methods for trim_left,
trim_right, trim_left_matches, and trim_right_matches, which
will be deprecated in 1.33.0:
* str::trim_end_matches
* str::trim_end
* str::trim_start_matches
* str::trim_start
Cargo
* cargo run doesn't require specifying a package in workspaces.
* cargo doc now supports --message-format=json. This is equivalent
to calling rustdoc --error-format=json.
* Cargo will now provide a progress bar for builds.
Misc
* rustdoc allows you to specify what edition to treat your code
as with the --edition option.
* rustdoc now has the --color (specify whether to output color)
and --error-format (specify error format, e.g. json) options.
* We now distribute a rust-gdbgui script that invokes gdbgui with
Rust debug symbols.
* Attributes from Rust tools such as rustfmt or clippy are now
available, e.g. #[rustfmt::skip] will skip formatting the next
item.
Pkgsrc changest:
* Explicitly list bootstrap kit version number for each kit we carry,
so that one entry's version doesn't "bleed into" following kits.
* Tweak for handling "earmv7hf" CPU type for NetBSD in the bootstrap.py
script
* Add two patches from Debian for sparc64; rust would generate code
generating unaligned accesses, causing SIGBUS on sparc64
* Update most of the bootstrap kits to version 1.29.2; need minimum
1.29.0 to build 1.30.0.
* Rust regrettably doesn't build for powerpc or earmv7hf in this version,
most probably due to "char" being "unsigned char" on these platforms.
Ref. https://github.com/rust-lang/rust/issues/55465
Upstream changes:
* Workaround for an aliasing-related LLVM bug, which caused miscompilation.
* The rls-preview component on the windows-gnu targets has been restored.
Pkgsrc changes:
* More commented-out settings for cross builds on NetBSD.
* Bump bootstrap kit versions to 1.29.2 for powerpc, sparc64
and earm7hf. Anyone up for testing for earm7hf?
* Because the built-in versions of libgit2, libssh2 and curl
can no longer be built with the pkgsrc-provided headers for
those packages (due to version skew; the built-in versions
have been updated to un-released newer code), the buildlink3.mk
files for those packages have been commented out.
* Similarly, to avoid using the native pkgsrc host's headers when cross-
building, the gcc-wrap script has been adjusted to also re-point
/usr/pkg/include into the destination's root (where those above pacakges
are not to be installed).
* Also have the gcc-wrap script deal with "-I dir" style directives,
and re-point these also into the destination's root.
* One patch has been integrated upstream, so removed here.
Prepare wrapper script handling for use of clang (not yet fully verified).
Adjust the cross-compiler wrapper script to improve the handling
when used as the linker:
* Insert "linker tweaks" before first -L or -l
* Handle "-L arg" style as well as "-Larg"
* Add "-Wl,-rpath-link" to the linker tweaks just to be sure...
Bump PKGREVISION.
point to the bootstrap kit for NetBSD/powerpc I'm hosting at the
moment.
Also add the bits I used when cross-building the NetBSD/powerpc
rust on amd64, commented out, as well as the gcc / c++ wrapper
script I used in the process.
The changes affecting other ports are:
* We now add LD_LIBRARY_PATH in the make environment, so that
if the bootstrap kit binaries and shared libraries don't have
the $ORIGIN-style RPATH entries, it will still work
* The bootstrap.py script has been changed to turn off the
generation of debuginfo in "RUSTFLAGS"; for some so far unknown
reason, the NetBSD/powerpc rust will not build if you ask for
debug info. This could perhaps have been made OS-variant dependent,
but isn't at the moment.
So .. bump PKGREVISION.
The standard library's str::repeat function contained an out of bounds
write caused by an integer overflow. This has been fixed by
deterministically panicking when an overflow happens.
It looks like I accidentally built the 1.27.2 bootstrap without the stack clash
fix required for newer illumos platforms, so just use 1.28.0 which was built
correctly for now.
NetBSD/i386 is temporarily disabled due to missing binary bootstraps.
Version 1.28.0 (2018-08-02)
===========================
Language
--------
- [The `#[repr(transparent)]` attribute is now stable.][51562] This attribute
allows a Rust newtype wrapper (`struct NewType<T>(T);`) to be represented as
the inner type across Foreign Function Interface (FFI) boundaries.
- [The keywords `pure`, `sizeof`, `alignof`, and `offsetof` have been unreserved
and can now be used as identifiers.][51196]
- [The `GlobalAlloc` trait and `#[global_allocator]` attribute are now
stable.][51241] This will allow users to specify a global allocator for
their program.
- [Unit test functions marked with the `#[test]` attribute can now return
`Result<(), E: Debug>` in addition to `()`.][51298]
- [The `lifetime` specifier for `macro_rules!` is now stable.][50385] This
allows macros to easily target lifetimes.
Compiler
--------
- [The `s` and `z` optimisation levels are now stable.][50265] These optimisations
prioritise making smaller binary sizes. `z` is the same as `s` with the
exception that it does not vectorise loops, which typically results in an even
smaller binary.
- [The short error format is now stable.][49546] Specified with
`--error-format=short` this option will provide a more compressed output of
rust error messages.
- [Added a lint warning when you have duplicated `macro_export`s.][50143]
- [Reduced the number of allocations in the macro parser.][50855] This can
improve compile times of macro heavy crates on average by 5%.
Libraries
---------
- [Implemented `Default` for `&mut str`.][51306]
- [Implemented `From<bool>` for all integer and unsigned number types.][50554]
- [Implemented `Extend` for `()`.][50234]
- [The `Debug` implementation of `time::Duration` should now be more easily
human readable.][50364] Previously a `Duration` of one second would printed as
`Duration { secs: 1, nanos: 0 }` and will now be printed as `1s`.
- [Implemented `From<&String>` for `Cow<str>`, `From<&Vec<T>>` for `Cow<[T]>`,
`From<Cow<CStr>>` for `CString`, `From<CString>, From<CStr>, From<&CString>`
for `Cow<CStr>`, `From<OsString>, From<OsStr>, From<&OsString>` for
`Cow<OsStr>`, `From<&PathBuf>` for `Cow<Path>`, and `From<Cow<Path>>`
for `PathBuf`.][50170]
- [Implemented `Shl` and `Shr` for `Wrapping<u128>`
and `Wrapping<i128>`.][50465]
- [`DirEntry::metadata` now uses `fstatat` instead of `lstat` when
possible.][51050] This can provide up to a 40% speed increase.
- [Improved error messages when using `format!`.][50610]
Stabilized APIs
---------------
- [`Iterator::step_by`]
- [`Path::ancestors`]
- [`SystemTime::UNIX_EPOCH`]
- [`alloc::GlobalAlloc`]
- [`alloc::Layout`]
- [`alloc::LayoutErr`]
- [`alloc::System`]
- [`alloc::alloc`]
- [`alloc::alloc_zeroed`]
- [`alloc::dealloc`]
- [`alloc::realloc`]
- [`alloc::handle_alloc_error`]
- [`btree_map::Entry::or_default`]
- [`fmt::Alignment`]
- [`hash_map::Entry::or_default`]
- [`iter::repeat_with`]
- [`num::NonZeroUsize`]
- [`num::NonZeroU128`]
- [`num::NonZeroU16`]
- [`num::NonZeroU32`]
- [`num::NonZeroU64`]
- [`num::NonZeroU8`]
- [`ops::RangeBounds`]
- [`slice::SliceIndex`]
- [`slice::from_mut`]
- [`slice::from_ref`]
- [`{Any + Send + Sync}::downcast_mut`]
- [`{Any + Send + Sync}::downcast_ref`]
- [`{Any + Send + Sync}::is`]
Cargo
-----
- [Cargo will now no longer allow you to publish crates with build scripts that
modify the `src` directory.][cargo/5584] The `src` directory in a crate should be
considered to be immutable.
Misc
----
- [The `suggestion_applicability` field in `rustc`'s json output is now
stable.][50486] This will allow dev tools to check whether a code suggestion
would apply to them.
Compatibility Notes
-------------------
- [Rust will no longer consider trait objects with duplicated constraints to
have implementations.][51276] For example the below code will now fail
to compile.
```rust
trait Trait {}
impl Trait + Send {
fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test`
}
impl Trait + Send + Send {
fn test(&self) { println!("two"); }
}
```
Changelog:
Version 1.27.2 (2018-07-20)
Compatibility Notes
* The borrow checker was fixed to avoid potential unsoundness when using
match ergonomics: #52213.
Version 1.27.1 (2018-07-10)
Security Notes
* rustdoc would execute plugins in the /tmp/rustdoc/plugins directory when
running, which enabled executing code as some other user on a given
machine. This release fixes that vulnerability; you can read more about
this on the blog.
Thank you to Red Hat for responsibily disclosing this vulnerability to us.
Compatibility Notes
* The borrow checker was fixed to avoid an additional potential unsoundness
when using match ergonomics: #51415, #49534.
Changelog:
Version 1.27.1 (2018-07-10)
Security Notes
rustdoc would execute plugins in the /tmp/rustdoc/plugins directory when running, which enabled executing code as some other user on a given machine. This release fixes that vulnerability; you can read more about this on the blog.
Thank you to Red Hat for responsibily disclosing this vulnerability to us.
Compatibility Notes
The borrow checker was fixed to avoid an additional potential unsoundness when using match ergonomics: #51415, #49534
* SunOS parts are from jperkin@.
Changelog:
Version 1.27.0 (2018-06-21)
Language
Removed 'proc' from the reserved keywords list. This allows proc to be used as an identifer.
The dyn syntax is now available. This syntax is equivalent to the bare Trait syntax, and should make it clearer when being used in tandem with impl Trait. Since it is equivalent to the following syntax: &Trait == &dyn Trait, &mut Trait == &mut dyn Trait, and Box<Trait> == Box<dyn Trait>.
Attributes on generic parameters such as types and lifetimes are now stable. e.g. fn foo<#[lifetime_attr] 'a, #[type_attr] T: 'a>() {}
The #[must_use] attribute can now also be used on functions as well as types. It provides a lint that by default warns users when the value returned by a function has not been used.
Compiler
Added the armv5te-unknown-linux-musl target.
Libraries
SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable. This includes arch::x86 & arch::x86_64 modules which contain SIMD intrinsics, a new macro called is_x86_feature_detected!, the #[target_feature(enable="")] attribute, and adding target_feature = "" to the cfg attribute.
A lot of methods for [u8], f32, and f64 previously only available in std are now available in core.
The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults to Self.
std::str::replace now has the #[must_use] attribute to clarify that the operation isn't done in place.
Clone::clone, Iterator::collect, and ToOwned::to_owned now have the #[must_use] attribute to warn about unused potentially expensive allocations.
Stabilized APIs
DoubleEndedIterator::rfind
DoubleEndedIterator::rfold
DoubleEndedIterator::try_rfold
Duration::from_micros
Duration::from_nanos
Duration::subsec_micros
Duration::subsec_millis
HashMap::remove_entry
Iterator::try_fold
Iterator::try_for_each
NonNull::cast
Option::filter
String::replace_range
Take::set_limit
hint::unreachable_unchecked
os::unix::process::parent_id
process::id
ptr::swap_nonoverlapping
slice::rsplit_mut
slice::rsplit
slice::swap_with_slice
Cargo
cargo-metadata now includes authors, categories, keywords, readme, and repository fields.
Added the --target-dir optional argument. This allows you to specify a different directory than target for placing compilation artifacts.
Cargo will be adding automatic target inference for binaries, benchmarks, examples, and tests in the Rust 2018 edition. If your project specifies specific targets e.g. using [[bin]] and have other binaries in locations where cargo would infer a binary, Cargo will produce a warning. You can disable this feature ahead of time by setting any of the following autobins, autobenches, autoexamples, autotests to false.
Cargo will now cache compiler information. This can be disabled by setting CARGO_CACHE_RUSTC_INFO=0 in your environment.
Misc
Added "The Rustc book" into the official documentation. "The Rustc book" documents and teaches how to use the rustc compiler.
All books available on doc.rust-lang.org are now searchable.
Compatibility Notes
Calling a CharExt or StrExt method directly on core will no longer work. e.g. ::core::prelude::v1::StrExt::is_empty("") will not compile, "".is_empty() will still compile.
Debug output on atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize} will only print the inner type. e.g. print!("{:?}", AtomicBool::new(true)) will print true not AtomicBool(true).
The maximum number for repr(align(N)) is now 2^29. Previously you could enter higher numbers but they were not supported by LLVM. Up to 512MB alignment should cover all use cases.
Changelog:
Version 1.26.1 (2018-05-29)
Tools
RLS now works on Windows
Rustfmt stopped badly formatting text in some cases
Compatibility Notes
fn main() -> impl Trait no longer works for non-Termination trait This
reverts an accidental stabilization.
NaN > NaN no longer returns true in const-fn contexts
Prohibit using turbofish for impl Trait in method arguments
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.
Changelog:
Version 1.25.0 (2018-03-29)
Language
Stabilised #[repr(align(x))]. RFC 1358
You can now use nested groups of imports. e.g. use std::{fs::File, io::Read, path::{Path, PathBuf}};
You can now have | at the start of a match arm. e.g.
enum Foo { A, B, C }
fn main() {
let x = Foo::A;
match x {
| Foo::A
| Foo::B => println!("AB"),
| Foo::C => println!("C"),
}
}
Compiler
Upgraded to LLVM 6.
Added -C lto=val option.
Added i586-unknown-linux-musl target
Libraries
Impl Send for process::Command on Unix.
Impl PartialEq and Eq for ParseCharError.
UnsafeCell::into_inner is now safe.
Implement libstd for CloudABI.
Float::{from_bits, to_bits} is now available in libcore.
Implement AsRef<Path> for Component
Implemented Write for Cursor<&mut Vec<u8>>
Moved Duration to libcore.
Stabilized APIs
Location::column
ptr::NonNull
The following functions can now be used in a constant expression. eg. static MINUTE: Duration = Duration::from_secs(60);
Duration::new
Duration::from_secs
Duration::from_millis
Cargo
cargo new no longer removes rust or rs prefixs/suffixs.
cargo new now defaults to creating a binary crate, instead of a library crate.
Misc
Rust by example is now shipped with new releases
Compatibility Notes
Deprecated net::lookup_host.
rustdoc has switched to pulldown as the default markdown renderer.
The borrow checker was sometimes incorrectly permitting overlapping borrows around indexing operations (see #47349). This has been fixed (which also enabled some correct code that used to cause errors (e.g. #33903 and #46095).
Removed deprecated unstable attribute #[simd].
Changelog:
Do not abort when unwinding through FFI (this reverts behavior added
in 1.24.0)
Emit UTF-16 files for linker arguments on Windows
Make the error index generator work again
Cargo will warn on Windows 7 if an update is needed.
* Disable SunOS support for a while
Changelog:
Version 1.24.0 (2018-02-15)
Language
External sysv64 ffi is now available. eg. extern "sysv64" fn foo () {}
Compiler
rustc now uses 16 codegen units by default for release builds. For
the fastest builds, utilize codegen-units=1.
Added armv4t-unknown-linux-gnueabi target.
Add aarch64-unknown-openbsd support
Libraries
str::find::<char> now uses memchr. This should lead to a 10x improvement
in performance in the majority of cases.
OsStr's Debug implementation is now lossless and consistent with Windows.
time::{SystemTime, Instant} now implement Hash.
impl From<bool> for AtomicBool
impl From<{CString, &CStr}> for {Arc<CStr>, Rc<CStr>}
impl From<{OsString, &OsStr}> for {Arc<OsStr>, Rc<OsStr>}
impl From<{PathBuf, &Path}> for {Arc<Path>, Rc<Path>}
float::from_bits now just uses transmute. This provides some optimisations
from LLVM.
Copied AsciiExt methods onto char
Remove T: Sized requirement on ptr::is_null()
impl From<RecvError> for {TryRecvError, RecvTimeoutError}
Optimised f32::{min, max} to generate more efficent x86 assembly
[u8]::contains now uses memchr which provides a 3x speed improvement
Stabilized APIs
RefCell::replace
RefCell::swap
atomic::spin_loop_hint
The following functions can now be used in a constant expression.
eg. let buffer: [u8; size_of::<usize>()];, static COUNTER: AtomicUsize =
AtomicUsize::new(1);
AtomicBool::new
AtomicUsize::new
AtomicIsize::new
AtomicPtr::new
Cell::new
{integer}::min_value
{integer}::max_value
mem::size_of
mem::align_of
ptr::null
ptr::null_mut
RefCell::new
UnsafeCell::new
Cargo
Added a workspace.default-members config that overrides implied --all
in virtual workspaces.
Enable incremental by default on development builds. Also added
configuration keys to Cargo.toml and .cargo/config to disable on
a per-project or global basis respectively.
Misc
Compatibility Notes
Floating point types Debug impl now always prints a decimal point.
Ipv6Addr now rejects superfluous ::'s in IPv6 addresses This is in
accordance with IETF RFC 4291 Sec. 2.2.
Unwinding will no longer go past FFI boundaries, and will instead abort.
Formatter::flags method is now deprecated. The sign_plus, sign_minus,
alternate, and sign_aware_zero_pad should be used instead.
Leading zeros in tuple struct members is now an error
column!() macro is one-based instead of zero-based
fmt::Arguments can no longer be shared across threads
Access to #[repr(packed)] struct fields is now unsafe
Cargo sets a different working directory for the compiler
* Disable Solaris/SunOS suppprt for a while
Changelog:
# What's in 1.23.0 stable
New year, new Rust! For our first improvement today, we now avoid
some unnecessary copies in certain situations. We've seen memory
usage of using rustc to drop 5-10% with this change; it may be
different with your programs.
The documentation team has been on a long journey to move rustdoc
to use CommonMark. Previously, rustdoc never guaranteed which
markdown rendering engine it used, but we're finally committing to
CommonMark. As part of this release, we render the documentation
with our previous renderer, Hoedown, but also render it with a
CommonMark compliant renderer, and warn if there are any differences.
There should be a way for you to modify the syntax you use to render
correctly under both; we're not aware of any situations where this
is impossible. Docs team member Guillaume Gomez has written a blog
post showing some common differences and how to solve them. In a
future release, we will switch to using the CommonMark renderer by
default. This warning landed in nightly in May of last year, and
has been on by default since October of last year, so many crates
have already fixed any issues that they've found.
In other documentation news, historically, Cargo's docs have been
a bit strange. Rather than being on doc.rust-lang.org, they've been
at doc.crates.io. With this release, that's changing. You can now
find Cargo's docs at doc.rust-lang.org/cargo. Additionally, they've
been converted to the same format as our other long-form documentation.
We'll be adding a redirect from doc.crates.io to this page, and
you can expect to see more improvements and updates to Cargo's docs
throughout the year.
See the detailed release notes for more.
## Library stabilizations
As of Rust 1.0, a trait named AsciiExt existed to provide ASCII
related functionality on u8, char, [u8], and str. To use it, you'd
write code like this:
use std::ascii::AsciiExt;
let ascii = 'a';
let non_ascii = '❤';
let int_ascii = 97;
assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
assert!(int_ascii.is_ascii());
In Rust 1.23, these methods are now defined directly on those types,
and so you no longer need to import the trait. Thanks to our
stability guarantees, this trait still exists, so if you'd like to
still support Rust versions before Rust 1.23, you can do this:
#[allow(unused_imports)]
use std::ascii::AsciiExt;
...to suppress the related warning. Once you drop support for older
Rusts, you can remove both lines, and everything will continue to
work.
Additionally, a few new APIs were stabilized this release:
The various std::sync::atomic types now implement From their
non-atomic types. For example, let x = AtomicBool::from(true);.
() now implements FromIterator<()>; check the PR for a neat
use-case. RwLock<T> has had its Send restriction lifted
See the detailed release notes for more.
## Cargo features
cargo check can now check your unit tests.
cargo uninstall can now uninstall more than one package in one
command.