Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/utils.rs')
-rw-r--r--crates/hir-ty/src/utils.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/hir-ty/src/utils.rs b/crates/hir-ty/src/utils.rs
index 3bd04b21b2..695527444d 100644
--- a/crates/hir-ty/src/utils.rs
+++ b/crates/hir-ty/src/utils.rs
@@ -5,33 +5,33 @@ use std::{hash::Hash, iter};
use base_db::Crate;
use chalk_ir::{
- fold::{FallibleTypeFolder, Shift},
DebruijnIndex,
+ fold::{FallibleTypeFolder, Shift},
};
use hir_def::{
+ EnumId, EnumVariantId, FunctionId, Lookup, OpaqueInternableThing, TraitId, TypeAliasId,
+ TypeOrConstParamId,
db::DefDatabase,
generics::{WherePredicate, WherePredicateTypeTarget},
lang_item::LangItem,
resolver::{HasResolver, TypeNs},
type_ref::{TraitBoundModifier, TypeRef},
- EnumId, EnumVariantId, FunctionId, Lookup, OpaqueInternableThing, TraitId, TypeAliasId,
- TypeOrConstParamId,
};
use hir_expand::name::Name;
use intern::sym;
use rustc_abi::TargetDataLayout;
use rustc_hash::FxHashSet;
-use smallvec::{smallvec, SmallVec};
+use smallvec::{SmallVec, smallvec};
use span::Edition;
use stdx::never;
use crate::{
+ ChalkTraitId, Const, ConstScalar, GenericArg, Interner, Substitution, TargetFeatures, TraitRef,
+ TraitRefExt, Ty, WhereClause,
consteval::unknown_const,
db::HirDatabase,
layout::{Layout, TagEncoding},
mir::pad16,
- ChalkTraitId, Const, ConstScalar, GenericArg, Interner, Substitution, TargetFeatures, TraitRef,
- TraitRefExt, Ty, WhereClause,
};
pub(crate) fn fn_traits(db: &dyn DefDatabase, krate: Crate) -> impl Iterator<Item = TraitId> + '_ {
@@ -315,11 +315,7 @@ pub fn is_fn_unsafe_to_call(
} else {
// Function in an `extern` block are always unsafe to call, except when
// it is marked as `safe`.
- if data.is_safe() {
- Unsafety::Safe
- } else {
- Unsafety::Unsafe
- }
+ if data.is_safe() { Unsafety::Safe } else { Unsafety::Unsafe }
}
}
_ => Unsafety::Safe,