Skip to content

Commit 6bc8f41

Browse files
Aatchpnkfelix
authored andcommitted
---
yaml --- r: 188319 b: refs/heads/master c: 280dea7 h: refs/heads/master i: 188317: d2a55c0 188315: 6f19bb8 188311: f31f80b 188303: 66e68eb 188287: 787ea4e v: v3
1 parent 35bf495 commit 6bc8f41

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1246d4067fdc034d064dfb78f88c2c3c079c3f4f
2+
refs/heads/master: 280dea743b5227d0d162217cbb89db881242c94e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
55
refs/heads/try: 649d35e4d830b27806705dc5352c86ab6d6fd1a1

trunk/src/librustc/session/config.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ macro_rules! options {
348348
#[allow(non_upper_case_globals, dead_code)]
349349
mod $mod_desc {
350350
pub const parse_bool: Option<&'static str> = None;
351-
pub const parse_opt_bool: Option<&'static str> = None;
351+
pub const parse_opt_bool: Option<&'static str> =
352+
Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`");
352353
pub const parse_string: Option<&'static str> = Some("a string");
353354
pub const parse_opt_string: Option<&'static str> = Some("a string");
354355
pub const parse_list: Option<&'static str> = Some("a space-separated list of strings");
@@ -379,7 +380,19 @@ macro_rules! options {
379380

380381
fn parse_opt_bool(slot: &mut Option<bool>, v: Option<&str>) -> bool {
381382
match v {
382-
Some(..) => false,
383+
Some(s) => {
384+
match s {
385+
"n" | "no" | "off" => {
386+
*slot = Some(false);
387+
}
388+
"y" | "yes" | "on" => {
389+
*slot = Some(true);
390+
}
391+
_ => { return false; }
392+
}
393+
394+
true
395+
},
383396
None => { *slot = Some(true); true }
384397
}
385398
}

0 commit comments

Comments
 (0)