We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca8e99f commit 0b0ca59Copy full SHA for 0b0ca59
src/librustc/middle/trans/closure.rs
@@ -409,6 +409,15 @@ pub fn trans_expr_fn(bcx: block,
409
~"expr_fn");
410
let llfn = decl_internal_cdecl_fn(ccx.llmod, s, llfnty);
411
412
+ // Always mark inline if this is a loop body. This is important for
413
+ // performance on many programs with tight loops.
414
+ if is_loop_body.is_some() {
415
+ set_always_inline(llfn);
416
+ } else {
417
+ // Can't hurt.
418
+ set_inline_hint(llfn);
419
+ }
420
+
421
let Result {bcx: bcx, val: closure} = match sigil {
422
ast::BorrowedSigil | ast::ManagedSigil | ast::OwnedSigil => {
423
let cap_vars = *ccx.maps.capture_map.get(&user_id);
0 commit comments