]> git.lizzy.rs Git - rust.git/commitdiff
handle trait items as well
authorRalf Jung <post@ralfj.de>
Tue, 1 Aug 2017 16:22:58 +0000 (09:22 -0700)
committerRalf Jung <post@ralfj.de>
Tue, 1 Aug 2017 16:22:58 +0000 (09:22 -0700)
src/librustc_mir/transform/add_validation.rs

index 578a63e44b03b7be3d69f4e18f60b65c6439fc0c..374b658dfc7fe428a5ff224cbc1938b529b04d35 100644 (file)
@@ -112,6 +112,7 @@ struct FindUnsafe<'b, 'tcx> where 'tcx : 'b {
     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