mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
cargo format
This commit is contained in:
parent
012fec54dc
commit
09b72489dd
6 changed files with 14 additions and 14 deletions
|
@ -19,7 +19,10 @@ use crate::{
|
|||
TypeAliasId,
|
||||
},
|
||||
impl_block::ImplBlock,
|
||||
name::{BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, STR, U128, U16, U32, U64, U8, USIZE, SELF_TYPE},
|
||||
name::{
|
||||
BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128, U16, U32, U64,
|
||||
U8, USIZE,
|
||||
},
|
||||
nameres::{CrateModuleId, ImportId, ModuleScope, Namespace},
|
||||
resolve::Resolver,
|
||||
traits::{TraitData, TraitItem},
|
||||
|
|
|
@ -82,11 +82,7 @@ impl GenericParams {
|
|||
GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start),
|
||||
GenericDef::Trait(it) => {
|
||||
// traits get the Self type as an implicit first type parameter
|
||||
generics.params.push(GenericParam {
|
||||
idx: start,
|
||||
name: SELF_TYPE,
|
||||
default: None,
|
||||
});
|
||||
generics.params.push(GenericParam { idx: start, name: SELF_TYPE, default: None });
|
||||
generics.fill(&*it.source(db).ast, start + 1);
|
||||
}
|
||||
GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start),
|
||||
|
|
|
@ -112,7 +112,8 @@ pub(crate) const SELF_TYPE: Name = Name::new(SmolStr::new_inline_from_ascii(4, b
|
|||
pub(crate) const MACRO_RULES: Name = Name::new(SmolStr::new_inline_from_ascii(11, b"macro_rules"));
|
||||
pub(crate) const STD: Name = Name::new(SmolStr::new_inline_from_ascii(3, b"std"));
|
||||
pub(crate) const ITER: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"iter"));
|
||||
pub(crate) const INTO_ITERATOR: Name = Name::new(SmolStr::new_inline_from_ascii(12, b"IntoIterator"));
|
||||
pub(crate) const INTO_ITERATOR: Name =
|
||||
Name::new(SmolStr::new_inline_from_ascii(12, b"IntoIterator"));
|
||||
pub(crate) const ITEM: Name = Name::new(SmolStr::new_inline_from_ascii(4, b"Item"));
|
||||
|
||||
fn resolve_name(text: &SmolStr) -> SmolStr {
|
||||
|
|
|
@ -65,8 +65,8 @@ use test_utils::tested_by;
|
|||
|
||||
use crate::{
|
||||
diagnostics::DiagnosticSink, either::Either, ids::MacroDefId,
|
||||
nameres::diagnostics::DefDiagnostic, AstDatabase, AstId, BuiltinType, Crate,
|
||||
DefDatabase, HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait,
|
||||
nameres::diagnostics::DefDiagnostic, AstDatabase, AstId, BuiltinType, Crate, DefDatabase,
|
||||
HirFileId, MacroDef, Module, ModuleDef, Name, Path, PathKind, Trait,
|
||||
};
|
||||
|
||||
pub(crate) use self::raw::{ImportSourceMap, RawItems};
|
||||
|
|
|
@ -13,8 +13,8 @@ use crate::{
|
|||
diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData,
|
||||
ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode,
|
||||
},
|
||||
AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path,
|
||||
Static, Struct, Trait, TypeAlias, Union,
|
||||
AstId, Const, DefDatabase, Enum, Function, HirFileId, MacroDef, Module, Name, Path, Static,
|
||||
Struct, Trait, TypeAlias, Union,
|
||||
};
|
||||
|
||||
pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap {
|
||||
|
|
|
@ -40,7 +40,7 @@ use crate::{
|
|||
PatId, Statement, UnaryOp,
|
||||
},
|
||||
generics::{GenericParams, HasGenericParams},
|
||||
name::{SELF_TYPE, INTO_ITERATOR, ITEM, ITER, STD},
|
||||
name::{INTO_ITERATOR, ITEM, ITER, SELF_TYPE, STD},
|
||||
nameres::{Namespace, PerNs},
|
||||
path::{GenericArg, GenericArgs, PathKind, PathSegment},
|
||||
resolve::{
|
||||
|
@ -49,8 +49,8 @@ use crate::{
|
|||
},
|
||||
ty::infer::diagnostics::InferenceDiagnostic,
|
||||
type_ref::{Mutability, TypeRef},
|
||||
AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem,
|
||||
ModuleDef, Name, Path, StructField,
|
||||
AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem, ModuleDef, Name, Path,
|
||||
StructField,
|
||||
};
|
||||
|
||||
mod unify;
|
||||
|
|
Loading…
Reference in a new issue