Remove unneeded code, filename from tests, fix rebasing issues

This commit is contained in:
Paul Daniel Faria 2020-06-27 11:20:02 -04:00
parent 28bb8ed9cb
commit b1992b469c
12 changed files with 85 additions and 34 deletions

View file

@ -3,7 +3,11 @@
use std::sync::Arc;
use hir_def::{DefWithBodyId, FunctionId};
use hir_def::{
body::Body,
expr::{Expr, ExprId, UnaryOp},
DefWithBodyId, FunctionId,
};
use hir_expand::diagnostics::DiagnosticSink;
use crate::{
@ -11,13 +15,6 @@ use crate::{
InferenceResult, Ty, TypeCtor,
};
use rustc_hash::FxHashSet;
use hir_def::{
body::Body,
expr::{Expr, ExprId, UnaryOp},
};
pub struct UnsafeValidator<'a, 'b: 'a> {
func: FunctionId,
infer: Arc<InferenceResult>,
@ -75,13 +72,9 @@ pub fn unsafe_expressions(
def: DefWithBodyId,
) -> Vec<UnsafeExpr> {
let mut unsafe_exprs = vec![];
let mut unsafe_block_exprs = FxHashSet::default();
let body = db.body(def);
for (id, expr) in body.exprs.iter() {
match expr {
Expr::Unsafe { .. } => {
unsafe_block_exprs.insert(id);
}
Expr::Call { callee, .. } => {
let ty = &infer[*callee];
if let &Ty::Apply(ApplicationTy {