cargo format

This commit is contained in:
Muhammad Mominul Huque 2019-07-08 04:09:35 +06:00
parent 012fec54dc
commit 09b72489dd
No known key found for this signature in database
GPG key ID: 37AF141540DE557D
6 changed files with 14 additions and 14 deletions

View file

@ -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},

View file

@ -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),

View file

@ -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 {

View file

@ -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};

View file

@ -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 {

View file

@ -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;