Skip to content

Commit 858d940

Browse files
committed
Update 3013 header.
1 parent 174816e commit 858d940

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

text/0000-conditional-compilation-checking.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- Feature Name: N/A
2+
- Start Date: 2020-11-04
3+
- RFC PR: [rust-lang/rfcs#3013](https://github.com/rust-lang/rfcs/pull/3013)
4+
- Rust Issue: [rust-lang/rust#82450](https://github.com/rust-lang/rust/issues/82450)
5+
16
# Checking conditional compilation at compile time
27

38
# Summary
@@ -83,7 +88,7 @@ the option name and its argument joined by `=`, or can be specified in a two-arg
8388
### Well-known condition names
8489

8590
`rustc` defines a set of well-known conditions, such as `test`, `target_os`, etc. These conditions
86-
are always valid; it is not necessary to enable checking for these conditions. If these conditions
91+
are always valid; it is not necessary to enable checking for these conditions. If these conditions
8792
are specified in a `--check-cfg names(...)` option then they will be ignored. This set of well-known
8893
names is a part of the stable interface of the compiler. New well-known conditions may be added in
8994
the future, because adding a new name cannot break existing code. However, a name may not be removed
@@ -486,15 +491,15 @@ feature is enabled, while the `zebra` feature is disabled. Consider compiling th
486491
487492
```rust
488493
// this is valid, and tame_lion() will be compiled
489-
#[cfg(feature = "lion")]
494+
#[cfg(feature = "lion")]
490495
fn tame_lion(lion: Lion) { ... }
491496
492497
// this is valid, and ride_zebra() will NOT be compiled
493-
#[cfg(feature = "zebra")]
498+
#[cfg(feature = "zebra")]
494499
fn ride_zebra(zebra: Zebra) { ... }
495500
496-
// this is INVALID, and will cause a compiler error
497-
#[cfg(feature = "platypus")]
501+
// this is INVALID, and will cause a compiler error
502+
#[cfg(feature = "platypus")]
498503
fn poke_platypus() { ... }
499504
500505
// this is INVALID, because 'feechure' is not a known condition name,
@@ -539,7 +544,7 @@ fn tame_lion() { ... }
539544
540545
## Rationale and alternatives
541546
542-
This design enables checking for a class of bugs at compile time, rather than detecting them by
547+
This design enables checking for a class of bugs at compile time, rather than detecting them by
543548
running code.
544549
545550
This design does not break any existing usage of Rustc. It does not change the meaning of existing

0 commit comments

Comments
 (0)