From d3d707c88397d8356f5181be600166ded3390907 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 8 Dec 2014 14:14:06 -0500 Subject: [PATCH] librustc: fix fallout --- src/librustc/middle/ty.rs | 4 +++- src/librustc/session/mod.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index ddbf69685cd9..ffca616d76a8 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -4916,7 +4916,9 @@ pub fn has_dtor(cx: &ctxt, struct_id: DefId) -> bool { cx.destructor_for_type.borrow().contains_key(&struct_id) } -pub fn with_path(cx: &ctxt, id: ast::DefId, f: |ast_map::PathElems| -> T) -> T { +pub fn with_path(cx: &ctxt, id: ast::DefId, f: F) -> T where + F: FnOnce(ast_map::PathElems) -> T, +{ if id.krate == ast::LOCAL_CRATE { cx.map.with_path(id.node, f) } else { diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index e4d34e09d330..8516ece202c7 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -288,7 +288,9 @@ pub fn build_session_(sopts: config::Options, } // Seems out of place, but it uses session, so I'm putting it here -pub fn expect(sess: &Session, opt: Option, msg: || -> String) -> T { +pub fn expect(sess: &Session, opt: Option, msg: M) -> T where + M: FnOnce() -> String, +{ diagnostic::expect(sess.diagnostic(), opt, msg) }