Skip to content

Commit 8f910bc

Browse files
committed
handle trait items as well
1 parent 4310edb commit 8f910bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_mir/transform/add_validation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fn fn_contains_unsafe<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, src: MirSource) ->
112112
match tcx.hir.find(fn_node_id) {
113113
Some(Node::NodeItem(item)) => finder.visit_item(item),
114114
Some(Node::NodeImplItem(item)) => finder.visit_impl_item(item),
115+
Some(Node::NodeTraitItem(item)) => finder.visit_trait_item(item),
115116
Some(Node::NodeExpr(item)) => {
116117
// This is a closure.
117118
// We also have to walk up the parents and check that there is no unsafe block

0 commit comments

Comments
 (0)