about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-25 18:51:15 +0000
committerbors <bors@rust-lang.org>2025-04-25 18:51:15 +0000
commitb4c8b0c3f0533bb342a4873ff59bdad3883ab8e3 (patch)
treeeef1aa90a79b32d1ea165af6b54170a3ca6c0468 /library/std
parente3e432d4d65a55e6db167598e96db2bcb163e316 (diff)
parent99dc43b7178445e3e7eacd10630dfbfadefab560 (diff)
downloadrust-b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3.tar.gz
rust-b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3.zip
Auto merge of #140298 - matthiaskrgr:rollup-5tc1gvb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #137683 (Add a tidy check for GCC submodule version)
 - #138968 (Update the index of Result to make the summary more comprehensive)
 - #139572 (docs(std): mention const blocks in const keyword doc page)
 - #140152 (Unify the format of rustc cli flags)
 - #140193 (fix ICE in `#[naked]` attribute validation)
 - #140205 (Tidying up UI tests [2/N])
 - #140284 (remove expect() in `unnecessary_transmutes`)
 - #140290 (rustdoc: fix typo change from equivelent to equivalent)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/keyword_docs.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index c07c391892d..91701576130 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -119,7 +119,7 @@ mod break_keyword {}
 
 #[doc(keyword = "const")]
 //
-/// Compile-time constants, compile-time evaluable functions, and raw pointers.
+/// Compile-time constants, compile-time blocks, compile-time evaluable functions, and raw pointers.
 ///
 /// ## Compile-time constants
 ///
@@ -166,6 +166,12 @@ mod break_keyword {}
 ///
 /// For more detail on `const`, see the [Rust Book] or the [Reference].
 ///
+/// ## Compile-time blocks
+///
+/// The `const` keyword can also be used to define a block of code that is evaluated at compile time.
+/// This is useful for ensuring certain computations are completed before optimizations happen, as well as
+/// before runtime. For more details, see the [Reference][const-blocks].
+///
 /// ## Compile-time evaluable functions
 ///
 /// The other main use of the `const` keyword is in `const fn`. This marks a function as being
@@ -184,6 +190,7 @@ mod break_keyword {}
 /// [pointer primitive]: pointer
 /// [Rust Book]: ../book/ch03-01-variables-and-mutability.html#constants
 /// [Reference]: ../reference/items/constant-items.html
+/// [const-blocks]: ../reference/expressions/block-expr.html#const-blocks
 /// [const-eval]: ../reference/const_eval.html
 mod const_keyword {}