Skip to content

Commit

Permalink
handle trait items as well
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 1, 2017
1 parent 4310edb commit 8f910bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_mir/transform/add_validation.rs
Expand Up @@ -112,6 +112,7 @@ fn fn_contains_unsafe<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, src: MirSource) ->
match tcx.hir.find(fn_node_id) {
Some(Node::NodeItem(item)) => finder.visit_item(item),
Some(Node::NodeImplItem(item)) => finder.visit_impl_item(item),
Some(Node::NodeTraitItem(item)) => finder.visit_trait_item(item),
Some(Node::NodeExpr(item)) => {
// This is a closure.
// We also have to walk up the parents and check that there is no unsafe block
Expand Down

0 comments on commit 8f910bc

Please sign in to comment.