Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compile_error!() to the unsable book
- Loading branch information
1 parent
0b29d26
commit 2bec12f
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/doc/unstable-book/src/language-features/compile-error.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# `compile_error` | ||
|
||
The tracking issue for this feature is: [#40872] | ||
|
||
[#29599]: https://github.com/rust-lang/rust/issues/40872 | ||
|
||
------------------------ | ||
|
||
The `compile_error` feature adds a macro which will generate a compilation | ||
error with the specified error message. | ||
|
||
## Examples | ||
|
||
```rust | ||
#![feature(compile_error)] | ||
|
||
fn main() { | ||
compile_error!("The error message"); //ERROR The error message | ||
} | ||
``` |