Skip to content

Commit 2c716be

Browse files
nbdd0121ojeda
andauthored
Apply suggestions from code review
Co-authored-by: Miguel Ojeda <[email protected]>
1 parent 72e9caa commit 2c716be

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/Kconfig.debug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,8 +2648,8 @@ choice
26482648
help
26492649
Controls how are `build_error!` and `build_assert!` handled during build.
26502650

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.
26532653
You can choose to abort compilation or ignore them during build and let the
26542654
check be carried to runtime.
26552655

rust/build_error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
//! Build-time error.
44
//!
5-
//! This crate provides a method `build_error`, which will panic in
5+
//! This crate provides a function `build_error`, which will panic in
66
//! 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
88
//! call.
99
//!
1010
//! It is used by `build_assert!` in the kernel crate, allowing checking of

rust/kernel/build_assert.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
//! Build-time assert.
44
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.
76
///
87
/// If the macro is executed in const context, `build_error!` will panic.
98
/// If the compiler or optimizer cannot guarantee that `build_error!` can never
@@ -36,7 +35,7 @@ macro_rules! build_error {
3635
///
3736
/// # Examples
3837
///
39-
/// This examples show that different types of [`assert!`] will trigger errors
38+
/// These examples show that different types of [`assert!`] will trigger errors
4039
/// at different stage of compilation. It is preferred to err as early as
4140
/// possible, so [`static_assert!`] should be used whenever possible.
4241
/// ```no_run
@@ -47,7 +46,7 @@ macro_rules! build_error {
4746
/// }
4847
/// ```
4948
///
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,
5150
/// [`static_assert!`] cannot be used. Use `build_assert!` in this scenario.
5251
/// ```no_run
5352
/// fn foo<const N: usize>() {

0 commit comments

Comments
 (0)