diff options
| author | Taylor Cramer <cramertj@google.com> | 2018-03-21 17:44:21 -0700 |
|---|---|---|
| committer | Taylor Cramer <cramertj@google.com> | 2018-03-26 07:39:38 +0200 |
| commit | c393db67baf3a15ec61351ffb0e3811e07b8a467 (patch) | |
| tree | 7788c1c955c4e0d056536409cc52a4f39cdf3187 /src/doc | |
| parent | 445fafaa4b95fdde04751aa523b9e9f06e2c06ea (diff) | |
| download | rust-c393db67baf3a15ec61351ffb0e3811e07b8a467.tar.gz rust-c393db67baf3a15ec61351ffb0e3811e07b8a467.zip | |
Stabilize universal_impl_trait
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/universal-impl-trait.md | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/doc/unstable-book/src/language-features/universal-impl-trait.md b/src/doc/unstable-book/src/language-features/universal-impl-trait.md deleted file mode 100644 index 6b3c5e92720..00000000000 --- a/src/doc/unstable-book/src/language-features/universal-impl-trait.md +++ /dev/null @@ -1,32 +0,0 @@ -# `universal_impl_trait` - -The tracking issue for this feature is: [#34511]. - -[#34511]: https://github.com/rust-lang/rust/issues/34511 - --------------------- - -The `universal_impl_trait` feature extends the [`conservative_impl_trait`] -feature allowing the `impl Trait` syntax in arguments (universal -quantification). - -[`conservative_impl_trait`]: ./language-features/conservative-impl-trait.html - -## Examples - -```rust -#![feature(universal_impl_trait)] -use std::ops::Not; - -fn any_zero(values: impl IntoIterator<Item = i32>) -> bool { - for val in values { if val == 0 { return true; } } - false -} - -fn main() { - let test1 = -5..; - let test2 = vec![1, 8, 42, -87, 60]; - assert!(any_zero(test1)); - assert!(bool::not(any_zero(test2))); -} -``` |
