//! `unsafe`.
use self::RootUnsafeContext::*;
-use dep_graph::DepNode;
use ty::{self, Ty, TyCtxt};
use ty::MethodCall;
use lint;
fn type_is_unsafe_function(ty: Ty) -> bool {
match ty.sty {
- ty::TyFnDef(.., ref f) |
- ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe,
+ ty::TyFnDef(.., f) |
+ ty::TyFnPtr(f) => f.unsafety() == hir::Unsafety::Unsafe,
_ => false,
}
}
}
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
- let _task = tcx.dep_graph.in_task(DepNode::EffectCheck);
-
let mut visitor = EffectCheckVisitor {
tcx: tcx,
tables: &ty::TypeckTables::empty(),