BT

Rust 1.3 Brings Stabilisation for APIs

| by James Chesters Follow 1 Followers on Sep 22, 2015. Estimated reading time: 2 minutes |

The Rust core team has released 1.3 stable, bringing with it API stabilisation and further work on the language's performance.

In the blog post "Announcing Rust 1.3," the team said Rust had seen with this release a large amount of stabilisation "including the new Duration API and enhancements to Error and Hash/Hasher," and that further growth of the std::time module was expected "in the 1.5 timeframe."

Rust contributor Steven Fackler, responsible for commit 26818 to stabilise Duration, said it stabilised both the std::time module and the Duration type. Fackler noted that Duration::span remained unstable, and that the Display implementation for Duration has been removed because "it is still being reworked and all trait implementations for stable types are de facto stable."

Fackler points out this commit is a breaking-change for anyone using Duration's Display implementation.

Following the release of version 1.0, unveiled in May this year, Rust has welcomed a faster compilation time and full support for dynamically-sized types. The release notes for version 1.3 highlight that "new object lifetime defaults have been turned on after a cycle of warnings about the change new object lifetime defaults." This is a breaking change, changing types like &'a Box<Trait> from being interpreted as &'a Box<Trait+'a> to &'a Box<Trait+'static>.

Contributor Aaron Turon explained the change in RFC 1156, saying

"When we instituted default object bounds, RFC 599 specified that &'x Box<Trait> (and &'x mut Box<Trait>) should expand to &'x Box<Trait+'x> (and &'x mut Box<Trait+'x>). This is in contrast to a Box type that appears outside of a reference (e.g., Box<Trait>), which defaults to using 'static (Box<Trait+'static>). This decision was made because it meant that a function written like so would accept the broadest set of possible objects.

The stable 1.3 release for Rust also delivers several performance improvements, including improved speed for the substring search by using the two way algorithm and adapting it to the Pattern API, outperforming the old naive implementation.

Other noteworthy improvements include "improvements to zero filling that speed up Vec::resize and Read::read_to_end."

Addressing bug 25483, where StrSearcher was performing a naive string search, Rust contributor bluss said the "two way searcher algorithm has very small, constant space overhead, requiring no dynamic allocation. Our implementation is relatively fast, especially due to the byteset addition to the algorithm, which speeds up many no-match cases."

Rust 1.3 also brings preliminary support for targeting Windows XP and support for lint capping. More details about Rust 1.3 can be found in the release notes.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT