Skip to content

Commit b5ca329

Browse files
authored
Show details in cfg version unstable book
1 parent f24ce9b commit b5ca329

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/doc/unstable-book/src/language-features/cfg-version.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ The tracking issue for this feature is: [#64796]
77
------------------------
88

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

1213
## Examples
1314

1415
```rust
1516
#![feature(cfg_version)]
1617

17-
#[cfg(version("1.42"))]
18+
#[cfg(version("1.42"))] // 1.42 and above
1819
fn a() {
1920
// ...
2021
}
2122

22-
#[cfg(not(version("1.42")))]
23+
#[cfg(not(version("1.42")))] // 1.41 and below
2324
fn a() {
2425
// ...
2526
}

0 commit comments

Comments
 (0)