Skip to content

Commit

Permalink
remove try_node_id_to_type in favor of node_id_to_type_opt
Browse files Browse the repository at this point in the history
  • Loading branch information
flaper87 committed Jan 15, 2015
1 parent 0c96037 commit f99d43e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4133,12 +4133,8 @@ pub fn node_id_to_trait_ref<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId)
}
}

pub fn try_node_id_to_type<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> Option<Ty<'tcx>> {
cx.node_types.borrow().get(&id).cloned()
}

pub fn node_id_to_type<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> Ty<'tcx> {
match try_node_id_to_type(cx, id) {
match node_id_to_type_opt(cx, id) {
Some(ty) => ty,
None => cx.sess.bug(
&format!("node_id_to_type: no type for node `{}`",
Expand Down

0 comments on commit f99d43e

Please sign in to comment.