diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-07-05 17:57:34 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-07-06 15:46:03 -0700 |
| commit | 401b6362d7f99a3cebc863cb1b8906d62e9ba79b (patch) | |
| tree | 9736c1e95b6d5e7d1492727f4fba5fbe4dfeb34d /src/comp/driver | |
| parent | 479ce4d7836c13b3e75b2d0ac48e9f534ff859e7 (diff) | |
| download | rust-401b6362d7f99a3cebc863cb1b8906d62e9ba79b.tar.gz rust-401b6362d7f99a3cebc863cb1b8906d62e9ba79b.zip | |
rustc: Make meta items into interior vectors
Diffstat (limited to 'src/comp/driver')
| -rw-r--r-- | src/comp/driver/rustc.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index f1bd93a4a5d..a39348fe3c8 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -50,13 +50,13 @@ fn default_configuration(session::session sess, str argv0, str input) -> auto mk = attr::mk_name_value_item_str; - ret [ // Target bindings. - mk("target_os", std::os::target_os()), - mk("target_arch", "x86"), - mk("target_libc", libc), - // Build bindings. - mk("build_compiler", argv0), - mk("build_input", input)]; + ret ~[ // Target bindings. + mk("target_os", std::os::target_os()), + mk("target_arch", "x86"), + mk("target_libc", libc), + // Build bindings. + mk("build_compiler", argv0), + mk("build_input", input)]; } fn build_configuration(session::session sess, str argv0, @@ -70,10 +70,9 @@ fn build_configuration(session::session sess, str argv0, fn parse_cfgspecs(&vec[str] cfgspecs) -> ast::crate_cfg { // FIXME: It would be nice to use the parser to parse all varieties of // meta_item here. At the moment we just support the meta_word variant. - fn to_meta_word(&str cfgspec) -> @ast::meta_item { - attr::mk_word_item(cfgspec) - } - ret vec::map(to_meta_word, cfgspecs); + auto words = ~[]; + for (str s in cfgspecs) { words += ~[attr::mk_word_item(s)]; } + ret words; } fn parse_input(session::session sess, &ast::crate_cfg cfg, str input) |
