rustversion
Conditional compilation according to rustc compiler version
1.0.23
698M downloads/mo
#121 most downloaded on crates.io
dtolnay/rustversion
What this package is like to depend on
Last release 1 months ago
07 Jul 2026
Release timing varies
gaps range from 2 weeks to 11 months
Some releases are documented
notes for 11 of 26 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
26 releases · first in 2019
1 release in the last 12 months
see the full history below
Release timeline
26 releases · Jul 2019 to Jul 2026Releases
latest 26-
1.0.2307 Jul 2026 -
1.0.2208 Aug 2025 -
1.0.2122 May 2025 -
1.0.2004 Mar 2025 -
1.0.1926 Dec 2024 -
1.0.1814 Oct 2024 -
1.0.1714 May 2024 -
1.0.1607 May 2024 -
1.0.1506 Apr 2024 -
1.0.1415 Jul 2023 -
1.0.1303 Jul 2023Nothing published for this version
-
1.0.1205 Mar 2023Nothing published for this version
-
1.0.1117 Dec 2022Nothing published for this version
-
1.0.1017 Dec 2022Nothing published for this version
-
1.0.903 Aug 2022Nothing published for this version
-
1.0.816 Jul 2022Nothing published for this version
-
1.0.720 Jun 2022Nothing published for this version
-
1.0.606 Dec 2021Nothing published for this version
-
1.0.514 May 2021Nothing published for this version
-
1.0.426 Oct 2020Nothing published for this version
-
1.0.316 Jun 2020Nothing published for this version
-
1.0.223 Jan 2020Nothing published for this version
-
1.0.130 Dec 2019Nothing published for this version
-
1.0.011 Oct 2019Release notes
Open source →- ~1500 changes, numerous bugfixes
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.
Language
- Several restrictions have been added to trait coherence 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 to
improve error messages and macro behavior. For example,
0b1234is now lexed as0b1234instead of two tokens,0b1and234. - Trait bounds are always invariant, eliminating the need for
the
PhantomFnandMarkerTraitlang items, which have been removed. - "-" is no longer a valid character in crate names, the
extern crate "foo" as barsyntax has been replaced withextern crate foo as bar, and Cargo now automatically translates "-" in package names to underscore for the crate name. - Lifetime shadowing is an error.
Sendno longer implies'static.- UFCS now supports trait-less associated paths like
MyType::default(). - Primitive types now have inherent methods,
obviating the need for extension traits like
SliceExt. - Methods with
Self: Sizedin theirwhereclause are considered object-safe, allowing many extension traits likeIteratorExtto be merged into the traits they extended. - You can now refer to associated types whose
corresponding trait bounds appear only in a
whereclause. - The final bits of OIBIT landed, meaning that traits
like
SendandSyncare now library-defined. - A Reflect trait was introduced, which means that
downcasting via the
Anytrait 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_destructorfeature is now deprecated in favor of the newdropck. This change is a major reduction in unsafe code.
Libraries
- The
thread_localmodule has been renamed tostd::thread. - The methods of
IteratorExthave been moved to theIteratortrait itself. - Several traits that implement Rust's conventions for type
conversions,
AsMut,AsRef,From, andIntohave been centralized in thestd::convertmodule. - The
FromErrortrait was removed in favor ofFrom. - The basic sleep function has moved to
std::thread::sleep_ms. - The
splitnfunction now takes annparameter that represents the number of items yielded by the returned iterator instead of the number of 'splits'. - On Unix, all file descriptors are
CLOEXECby default. - Derived implementations of
PartialOrdnow order enums according to their explicitly-assigned discriminants. - Methods for searching strings are generic over
Patterns, implemented presently by&char,&str,FnMut(char) -> booland some others. - In method resolution, object methods are resolved before inherent methods.
String::from_strhas been deprecated in favor of theFromimpl,String::from.io::ErrorimplementsSync.- The
wordsmethod on&strhas been replaced withsplit_whitespace, 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 to normalize
., adjusting the tradeoffs in favor of the most common usage. - A large number of remaining APIs in
stdwere also stabilized during this cycle; about 75% of the non-deprecated API surface is now stable. - The new string pattern API landed, which makes the string slice API much more internally consistent and flexible.
- A new set of generic conversion traits replaced many existing ad hoc traits.
- Generic numeric traits were completely removed. 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
Fntraits are now related via inheritance and provide ergonomic blanket implementations. - The
IndexandIndexMuttraits were changed to take the index by value, enabling code likehash_map["string"]to work. Copynow inherits fromClone, meaning that allCopydata is known to beCloneas well.
Misc
- Many errors now have extended explanations that can be accessed with
the
--explainflag torustc. - 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.
-
0.1.418 Aug 2019Nothing published for this version
-
0.1.308 Jul 2019Nothing published for this version