librustc: fix fallout
This commit is contained in:
parent
0dac05dd62
commit
d3d707c883
2 changed files with 6 additions and 2 deletions
|
|
@ -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<T>(cx: &ctxt, id: ast::DefId, f: |ast_map::PathElems| -> T) -> T {
|
||||
pub fn with_path<T, F>(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 {
|
||||
|
|
|
|||
|
|
@ -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<T>(sess: &Session, opt: Option<T>, msg: || -> String) -> T {
|
||||
pub fn expect<T, M>(sess: &Session, opt: Option<T>, msg: M) -> T where
|
||||
M: FnOnce() -> String,
|
||||
{
|
||||
diagnostic::expect(sess.diagnostic(), opt, msg)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue