File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2648,8 +2648,8 @@ choice
2648
2648
help
2649
2649
Controls how are `build_error!` and `build_assert!` handled during build.
2650
2650
2651
- If calls to them exist in the binary, it may indicates a violated invariant
2652
- or that the optimizer fails to verify the invariant during compilation.
2651
+ If calls to them exist in the binary, it may indicate a violated invariant
2652
+ or that the optimizer failed to verify the invariant during compilation.
2653
2653
You can choose to abort compilation or ignore them during build and let the
2654
2654
check be carried to runtime.
2655
2655
Original file line number Diff line number Diff line change 2
2
3
3
//! Build-time error.
4
4
//!
5
- //! This crate provides a method `build_error`, which will panic in
5
+ //! This crate provides a function `build_error`, which will panic in
6
6
//! compile-time if executed in const context, and will cause a build error
7
- //! if not executed in compile time and optimizer does not optimise away the
7
+ //! if not executed at compile time and the optimizer does not optimise away the
8
8
//! call.
9
9
//!
10
10
//! It is used by `build_assert!` in the kernel crate, allowing checking of
Original file line number Diff line number Diff line change 2
2
3
3
//! Build-time assert.
4
4
5
- /// Causes build to fail if the code path calling `build_error!` can possibly be
6
- /// executed.
5
+ /// Fails the build if the code path calling `build_error!` can possibly be executed.
7
6
///
8
7
/// If the macro is executed in const context, `build_error!` will panic.
9
8
/// If the compiler or optimizer cannot guarantee that `build_error!` can never
@@ -36,7 +35,7 @@ macro_rules! build_error {
36
35
///
37
36
/// # Examples
38
37
///
39
- /// This examples show that different types of [`assert!`] will trigger errors
38
+ /// These examples show that different types of [`assert!`] will trigger errors
40
39
/// at different stage of compilation. It is preferred to err as early as
41
40
/// possible, so [`static_assert!`] should be used whenever possible.
42
41
/// ```no_run
@@ -47,7 +46,7 @@ macro_rules! build_error {
47
46
/// }
48
47
/// ```
49
48
///
50
- /// When condition refers to generic parameter or parameter of an inline function,
49
+ /// When the condition refers to generic parameters or parameters of an inline function,
51
50
/// [`static_assert!`] cannot be used. Use `build_assert!` in this scenario.
52
51
/// ```no_run
53
52
/// fn foo<const N: usize>() {
You can’t perform that action at this time.
0 commit comments