The Rust core team has released the stable version of 1.5, with around 700 changes, including the introduction of cargo install
and shrinking the metadata size by 20%.
In the blog post Announcing Rust 1.5 the core team describe cargo install
as "a new subcommand that installs Cargo application packages on the local system." It continues
The community is already taking advantage of
cargo install
to install applications like rustfmt, the work-in-progress code formatting tool for Rust. Moreover, cargo install can also be used to install new subcommands for Cargo itself
These include:
cargo-check
: statically check a project, but don’t build a binary.cargo-edit
: add or remove dependencies for a project through the command line.cargo-graph
: build dependency graphs for a project using GraphViz.cargo-watch
: automatically re-run a Cargo command when the project changes.
A notable highlight with the release is that now Rust applications hosted on crates.io can be installed locally to ~/.cargo/bin
with the cargo install
command. This is particularly useful for augmenting Cargo with new subcommands, for example when a binary named. cargo-foo
is found in $PATH
it can be invoked as cargo foo
.
1.5 stable comes with the expected breaking changes. A modification to the rules determining when a particular lifetime must outlive a particular value means that they no longer rely on parametricity. Where the team describe the rules as "clever" they are also referred to as "fragile and unproven."
The update means that Rust "will start assuming that a destructor for a data-type definition such as struct Parametri
<c>
may read from data held in its C parameter, even though the fn drop formerly appeared to be parametric with respect to C" which would cause rustc
to reject code previously accepted.
Rust 1.5 has also shrunk the crate metadata by 20%, with contributor arielb1 commenting "libcore.rlib reduced from 19121 kiB to 15934 kiB."
In a discussion on Hacker News user Cshelton commented on the release
Congrats first of all!
I love Rust and am using it more and more. I'm very excited for 'cargo watch'. These tools built into the package manager will be so helpful with peoples' first time Rust experience. I think I'm going to say it, Rust has my favorite package management system of any language I've used.
More details about Rust 1.5 can be found in the release notes.