Skip to content

Commit

Permalink
Show details in cfg version unstable book
Browse files Browse the repository at this point in the history
  • Loading branch information
pickfire committed Mar 16, 2021
1 parent f24ce9b commit b5ca329
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/doc/unstable-book/src/language-features/cfg-version.md
Expand Up @@ -7,19 +7,20 @@ The tracking issue for this feature is: [#64796]
------------------------

The `cfg_version` feature makes it possible to execute different code
depending on the compiler version.
depending on the compiler version. It will return true if the compiler
version is greater than or equal to the specified version.

## Examples

```rust
#![feature(cfg_version)]

#[cfg(version("1.42"))]
#[cfg(version("1.42"))] // 1.42 and above
fn a() {
// ...
}

#[cfg(not(version("1.42")))]
#[cfg(not(version("1.42")))] // 1.41 and below
fn a() {
// ...
}
Expand Down

0 comments on commit b5ca329

Please sign in to comment.