diff options
| author | Gary Guo <gary@garyguo.net> | 2024-04-19 16:17:02 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2024-04-24 13:12:25 +0100 |
| commit | 94c1920497d8281c1cd7b3d39b198bac80a03bc2 (patch) | |
| tree | 03798ceb84d231343f9f784a3bc28388948757b5 /src/doc | |
| parent | e9362896e0eaaa86372b8ee2634b5761dd9e5ab7 (diff) | |
| download | rust-94c1920497d8281c1cd7b3d39b198bac80a03bc2.tar.gz rust-94c1920497d8281c1cd7b3d39b198bac80a03bc2.zip | |
Stabilise `inline_const`
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/inline-const-pat.md | 2 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/language-features/inline-const.md | 32 |
2 files changed, 0 insertions, 34 deletions
diff --git a/src/doc/unstable-book/src/language-features/inline-const-pat.md b/src/doc/unstable-book/src/language-features/inline-const-pat.md index 5f0f7547a0a..c6f54d79cfc 100644 --- a/src/doc/unstable-book/src/language-features/inline-const-pat.md +++ b/src/doc/unstable-book/src/language-features/inline-const-pat.md @@ -2,8 +2,6 @@ The tracking issue for this feature is: [#76001] -See also [`inline_const`](inline-const.md) - ------ This feature allows you to use inline constant expressions in pattern position: diff --git a/src/doc/unstable-book/src/language-features/inline-const.md b/src/doc/unstable-book/src/language-features/inline-const.md deleted file mode 100644 index 7be70eed6ce..00000000000 --- a/src/doc/unstable-book/src/language-features/inline-const.md +++ /dev/null @@ -1,32 +0,0 @@ -# `inline_const` - -The tracking issue for this feature is: [#76001] - -See also [`inline_const_pat`](inline-const-pat.md) - ------- - -This feature allows you to use inline constant expressions. For example, you can -turn this code: - -```rust -# fn add_one(x: i32) -> i32 { x + 1 } -const MY_COMPUTATION: i32 = 1 + 2 * 3 / 4; - -fn main() { - let x = add_one(MY_COMPUTATION); -} -``` - -into this code: - -```rust -#![feature(inline_const)] - -# fn add_one(x: i32) -> i32 { x + 1 } -fn main() { - let x = add_one(const { 1 + 2 * 3 / 4 }); -} -``` - -[#76001]: https://github.com/rust-lang/rust/issues/76001 |
