diff options
| author | Stan Manilov <stanislav.manilov@gmail.com> | 2025-06-01 10:36:28 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-01 10:36:28 +0300 |
| commit | 171312aa4ea0c17f0b41b4b99da680e5bf0e84f5 (patch) | |
| tree | 86a73be022d2883b446e50675f2b9f4332f02778 | |
| parent | a2fd1aa46f897fc0dbe3d43e06742ed7e71106f2 (diff) | |
| download | rust-171312aa4ea0c17f0b41b4b99da680e5bf0e84f5.tar.gz rust-171312aa4ea0c17f0b41b4b99da680e5bf0e84f5.zip | |
Add opaque type attributes
This allows for the code to compile on `nightly`.
| -rw-r--r-- | src/doc/rustc-dev-guide/src/opaque-types-impl-trait-inference.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/opaque-types-impl-trait-inference.md b/src/doc/rustc-dev-guide/src/opaque-types-impl-trait-inference.md index bdf4e4cd870..42600ad87f8 100644 --- a/src/doc/rustc-dev-guide/src/opaque-types-impl-trait-inference.md +++ b/src/doc/rustc-dev-guide/src/opaque-types-impl-trait-inference.md @@ -13,13 +13,16 @@ it can work across functions and function bodies. To help explain how it works, let's consider an example. ```rust +#![feature(type_alias_impl_trait)] mod m { pub type Seq<T> = impl IntoIterator<Item = T>; + #[define_opaque(Seq)] pub fn produce_singleton<T>(t: T) -> Seq<T> { vec![t] } + #[define_opaque(Seq)] pub fn produce_doubleton<T>(t: T, u: T) -> Seq<T> { vec![t, u] } |
