Added page for feature to unstable book.

This commit is contained in:
Alexander Regueiro 2018-08-14 21:26:33 +01:00
parent 7920a65c5f
commit 4e7d3f5a5e
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,24 @@
# `self_in_typedefs`
The tracking issue for this feature is: [#49303]
[#49303]: https://github.com/rust-lang/rust/issues/49303
------------------------
The `self_in_typedefs` feature gate lets you use the special `Self` identifier
in `struct`, `enum`, and `union` type definitions.
A simple example is:
```rust
#![feature(self_in_typedefs)]
enum List<T>
where
Self: PartialOrd<Self> // can write `Self` instead of `List<T>`
{
Nil,
Cons(T, Box<Self>) // likewise here
}
```

View File

@ -9,8 +9,8 @@
// except according to those terms.
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(crate_visibility_modifier)]
#![cfg_attr(not(stage0), feature(nll))]