mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Remove unneeded code, filename from tests, fix rebasing issues
This commit is contained in:
parent
28bb8ed9cb
commit
b1992b469c
12 changed files with 85 additions and 34 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue