From: Nicholas Nethercote Date: Mon, 23 Mar 2020 00:21:27 +0000 (+1100) Subject: Add a comment to `parse_bool`. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=8818eace09b05f07afcfe03d838a214e2afa47b4;hp=c55c682e9ba2be16d5de4264d1b626e70f00de9d;p=rust.git Add a comment to `parse_bool`. It's behaviour can be surprising. --- diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs index a1ecf4e8528..9fd7b7e2e9b 100644 --- a/src/librustc_session/options.rs +++ b/src/librustc_session/options.rs @@ -299,6 +299,9 @@ pub fn $opt(cg: &mut $struct_name, v: Option<&str>) -> bool { } )* + /// 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,