Email me

Rust versions / 1.3

Rust release · Sep 17, 2015

Rust 1.3: what's new, what was stabilized

Short answerRust 1.3 was released on Sep 17, 2015.

Sep 17, 2015release date
0language stabilizations
0APIs stabilized
-new edition

← Rust 1.2All versionsRust 1.4 →

Can it break my build?

No compatibility notes were listed for this release.

Use it

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

To require at least this version from users of your crate, set rust-version = "1.3" 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

Highlights

  • The [new object lifetime defaults][nold] have been [turned on][nold2] after a cycle of warnings about the change. Now types like &'a Box<Trait> (or &'a Rc<Trait>, etc) will change from being interpreted as &'a Box<Trait+'a> to &'a Box<Trait+'static>.
  • [The Rustonomicon][nom] is a new book in the official documentation that dives into writing unsafe Rust.
  • The [Duration] API, [has been stabilized][ds]. This basic unit of timekeeping is employed by other std APIs, as well as out-of-tree time crates.

Breaking Changes

  • The [new object lifetime defaults][nold] have been [turned on][nold2] after a cycle of warnings about the change.
  • There is a known [regression][lr] in how object lifetime elision is interpreted, the proper solution for which is undetermined.
  • The #[prelude_import] attribute, an internal implementation detail, was accidentally stabilized previously. [It has been put behind the prelude_import feature gate][pi]. This change is believed to break no existing code.
  • The behavior of [size_of_val][dst1] and [align_of_val][dst2] is [more sane for dynamically sized types][dst3]. Code that relied on the previous behavior is thought to be broken.
  • The dropck rules, which checks that destructors can't access destroyed values, [have been updated][dropck] to match the [RFC][dropckrfc]. This fixes some soundness holes, and as such will cause some previously-compiling code to no longer build.

Language

  • The [new object lifetime defaults][nold] have been [turned on][nold2] after a cycle of warnings about the change.
  • Semicolons may now follow types and paths in macros.
  • The behavior of [size_of_val][dst1] and [align_of_val][dst2] is [more sane for dynamically sized types][dst3]. Code that relied on the previous behavior is not known to exist, and suspected to be broken.
  • 'static variables [may now be recursive][st].
  • ref bindings choose between [Deref] and [DerefMut] implementations correctly.
  • The dropck rules, which checks that destructors can't access destroyed values, [have been updated][dropck] to match the [RFC][dropckrfc].

Libraries

  • The [Duration] API, [has been stabilized][ds], as well as the std::time module, which presently contains only Duration.
  • Box<str> and Box<[T]> both implement Clone.
  • The owned C string, [CString], implements [Borrow] and the borrowed C string, [CStr], implements [ToOwned]. The two of these allow C strings to be borrowed and cloned in generic code.
  • [CStr] implements [Debug].
  • [AtomicPtr] implements [Debug].
  • [Error] trait objects [can be downcast to their concrete types][e] in many common configurations, using the [is], [downcast], [downcast_ref] and [downcast_mut] methods, similarly to the [Any] trait.
  • Searching for substrings now [employs the two-way algorithm][search] instead of doing a naive search. This gives major speedups to a number of methods, including [contains][sc], [find][sf], [rfind][srf], [split][ss]. [starts_with][ssw] and [ends_with][sew] are also faster.
  • The performance of PartialEq for slices is [much faster][ps].
  • The [Hash] trait offers the default method, [hash_slice], which is overridden and optimized by the implementations for scalars.
  • The [Hasher] trait now has a number of specialized write_* methods for primitive types, for efficiency.
  • The I/O-specific error type, [std::io::Error][ie], gained a set of methods for accessing the 'inner error', if any: [get_ref][iegr], [get_mut][iegm], [into_inner][ieii]. As well, the implementation of [std::error::Error::cause][iec] also delegates to the inner error.
  • [process::Child][pc] gained the [id] method, which returns a u32 representing the platform-specific process identifier.
  • The [connect] method on slices is deprecated, replaced by the new [join] method (note that both of these are on the *unstable* [SliceConcatExt] trait, but through the magic of the prelude are available to stable code anyway).
  • The [Div] operator is implemented for [Wrapping] types.
  • [DerefMut is implemented for String][dms].
  • Performance of SipHash (the default hasher for HashMap) is [better for long data][sh].
  • [AtomicPtr] implements [Send].
  • The [read_to_end] implementations for [Stdin] and [File] are now [specialized to use uninitialized buffers for increased performance][rte].
  • Lifetime parameters of foreign functions [are now resolved properly][f].

Misc

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

← Rust 1.2All versionsRust 1.4 →

Up next

Next releaseRust 1.4Released Oct 29, 2015.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