Skip to content

Commit d3d707c

Browse files
author
Jorge Aparicio
committed
librustc: fix fallout
1 parent 0dac05d commit d3d707c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc/middle/ty.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4916,7 +4916,9 @@ pub fn has_dtor(cx: &ctxt, struct_id: DefId) -> bool {
49164916
cx.destructor_for_type.borrow().contains_key(&struct_id)
49174917
}
49184918

4919-
pub fn with_path<T>(cx: &ctxt, id: ast::DefId, f: |ast_map::PathElems| -> T) -> T {
4919+
pub fn with_path<T, F>(cx: &ctxt, id: ast::DefId, f: F) -> T where
4920+
F: FnOnce(ast_map::PathElems) -> T,
4921+
{
49204922
if id.krate == ast::LOCAL_CRATE {
49214923
cx.map.with_path(id.node, f)
49224924
} else {

src/librustc/session/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ pub fn build_session_(sopts: config::Options,
288288
}
289289

290290
// Seems out of place, but it uses session, so I'm putting it here
291-
pub fn expect<T>(sess: &Session, opt: Option<T>, msg: || -> String) -> T {
291+
pub fn expect<T, M>(sess: &Session, opt: Option<T>, msg: M) -> T where
292+
M: FnOnce() -> String,
293+
{
292294
diagnostic::expect(sess.diagnostic(), opt, msg)
293295
}
294296

0 commit comments

Comments
 (0)