Email me

Rust versions / 1.19

Rust release · Jul 20, 2017

Rust 1.19: what's new, what was stabilized

Short answerRust 1.19 was released on Jul 20, 2017: 4 newly stable APIs (OsString::shrink_to_fit, cmp::Reverse, Command::envs, thread::ThreadId); 12 compatibility notes that can affect existing code.

Jul 20, 2017release date
0language stabilizations
4APIs stabilized
-new edition

← Rust 1.18All versionsRust 1.20 →

4 APIs stabilized

OsString::shrink_to_fit, cmp::Reverse, Command::envs, thread::ThreadId

Can it break my build?

The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:

  • [MutexGuard<T> may only be Sync if T is Sync.][41624]
  • [-Z flags are now no longer allowed to be used on the stable
  • [As a result of the -Z flag change, the cargo-check plugin no
  • [Ending a float literal with ._ is now a hard error.
  • [Any use of a private extern crate outside of its module is now a
  • [use ::self::foo; is now a hard error.][36888] self paths are always
  • [Floating point constants in match patterns is now a hard error][36890]
  • [Struct or enum constants that don't derive PartialEq & Eq used
  • [Lifetimes named '_ are no longer allowed.][36892] This was previously
  • [From the pound escape, lines consisting of multiple #s are
  • [It is an error to re-export private enum variants][42460]. This is
  • [On Windows, if VCINSTALLDIR is set incorrectly, rustc will try

Use it

rustup update stable        # get the newest release
rustup install 1.19          # or exactly this one
rustup override set 1.19     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.19" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.

Full release notes

Language

  • [Numeric fields can now be used for creating tuple structs.][41145] [RFC 1506] For example struct Point(u32, u32); let x = Point { 0: 7, 1: 0 };.
  • [Macro recursion limit increased to 1024 from 64.][41676]
  • [Added lint for detecting unused macros.][41907]
  • [loop can now return a value with break.][42016] [RFC 1624] For example: let x = loop { break 7; };
  • [C compatible unions are now available.][42068] [RFC 1444] They can only contain Copy types and cannot have a Drop implementation. Example: union Foo { bar: u8, baz: usize }
  • [Non capturing closures can now be coerced into fns,][42162] [RFC 1558] Example: let foo: fn(u8) -> u8 = |v: u8| { v };

Compiler

  • [Add support for bootstrapping the Rust compiler toolchain on Android.][41370]
  • [Change arm-linux-androideabi to correspond to the armeabi official ABI.][41656] If you wish to continue targeting the armeabi-v7a ABI you should use --target armv7-linux-androideabi.
  • [Fixed ICE when removing a source file between compilation sessions.][41873]
  • [Minor optimisation of string operations.][42037]
  • [Compiler error message is now aborting due to previous error(s) instead of aborting due to N previous errors][42150] This was previously inaccurate and would only count certain kinds of errors.
  • [The compiler now supports Visual Studio 2017][42225]
  • [The compiler is now built against LLVM 4.0.1 by default][42948]
  • [Added a lot][42264] of [new error codes][42302]
  • [Added target-feature=+crt-static option][37406] [RFC 1721] Which allows libraries with C Run-time Libraries(CRT) to be statically linked.
  • [Fixed various ARM codegen bugs][42740]

Libraries

  • [String now implements FromIterator<Cow<'a, str>> and Extend<Cow<'a, str>>][41449]
  • [Vec now implements From<&mut [T]>][41530]
  • [Box<[u8]> now implements From<Box<str>>][41258]
  • [SplitWhitespace now implements Clone][41659]
  • [[u8]::reverse is now 5x faster and [u16]::reverse is now 1.5x faster][41764]
  • [eprint! and eprintln! macros added to prelude.][41192] Same as the print! macros, but for printing to stderr.

Stabilized APIs

  • [OsString::shrink_to_fit]
  • [cmp::Reverse]
  • [Command::envs]
  • [thread::ThreadId]

Cargo

  • [Build scripts can now add environment variables to the environment the crate is being compiled in. Example: println!("cargo:rustc-env=FOO=bar");][cargo/3929]
  • [Subcommands now replace the current process rather than spawning a new child process][cargo/3970]
  • [Workspace members can now accept glob file patterns][cargo/3979]
  • [Added --all flag to the cargo bench subcommand to run benchmarks of all the members in a given workspace.][cargo/3988]
  • [Updated libssh2-sys to 0.2.6][cargo/4008]
  • [Target directory path is now in the cargo metadata][cargo/4022]
  • [Cargo no longer checks out a local working directory for the crates.io index][cargo/4026] This should provide smaller file size for the registry, and improve cloning times, especially on Windows machines.
  • [Added an --exclude option for excluding certain packages when using the --all option][cargo/4031]
  • [Cargo will now automatically retry when receiving a 5xx error from crates.io][cargo/4032]
  • [The --features option now accepts multiple comma or space delimited values.][cargo/4084]
  • [Added support for custom target specific runners][cargo/3954]

Misc

  • [Added rust-windbg.cmd][39983] for loading rust .natvis files in the Windows Debugger.
  • [Rust will now release XZ compressed packages][rust-installer/57]
  • [rustup will now prefer to download rust packages with XZ compression][rustup/1100] over GZip packages.
  • [Added the ability to escape # in rust documentation][41785] By adding additional #'s ie. ## is now #

Compatibility Notes

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.18All versionsRust 1.20 →

Up next

Next releaseRust 1.20Released Aug 31, 2017.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ