1
Fork 0

rustc_driver: unbox closures used in let bindings

This commit is contained in:
Jorge Aparicio 2014-12-30 20:56:05 -05:00
parent 28ea99eaa6
commit a49cdb8c36
2 changed files with 6 additions and 6 deletions

View file

@ -278,7 +278,7 @@ Available lint options:
let max_name_len = plugin.iter().chain(builtin.iter())
.map(|&s| s.name.width(true))
.max().unwrap_or(0);
let padded = |x: &str| {
let padded = |&: x: &str| {
let mut s = repeat(" ").take(max_name_len - x.chars().count())
.collect::<String>();
s.push_str(x);
@ -289,7 +289,7 @@ Available lint options:
println!(" {} {:7.7} {}", padded("name"), "default", "meaning");
println!(" {} {:7.7} {}", padded("----"), "-------", "-------");
let print_lints = |lints: Vec<&Lint>| {
let print_lints = |&: lints: Vec<&Lint>| {
for lint in lints.into_iter() {
let name = lint.name_lower().replace("_", "-");
println!(" {} {:7.7} {}",
@ -305,7 +305,7 @@ Available lint options:
let max_name_len = plugin_groups.iter().chain(builtin_groups.iter())
.map(|&(s, _)| s.width(true))
.max().unwrap_or(0);
let padded = |x: &str| {
let padded = |&: x: &str| {
let mut s = repeat(" ").take(max_name_len - x.chars().count())
.collect::<String>();
s.push_str(x);
@ -316,7 +316,7 @@ Available lint options:
println!(" {} {}", padded("name"), "sub-lints");
println!(" {} {}", padded("----"), "---------");
let print_lint_groups = |lints: Vec<(&'static str, Vec<lint::LintId>)>| {
let print_lint_groups = |&: lints: Vec<(&'static str, Vec<lint::LintId>)>| {
for (name, to) in lints.into_iter() {
let name = name.chars().map(|x| x.to_lowercase())
.collect::<String>().replace("_", "-");

View file

@ -301,7 +301,7 @@ fn gather_flowgraph_variants(sess: &Session) -> Vec<borrowck_dot::Variant> {
let print_moves = config::FLOWGRAPH_PRINT_MOVES;
let print_assigns = config::FLOWGRAPH_PRINT_ASSIGNS;
let print_all = config::FLOWGRAPH_PRINT_ALL;
let opt = |print_which| sess.debugging_opt(print_which);
let opt = |&: print_which| sess.debugging_opt(print_which);
let mut variants = Vec::new();
if opt(print_all) || opt(print_loans) {
variants.push(borrowck_dot::Loans);
@ -365,7 +365,7 @@ impl UserIdentifiedItem {
}
fn to_one_node_id(self, user_option: &str, sess: &Session, map: &ast_map::Map) -> ast::NodeId {
let fail_because = |is_wrong_because| -> ast::NodeId {
let fail_because = |&: is_wrong_because| -> ast::NodeId {
let message =
format!("{} needs NodeId (int) or unique \
path suffix (b::c::d); got {}, which {}",