Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lower.rs')
-rw-r--r--crates/hir-ty/src/lower.rs35
1 files changed, 15 insertions, 20 deletions
diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs
index 12f3a1138f..e5f3c4cfc8 100644
--- a/crates/hir-ty/src/lower.rs
+++ b/crates/hir-ty/src/lower.rs
@@ -16,16 +16,19 @@ use std::{
use base_db::Crate;
use chalk_ir::{
+ Mutability, Safety, TypeOutlives,
cast::Cast,
fold::{Shift, TypeFoldable},
interner::HasInterner,
- Mutability, Safety, TypeOutlives,
};
use either::Either;
use hir_def::{
+ AdtId, AssocItemId, CallableDefId, ConstId, ConstParamId, DefWithBodyId, EnumId, EnumVariantId,
+ FunctionId, GenericDefId, GenericParamId, HasModule, ImplId, InTypeConstLoc, LocalFieldId,
+ Lookup, StaticId, StructId, TypeAliasId, TypeOrConstParamId, TypeOwnerId, UnionId, VariantId,
builtin_type::BuiltinType,
- data::{adt::StructKind, TraitFlags},
+ data::{TraitFlags, adt::StructKind},
expander::Expander,
generics::{
GenericParamDataRef, TypeOrConstParamData, TypeParamProvenance, WherePredicate,
@@ -39,11 +42,8 @@ use hir_def::{
ConstRef, LifetimeRef, PathId, TraitBoundModifier, TraitRef as HirTraitRef, TypeBound,
TypeRef, TypeRefId, TypesMap, TypesSourceMap,
},
- AdtId, AssocItemId, CallableDefId, ConstId, ConstParamId, DefWithBodyId, EnumId, EnumVariantId,
- FunctionId, GenericDefId, GenericParamId, HasModule, ImplId, InTypeConstLoc, LocalFieldId,
- Lookup, StaticId, StructId, TypeAliasId, TypeOrConstParamId, TypeOwnerId, UnionId, VariantId,
};
-use hir_expand::{name::Name, ExpandResult};
+use hir_expand::{ExpandResult, name::Name};
use la_arena::{Arena, ArenaMap};
use rustc_hash::FxHashSet;
use rustc_pattern_analysis::Captures;
@@ -53,27 +53,26 @@ use syntax::ast;
use triomphe::{Arc, ThinArc};
use crate::{
- all_super_traits,
+ AliasTy, Binders, BoundVar, CallableSig, Const, ConstScalar, DebruijnIndex, DynTy, FnAbi,
+ FnPointer, FnSig, FnSubst, ImplTrait, ImplTraitId, ImplTraits, Interner, Lifetime,
+ LifetimeData, LifetimeOutlives, ParamKind, PolyFnSig, ProgramClause, QuantifiedWhereClause,
+ QuantifiedWhereClauses, Substitution, TraitEnvironment, TraitRef, TraitRefExt, Ty, TyBuilder,
+ TyKind, WhereClause, all_super_traits,
consteval::{
intern_const_ref, intern_const_scalar, path_to_const, unknown_const,
unknown_const_as_generic,
},
db::{HirDatabase, HirDatabaseData},
error_lifetime,
- generics::{generics, trait_self_param_idx, Generics},
+ generics::{Generics, generics, trait_self_param_idx},
lower::{
diagnostics::*,
path::{PathDiagnosticCallback, PathLoweringContext},
},
make_binders,
- mapping::{from_chalk_trait_id, lt_to_placeholder_idx, ToChalk},
+ mapping::{ToChalk, from_chalk_trait_id, lt_to_placeholder_idx},
static_lifetime, to_chalk_trait_id, to_placeholder_idx,
- utils::{all_super_trait_refs, InTypeConstIdMetadata},
- AliasTy, Binders, BoundVar, CallableSig, Const, ConstScalar, DebruijnIndex, DynTy, FnAbi,
- FnPointer, FnSig, FnSubst, ImplTrait, ImplTraitId, ImplTraits, Interner, Lifetime,
- LifetimeData, LifetimeOutlives, ParamKind, PolyFnSig, ProgramClause, QuantifiedWhereClause,
- QuantifiedWhereClauses, Substitution, TraitEnvironment, TraitRef, TraitRefExt, Ty, TyBuilder,
- TyKind, WhereClause,
+ utils::{InTypeConstIdMetadata, all_super_trait_refs},
};
#[derive(Debug, Default)]
@@ -1301,11 +1300,7 @@ fn implicitly_sized_clauses<'a, 'subst: 'a>(
.enumerate()
.filter_map(
move |(idx, generic_arg)| {
- if Some(idx) == trait_self_idx {
- None
- } else {
- Some(generic_arg)
- }
+ if Some(idx) == trait_self_idx { None } else { Some(generic_arg) }
},
)
.filter_map(|generic_arg| generic_arg.ty(Interner))