From 8818eace09b05f07afcfe03d838a214e2afa47b4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 23 Mar 2020 11:21:27 +1100 Subject: [PATCH] Add a comment to `parse_bool`. It's behaviour can be surprising. --- src/librustc_session/options.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs index a1ecf4e8528b..9fd7b7e2e9be 100644 --- a/src/librustc_session/options.rs +++ b/src/librustc_session/options.rs @@ -299,6 +299,9 @@ macro_rules! options { } )* + /// Set a flag to true. Note that it cannot set the flag to false, so + /// using this parser in combination with a flag that defaults to true + /// is useless; the flag will always be true. fn parse_bool(slot: &mut bool, v: Option<&str>) -> bool { match v { Some(..) => false,