Skip to content

Commit a49cdb8

Browse files
author
Jorge Aparicio
committed
rustc_driver: unbox closures used in let bindings
1 parent 28ea99e commit a49cdb8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc_driver/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Available lint options:
278278
let max_name_len = plugin.iter().chain(builtin.iter())
279279
.map(|&s| s.name.width(true))
280280
.max().unwrap_or(0);
281-
let padded = |x: &str| {
281+
let padded = |&: x: &str| {
282282
let mut s = repeat(" ").take(max_name_len - x.chars().count())
283283
.collect::<String>();
284284
s.push_str(x);
@@ -289,7 +289,7 @@ Available lint options:
289289
println!(" {} {:7.7} {}", padded("name"), "default", "meaning");
290290
println!(" {} {:7.7} {}", padded("----"), "-------", "-------");
291291

292-
let print_lints = |lints: Vec<&Lint>| {
292+
let print_lints = |&: lints: Vec<&Lint>| {
293293
for lint in lints.into_iter() {
294294
let name = lint.name_lower().replace("_", "-");
295295
println!(" {} {:7.7} {}",
@@ -305,7 +305,7 @@ Available lint options:
305305
let max_name_len = plugin_groups.iter().chain(builtin_groups.iter())
306306
.map(|&(s, _)| s.width(true))
307307
.max().unwrap_or(0);
308-
let padded = |x: &str| {
308+
let padded = |&: x: &str| {
309309
let mut s = repeat(" ").take(max_name_len - x.chars().count())
310310
.collect::<String>();
311311
s.push_str(x);
@@ -316,7 +316,7 @@ Available lint options:
316316
println!(" {} {}", padded("name"), "sub-lints");
317317
println!(" {} {}", padded("----"), "---------");
318318

319-
let print_lint_groups = |lints: Vec<(&'static str, Vec<lint::LintId>)>| {
319+
let print_lint_groups = |&: lints: Vec<(&'static str, Vec<lint::LintId>)>| {
320320
for (name, to) in lints.into_iter() {
321321
let name = name.chars().map(|x| x.to_lowercase())
322322
.collect::<String>().replace("_", "-");

src/librustc_driver/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ fn gather_flowgraph_variants(sess: &Session) -> Vec<borrowck_dot::Variant> {
301301
let print_moves = config::FLOWGRAPH_PRINT_MOVES;
302302
let print_assigns = config::FLOWGRAPH_PRINT_ASSIGNS;
303303
let print_all = config::FLOWGRAPH_PRINT_ALL;
304-
let opt = |print_which| sess.debugging_opt(print_which);
304+
let opt = |&: print_which| sess.debugging_opt(print_which);
305305
let mut variants = Vec::new();
306306
if opt(print_all) || opt(print_loans) {
307307
variants.push(borrowck_dot::Loans);
@@ -365,7 +365,7 @@ impl UserIdentifiedItem {
365365
}
366366

367367
fn to_one_node_id(self, user_option: &str, sess: &Session, map: &ast_map::Map) -> ast::NodeId {
368-
let fail_because = |is_wrong_because| -> ast::NodeId {
368+
let fail_because = |&: is_wrong_because| -> ast::NodeId {
369369
let message =
370370
format!("{} needs NodeId (int) or unique \
371371
path suffix (b::c::d); got {}, which {}",

0 commit comments

Comments
 (0)