Skip to content

Commit 1baeb65

Browse files
committed
Rust 1.23 release
1 parent 6af70fb commit 1baeb65

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

_posts/2018-01-04-Rust-1.23.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
layout: post
3+
title: "Announcing Rust 1.23"
4+
author: The Rust Core Team
5+
---
6+
7+
The Rust team is happy to announce a new version of Rust, 1.23.0. Rust is a
8+
systems programming language focused on safety, speed, and concurrency.
9+
10+
If you have a previous version of Rust installed via rustup, getting Rust
11+
1.23.0 is as easy as:
12+
13+
```bash
14+
$ rustup update stable
15+
```
16+
17+
If you don't have it already, you can [get `rustup`][install] from the
18+
appropriate page on our website, and check out the [detailed release notes for
19+
1.23.0][notes] on GitHub.
20+
21+
[install]: https://www.rust-lang.org/install.html
22+
[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1230-2018-01-04
23+
24+
## What's in 1.23.0 stable
25+
26+
New year, new Rust! For our first improvement today, we now [avoid some uneccesary
27+
copies](https://github.com/rust-lang/rust/pull/45380) in certain situations.
28+
We've seen memory usage drop 5-10% with this change.
29+
30+
The documentation team has been on a long journey to move `rustdoc` to use
31+
[CommonMark]. Previously, `rustdoc` never guaranteed which markdown rendering
32+
engine it used, but we're finally committing to CommonMark. As part of this
33+
release, we render the documentation with our previous renderer, [Hoedown],
34+
but also render it with a CommonMark compliant renderer, and [warn if there
35+
are any differences]. There should be a way for you to modify the syntax you
36+
use to render correctly under both; we're not aware of any situations where
37+
this is impossible. Docs team member Guillaume Gomez has [written a blog post]
38+
showing some common differences and how to solve them. In a future release,
39+
we will switch to using the CommonMark renderer by default. This [warning
40+
landed in nightly in May of last year], and has been on by default [since
41+
October of last year], so many crates have already fixed any issues that
42+
they've found.
43+
44+
[CommonMark]: http://commonmark.org/
45+
[warn if there are any differences]: https://github.com/rust-lang/rust/pull/45324
46+
[written a blog post]: https://blog.guillaume-gomez.fr/articles/2017-09-18+New+rustdoc+rendering+common+errors
47+
[warning landed in nightly in May of last year]: https://github.com/rust-lang/rust/pull/41991
48+
[since October of last year]: https://github.com/rust-lang/rust/pull/45324
49+
50+
In other documentation news, historically, Cargo's docs have been a bit strange.
51+
Rather than being on [https://doc.rust-lang.org][], they've been at [https://doc.crates.io][].
52+
With this release, [that's changing](https://github.com/rust-lang/rust/pull/45692).
53+
You can now find Cargo's docs at [https://doc.rust-lang.org/cargo][]. Additionally, they've
54+
been converted to the same format as our other long-form documentation. We'll be
55+
adding a redirect from `doc.crates.io` to this page, and you can expect to see more
56+
improvements and updates to Cargo's docs throughout the year.
57+
58+
See the [detailed release notes][notes] for more.
59+
60+
### Library stabilizations
61+
62+
As of Rust 1.0, a trait named [`AsciiExt`] existed to provide ASCII related functionality
63+
on `u8`, `char`, `[u8]`, and `str`. To use it, you'd write code like this:
64+
65+
```rust
66+
use std::ascii::AsciiExt;
67+
68+
let ascii = 'a';
69+
let non_ascii = '❤';
70+
let int_ascii = 97;
71+
72+
assert!(ascii.is_ascii());
73+
assert!(!non_ascii.is_ascii());
74+
assert!(int_ascii.is_ascii());
75+
```
76+
77+
In Rust 1.23, these methods are now defined directly on those types, and so you no longer need
78+
to import the trait. Thanks to our stability guarantees, this trait still exists, so if you'd
79+
like to still support Rust versions before Rust 1.23, you can do this:
80+
81+
```rust
82+
#[warn(unused_imports)]
83+
use std::ascii::AsciiExt;
84+
```
85+
86+
To supress the related warning. Once you drop support for older Rusts, you
87+
can remove both lines, and everything will continue to work.
88+
89+
[`AsciiExt`]: https://doc.rust-lang.org/std/ascii/trait.AsciiExt.html
90+
91+
Additionally, a few new APIs were stabilized this release:
92+
93+
* The various [`std::sync::atomic
94+
types`](https://doc.rust-lang.org/beta/std/sync/atomic/index.html#structs)
95+
now implement `From` their non-atomic types. For example, `let x = AtomicBool::from(true);`.
96+
* [`()` now implements `FromIterator<()>`](https://github.com/rust-lang/rust/pull/45379); check the PR for
97+
a neat use-case.
98+
* [`RwLock<T>` has had its `Send` restriction lifted](https://github.com/rust-lang/rust/pull/45682)
99+
100+
See the [detailed release notes][notes] for more.
101+
102+
### Cargo features
103+
104+
`cargo check` can now [check your unit tests](https://github.com/rust-lang/cargo/pull/4592).
105+
106+
`cargo uninstall` can now [uninstall more than one package in one command](https://github.com/rust-lang/cargo/pull/4561).
107+
108+
See the [detailed release notes][notes] for more.
109+
110+
## Contributors to 1.23.0
111+
112+
Many people came together to create Rust 1.23. We couldn't have done it
113+
without all of you. [Thanks!](https://thanks.rust-lang.org/rust/1.23.0)

0 commit comments

Comments
 (0)