From f99d43ecc0d043350d38e44b86f33900a8391491 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 15 Jan 2015 11:59:13 +0100 Subject: [PATCH] remove try_node_id_to_type in favor of node_id_to_type_opt --- src/librustc/middle/ty.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 755983c71bba8..cd8d9be2d69f1 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -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> { - 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 `{}`",