Email me

Rust versions / 1.0

Rust release · May 15, 2015

Rust 1.0: what's new, what was stabilized

Short answerRust 1.0 was released on May 15, 2015.

May 15, 2015release date
0language stabilizations
0APIs stabilized
-new edition

All versionsRust 1.1 →

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.0          # or exactly this one
rustup override set 1.0     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.0" 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 vast majority of the standard library is now #[stable]. It is no longer possible to use unstable features with a stable build of the compiler.
  • Many popular crates on [crates.io] now work on the stable release channel.
  • Arithmetic on basic integer types now [checks for overflow in debug builds][overflow].

Language

  • Several [restrictions have been added to trait coherence][coh] in order to make it easier for upstream authors to change traits without breaking downstream code.
  • Digits of binary and octal literals are [lexed more eagerly][lex] to improve error messages and macro behavior. For example, 0b1234 is now lexed as 0b1234 instead of two tokens, 0b1 and 234.
  • Trait bounds [are always invariant][inv], eliminating the need for the PhantomFn and MarkerTrait lang items, which have been removed.
  • ["-" is no longer a valid character in crate names][cr], the extern crate "foo" as bar syntax has been replaced with extern crate foo as bar, and Cargo now automatically translates "-" in *package* names to underscore for the crate name.
  • [Lifetime shadowing is an error][lt].
  • [Send no longer implies 'static][send-rfc].
  • [UFCS now supports trait-less associated paths][moar-ufcs] like MyType::default().
  • Primitive types [now have inherent methods][prim-inherent], obviating the need for extension traits like SliceExt.
  • Methods with Self: Sized in their where clause are [considered object-safe][self-sized], allowing many extension traits like IteratorExt to be merged into the traits they extended.
  • You can now [refer to associated types][assoc-where] whose corresponding trait bounds appear only in a where clause.
  • The final bits of [OIBIT landed][oibit-final], meaning that traits like Send and Sync are now library-defined.
  • A [Reflect trait][reflect] was introduced, which means that downcasting via the Any trait is effectively limited to concrete types. This helps retain the potentially-important "parametricity" property: generic code cannot behave differently for different type arguments except in minor ways.
  • The unsafe_destructor feature is now deprecated in favor of the [new dropck][rfc769]. This change is a major reduction in unsafe code.

Libraries

  • The thread_local module [has been renamed to std::thread][th].
  • The methods of IteratorExt [have been moved to the Iterator trait itself][23300].
  • Several traits that implement Rust's conventions for type conversions, AsMut, AsRef, From, and Into have been [centralized in the std::convert module][con].
  • The FromError trait [was removed in favor of From][fe].
  • The basic sleep function [has moved to std::thread::sleep_ms][slp].
  • The splitn function now takes an n parameter that represents the number of items yielded by the returned iterator [instead of the number of 'splits'][spl].
  • [On Unix, all file descriptors are CLOEXEC by default][clo].
  • [Derived implementations of PartialOrd now order enums according to their explicitly-assigned discriminants][po].
  • [Methods for searching strings are generic over Patterns][pat], implemented presently by &char, &str, FnMut(char) -> bool and some others.
  • [In method resolution, object methods are resolved before inherent methods][meth].
  • [String::from_str has been deprecated in favor of the From impl, String::from][24517].
  • [io::Error implements Sync][ios].
  • [The words method on &str has been replaced with split_whitespace][sw], to avoid answering the tricky question, 'what is a word?'
  • The new path and IO modules are complete and #[stable]. This was the major library focus for this cycle.
  • The path API was [revised][path-normalize] to normalize ., adjusting the tradeoffs in favor of the most common usage.
  • A large number of remaining APIs in std were also stabilized during this cycle; about 75% of the non-deprecated API surface is now stable.
  • The new [string pattern API][string-pattern] landed, which makes the string slice API much more internally consistent and flexible.
  • A new set of [generic conversion traits][conversion] replaced many existing ad hoc traits.
  • Generic numeric traits were [completely removed][num-traits]. This was made possible thanks to inherent methods for primitive types, and the removal gives maximal flexibility for designing a numeric hierarchy in the future.
  • The Fn traits are now related via [inheritance][fn-inherit] and provide ergonomic [blanket implementations][fn-blanket].
  • The Index and IndexMut traits were changed to [take the index by value][index-value], enabling code like hash_map["string"] to work.
  • Copy now [inherits][copy-clone] from Clone, meaning that all Copy data is known to be Clone as well.

Misc

  • Many errors now have extended explanations that can be accessed with the --explain flag to rustc.
  • Many new examples have been added to the standard library documentation.
  • rustdoc has received a number of improvements focused on completion and polish.
  • Metadata was tuned, shrinking binaries by 27%.
  • Much headway was made on ecosystem-wide CI, making it possible to compare builds for breakage.

Version 1.0.0-alpha.2 (2015-02-20) =====================================

  • ~1300 changes, numerous bugfixes
  • Highlights
  • The various I/O modules were overhauled to reduce unnecessary abstractions and provide better interoperation with the underlying platform. The old io module remains temporarily at std::old_io.
  • The standard library now participates in feature gating, so use of unstable libraries now requires a #![feature(...)] attribute. The impact of this change is described on the forum. RFC.
  • Language
  • for loops now operate on the IntoIterator trait, which eliminates the need to call .iter(), etc. to iterate over collections. There are some new subtleties to remember though regarding what sort of iterators various types yield, in particular that for foo in bar { } yields values from a move iterator, destroying the original collection. RFC.
  • Objects now have default lifetime bounds, so you don't have to write Box<Trait+'static> when you don't care about storing references. RFC.
  • In types that implement Drop, lifetimes must outlive the value. This will soon make it possible to safely implement Drop for types where #[unsafe_destructor] is now required. Read the gorgeous RFC for details.
  • The fully qualified <T as Trait>::X syntax lets you set the Self type for a trait method or associated type. RFC.
  • References to types that implement Deref<U> now automatically coerce to references to the dereferenced type U, e.g. &T where T: Deref<U> automatically coerces to &U. This should eliminate many unsightly uses of &*, as when converting from references to vectors into references to slices. RFC.
  • The explicit closure kind syntax (|&:|, |&mut:|, |:|) is obsolete and closure kind is inferred from context.
  • Self is a keyword.
  • Libraries
  • The Show and String formatting traits have been renamed to Debug and Display to more clearly reflect their related purposes. Automatically getting a string conversion to use with format!("{:?}", something_to_debug) is now written #[derive(Debug)].
  • Abstract OS-specific string types, std::ff::{OsString, OsStr}, provide strings in platform-specific encodings for easier interop with system APIs. RFC.
  • The boxed::into_raw and Box::from_raw functions convert between Box<T> and *mut T, a common pattern for creating raw pointers.
  • Tooling
  • Misc
  • Rust is tested against a LALR grammar, which parses almost all the Rust files that rustc does.

Version 1.0.0-alpha (2015-01-09) ==================================

  • ~2400 changes, numerous bugfixes
  • Highlights
  • The language itself is considered feature complete for 1.0, though there will be many usability improvements and bugfixes before the final release.
  • Nearly 50% of the public API surface of the standard library has been declared 'stable'. Those interfaces are unlikely to change before 1.0.
  • The long-running debate over integer types has been settled: Rust will ship with types named isize and usize, rather than int and uint, for pointer-sized integers. Guidelines will be rolled out during the alpha cycle.
  • Most crates that are not std have been moved out of the Rust distribution into the Cargo ecosystem so they can evolve separately and don't need to be stabilized as quickly, including 'time', 'getopts', 'num', 'regex', and 'term'.
  • Documentation continues to be expanded with more API coverage, more examples, and more in-depth explanations. The guides have been consolidated into The Rust Programming Language.
  • "Rust By Example" is now maintained by the Rust team.
  • All official Rust binary installers now come with Cargo, the Rust package manager.
  • Language
  • Closures have been completely redesigned to be implemented in terms of traits, can now be used as generic type bounds and thus monomorphized and inlined, or via an opaque pointer (boxed) as in the old system. The new system is often referred to as 'unboxed' closures.
  • Traits now support associated types, allowing families of related types to be defined together and used generically in powerful ways.
  • Enum variants are namespaced by their type names.
  • where clauses provide a more versatile and attractive syntax for specifying generic bounds, though the previous syntax remains valid.
  • Rust again picks a fallback (either i32 or f64) for uninferred numeric types.
  • Rust no longer has a runtime of any description, and only supports OS threads, not green threads.
  • At long last, Rust has been overhauled for 'dynamically-sized types' (DST), which integrates 'fat pointers' (object types, arrays, and str) more deeply into the type system, making it more consistent.
  • Rust now has a general range syntax, i..j, i.., and ..j that produce range types and which, when combined with the Index operator and multidispatch, leads to a convenient slice notation, [i..j].
  • The new range syntax revealed an ambiguity in the fixed-length array syntax, so now fixed length arrays [are written [T; N]]arrays.
  • The Copy trait is no longer implemented automatically. Unsafe pointers no longer implement Sync and Send so types containing them don't automatically either. Sync and Send are now 'unsafe traits' so one can "forcibly" implement them via unsafe impl if a type confirms to the requirements for them even though the internals do not (e.g. structs containing unsafe pointers like Arc). These changes are intended to prevent some footguns and are collectively known as opt-in built-in traits (though Sync and Send will soon become pure library types unknown to the compiler).
  • Operator traits now take their operands by value, and comparison traits can use multidispatch to compare one type against multiple other types, allowing e.g. String to be compared with &str.
  • if let and while let are no longer feature-gated.
  • Rust has adopted a more uniform syntax for escaping unicode characters.
  • macro_rules! has been declared stable. Though it is a flawed system it is sufficiently popular that it must be usable for 1.0. Effort has gone into future-proofing it in ways that will allow other macro systems to be developed in parallel, and won't otherwise impact the evolution of the language.
  • The prelude has been pared back significantly such that it is the minimum necessary to support the most pervasive code patterns, and through generalized where clauses many of the prelude extension traits have been consolidated.
  • Rust's rudimentary reflection has been removed, as it incurred too much code generation for little benefit.
  • Struct variants are no longer feature-gated.
  • Trait bounds can be polymorphic over lifetimes. Also known as 'higher-ranked trait bounds', this crucially allows unboxed closures to work.
  • Macros invocations surrounded by parens or square brackets and not terminated by a semicolon are parsed as expressions, which makes expressions like vec![1i32, 2, 3].len() work as expected.
  • Trait objects now implement their traits automatically, and traits that can be coerced to objects now must be object safe.
  • Automatically deriving traits is now done with #[derive(...)] not #[deriving(...)] for consistency with other naming conventions.
  • Importing the containing module or enum at the same time as items or variants they contain is now done with self instead of mod, as in use foo::{self, bar}
  • Glob imports are no longer feature-gated.
  • The box operator and box patterns have been feature-gated pending a redesign. For now unique boxes should be allocated like other containers, with Box::new.
  • Libraries
  • A series of efforts to establish conventions for collections types has resulted in API improvements throughout the standard library.
  • New APIs for error handling provide ergonomic interop between error types, and new conventions describe more clearly the recommended error handling strategies in Rust.
  • The fail! macro has been renamed to panic! so that it is easier to discuss failure in the context of error handling without making clarifications as to whether you are referring to the 'fail' macro or failure more generally.
  • On Linux, OsRng prefers the new, more reliable getrandom syscall when available.
  • The 'serialize' crate has been renamed 'rustc-serialize' and moved out of the distribution to Cargo. Although it is widely used now, it is expected to be superseded in the near future.
  • The Show formatter, typically implemented with #[derive(Show)] is now requested with the {:?} specifier and is intended for use by all types, for uses such as println! debugging. The new String formatter must be implemented by hand, uses the {} specifier, and is intended for full-fidelity conversions of things that can logically be represented as strings.
  • Tooling
  • Flexible target specification allows rustc's code generation to be configured to support otherwise-unsupported platforms.
  • Rust comes with rust-gdb and rust-lldb scripts that launch their respective debuggers with Rust-appropriate pretty-printing.
  • The Windows installation of Rust is distributed with the MinGW components currently required to link binaries on that platform.
  • Misc
  • Nullable enum optimizations have been extended to more types so that e.g. Option<Vec<T>> and Option<String> take up no more space than the inner types themselves.
  • Work has begun on supporting AArch64.

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

All versionsRust 1.1 →

Up next

Next releaseRust 1.1Released Jun 25, 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