Skip to content

Commit 9ffe3e3

Browse files
committed
Merge pull request #21190 from FlaPer87/remove_duplicated_func
[r+] remove try_node_id_to_type in favor of node_id_to_type_opt Reviewed-by: nikomatsakis
2 parents ec2d59d + f99d43e commit 9ffe3e3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/librustc/middle/ty.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4133,12 +4133,8 @@ pub fn node_id_to_trait_ref<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId)
41334133
}
41344134
}
41354135

4136-
pub fn try_node_id_to_type<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> Option<Ty<'tcx>> {
4137-
cx.node_types.borrow().get(&id).cloned()
4138-
}
4139-
41404136
pub fn node_id_to_type<'tcx>(cx: &ctxt<'tcx>, id: ast::NodeId) -> Ty<'tcx> {
4141-
match try_node_id_to_type(cx, id) {
4137+
match node_id_to_type_opt(cx, id) {
41424138
Some(ty) => ty,
41434139
None => cx.sess.bug(
41444140
&format!("node_id_to_type: no type for node `{}`",

0 commit comments

Comments
 (0)