Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
27747ac1
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
27747ac1
编写于
2月 24, 2015
作者:
E
Eduard Burtescu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert bogus rename from DefTrait to DefaultImpl.
上级
dccdde40
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
26 addition
and
26 deletion
+26
-26
src/librustc/metadata/decoder.rs
src/librustc/metadata/decoder.rs
+1
-1
src/librustc/middle/astencode.rs
src/librustc/middle/astencode.rs
+1
-1
src/librustc/middle/def.rs
src/librustc/middle/def.rs
+2
-2
src/librustc/middle/mem_categorization.rs
src/librustc/middle/mem_categorization.rs
+1
-1
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/resolve_lifetime.rs
+1
-1
src/librustc_privacy/lib.rs
src/librustc_privacy/lib.rs
+1
-1
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/build_reduced_graph.rs
+2
-2
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+4
-4
src/librustc_trans/save/mod.rs
src/librustc_trans/save/mod.rs
+1
-1
src/librustc_trans/trans/callee.rs
src/librustc_trans/trans/callee.rs
+1
-1
src/librustc_typeck/astconv.rs
src/librustc_typeck/astconv.rs
+4
-4
src/librustc_typeck/check/_match.rs
src/librustc_typeck/check/_match.rs
+1
-1
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/method/suggest.rs
+1
-1
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/mod.rs
+3
-3
src/librustdoc/clean/inline.rs
src/librustdoc/clean/inline.rs
+1
-1
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-1
未找到文件。
src/librustc/metadata/decoder.rs
浏览文件 @
27747ac1
...
...
@@ -357,7 +357,7 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
let
enum_did
=
item_reqd_and_translated_parent_item
(
cnum
,
item
);
DlDef
(
def
::
DefVariant
(
enum_did
,
did
,
false
))
}
Trait
=>
DlDef
(
def
::
Def
aultImpl
(
did
)),
Trait
=>
DlDef
(
def
::
Def
Trait
(
did
)),
Enum
=>
DlDef
(
def
::
DefTy
(
did
,
true
)),
Impl
|
DefaultImpl
=>
DlImpl
(
did
),
PublicField
|
InheritedField
=>
DlField
,
...
...
src/librustc/middle/astencode.rs
浏览文件 @
27747ac1
...
...
@@ -440,7 +440,7 @@ fn tr(&self, dcx: &DecodeContext) -> def::Def {
def
::
DefVariant
(
e_did
,
v_did
,
is_s
)
=>
{
def
::
DefVariant
(
e_did
.tr
(
dcx
),
v_did
.tr
(
dcx
),
is_s
)
},
def
::
Def
aultImpl
(
did
)
=>
def
::
DefaultImpl
(
did
.tr
(
dcx
)),
def
::
Def
Trait
(
did
)
=>
def
::
DefTrait
(
did
.tr
(
dcx
)),
def
::
DefTy
(
did
,
is_enum
)
=>
def
::
DefTy
(
did
.tr
(
dcx
),
is_enum
),
def
::
DefAssociatedTy
(
did
)
=>
def
::
DefAssociatedTy
(
did
.tr
(
dcx
)),
def
::
DefAssociatedPath
(
def
::
TyParamProvenance
::
FromSelf
(
did
),
ident
)
=>
...
...
src/librustc/middle/def.rs
浏览文件 @
27747ac1
...
...
@@ -38,7 +38,7 @@ pub enum Def {
// type `U` (indicated by the Ident).
// FIXME(#20301) -- should use Name
DefAssociatedPath
(
TyParamProvenance
,
ast
::
Ident
),
Def
aultImpl
(
ast
::
DefId
),
Def
Trait
(
ast
::
DefId
),
DefPrimTy
(
ast
::
PrimTy
),
DefTyParam
(
ParamSpace
,
u32
,
ast
::
DefId
,
ast
::
Name
),
DefUse
(
ast
::
DefId
),
...
...
@@ -135,7 +135,7 @@ pub fn def_id(&self) -> ast::DefId {
DefFn
(
id
,
_
)
|
DefStaticMethod
(
id
,
_
)
|
DefMod
(
id
)
|
DefForeignMod
(
id
)
|
DefStatic
(
id
,
_
)
|
DefVariant
(
_
,
id
,
_
)
|
DefTy
(
id
,
_
)
|
DefAssociatedTy
(
id
)
|
DefTyParam
(
_
,
_
,
id
,
_
)
|
DefUse
(
id
)
|
DefStruct
(
id
)
|
Def
aultImpl
(
id
)
|
DefTyParam
(
_
,
_
,
id
,
_
)
|
DefUse
(
id
)
|
DefStruct
(
id
)
|
Def
Trait
(
id
)
|
DefMethod
(
id
,
_
,
_
)
|
DefConst
(
id
)
|
DefAssociatedPath
(
TyParamProvenance
::
FromSelf
(
id
),
_
)
|
DefAssociatedPath
(
TyParamProvenance
::
FromParam
(
id
),
_
)
=>
{
...
...
src/librustc/middle/mem_categorization.rs
浏览文件 @
27747ac1
...
...
@@ -579,7 +579,7 @@ pub fn cat_def(&self,
Ok
(
self
.cat_rvalue_node
(
id
,
span
,
expr_ty
))
}
def
::
DefMod
(
_
)
|
def
::
DefForeignMod
(
_
)
|
def
::
DefUse
(
_
)
|
def
::
Def
aultImpl
(
_
)
|
def
::
DefTy
(
..
)
|
def
::
DefPrimTy
(
_
)
|
def
::
Def
Trait
(
_
)
|
def
::
DefTy
(
..
)
|
def
::
DefPrimTy
(
_
)
|
def
::
DefTyParam
(
..
)
|
def
::
DefTyParamBinder
(
..
)
|
def
::
DefRegion
(
_
)
|
def
::
DefLabel
(
_
)
|
def
::
DefSelfTy
(
..
)
|
def
::
DefAssociatedTy
(
..
)
|
def
::
DefAssociatedPath
(
..
)
=>
{
...
...
src/librustc/middle/resolve_lifetime.rs
浏览文件 @
27747ac1
...
...
@@ -169,7 +169,7 @@ fn visit_ty(&mut self, ty: &ast::Ty) {
// if this path references a trait, then this will resolve to
// a trait ref, which introduces a binding scope.
match
self
.def_map
.borrow
()
.get
(
&
id
)
{
Some
(
&
def
::
Def
aultImpl
(
..
))
=>
{
Some
(
&
def
::
Def
Trait
(
..
))
=>
{
self
.with
(
LateScope
(
&
Vec
::
new
(),
self
.scope
),
|
_
,
this
|
{
this
.visit_path
(
path
,
id
);
});
...
...
src/librustc_privacy/lib.rs
浏览文件 @
27747ac1
...
...
@@ -802,7 +802,7 @@ fn check_path(&mut self, span: Span, path_id: ast::NodeId, path: &ast::Path) {
def
::
DefVariant
(
..
)
=>
ck
(
"variant"
),
def
::
DefTy
(
_
,
false
)
=>
ck
(
"type"
),
def
::
DefTy
(
_
,
true
)
=>
ck
(
"enum"
),
def
::
Def
aultImpl
(
..
)
=>
ck
(
"trait"
),
def
::
Def
Trait
(
..
)
=>
ck
(
"trait"
),
def
::
DefStruct
(
..
)
=>
ck
(
"struct"
),
def
::
DefMethod
(
_
,
Some
(
..
),
_
)
=>
ck
(
"trait method"
),
def
::
DefMethod
(
..
)
=>
ck
(
"method"
),
...
...
src/librustc_resolve/build_reduced_graph.rs
浏览文件 @
27747ac1
...
...
@@ -736,7 +736,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent: &Rc<Module>) ->
self
.trait_item_map
.insert
((
name
,
def_id
),
kind
);
}
name_bindings
.define_type
(
Def
aultImpl
(
def_id
),
sp
,
modifiers
);
name_bindings
.define_type
(
Def
Trait
(
def_id
),
sp
,
modifiers
);
parent
.clone
()
}
ItemMac
(
..
)
=>
parent
.clone
()
...
...
@@ -918,7 +918,7 @@ fn handle_external_def(&mut self,
}
child_name_bindings
.define_value
(
def
,
DUMMY_SP
,
modifiers
);
}
Def
aultImpl
(
def_id
)
=>
{
Def
Trait
(
def_id
)
=>
{
debug!
(
"(building reduced graph for external
\
crate) building type {}"
,
final_ident
);
...
...
src/librustc_resolve/lib.rs
浏览文件 @
27747ac1
...
...
@@ -2989,7 +2989,7 @@ fn resolve_item(&mut self, item: &Item) {
// check for imports shadowing primitive types
if
let
ast
::
ViewPathSimple
(
ident
,
_
)
=
view_path
.node
{
match
self
.def_map
.borrow
()
.get
(
&
item
.id
)
{
Some
(
&
DefTy
(
..
))
|
Some
(
&
DefStruct
(
..
))
|
Some
(
&
Def
aultImpl
(
..
))
|
None
=>
{
Some
(
&
DefTy
(
..
))
|
Some
(
&
DefStruct
(
..
))
|
Some
(
&
Def
Trait
(
..
))
|
None
=>
{
self
.check_if_primitive_type_name
(
ident
.name
,
item
.span
);
}
_
=>
{}
...
...
@@ -3199,7 +3199,7 @@ fn resolve_trait_reference(&mut self,
}
Some
(
def
)
=>
{
match
def
{
(
Def
aultImpl
(
_
),
_
)
=>
{
(
Def
Trait
(
_
),
_
)
=>
{
debug!
(
"(resolving trait) found trait def: {:?}"
,
def
);
self
.record_def
(
trait_reference
.ref_id
,
def
);
}
...
...
@@ -4675,7 +4675,7 @@ fn add_trait_info(found_traits: &mut Vec<DefId>,
None
=>
continue
};
let
trait_def_id
=
match
def
{
Def
aultImpl
(
trait_def_id
)
=>
trait_def_id
,
Def
Trait
(
trait_def_id
)
=>
trait_def_id
,
_
=>
continue
,
};
if
self
.trait_item_map
.contains_key
(
&
(
name
,
trait_def_id
))
{
...
...
@@ -4691,7 +4691,7 @@ fn add_trait_info(found_traits: &mut Vec<DefId>,
Some
(
target
)
=>
target
,
};
let
did
=
match
target
.bindings
.def_for_namespace
(
TypeNS
)
{
Some
(
Def
aultImpl
(
trait_def_id
))
=>
trait_def_id
,
Some
(
Def
Trait
(
trait_def_id
))
=>
trait_def_id
,
Some
(
..
)
|
None
=>
continue
,
};
if
self
.trait_item_map
.contains_key
(
&
(
name
,
did
))
{
...
...
src/librustc_trans/save/mod.rs
浏览文件 @
27747ac1
...
...
@@ -239,7 +239,7 @@ fn lookup_def_kind(&self, ref_id: NodeId, span: Span) -> Option<recorder::Row> {
def
::
DefTy
(
..
)
|
def
::
DefAssociatedTy
(
..
)
|
def
::
DefAssociatedPath
(
..
)
|
def
::
Def
aultImpl
(
_
)
=>
Some
(
recorder
::
TypeRef
),
def
::
Def
Trait
(
_
)
=>
Some
(
recorder
::
TypeRef
),
def
::
DefStatic
(
_
,
_
)
|
def
::
DefConst
(
_
)
|
def
::
DefLocal
(
_
)
|
...
...
src/librustc_trans/trans/callee.rs
浏览文件 @
27747ac1
...
...
@@ -207,7 +207,7 @@ fn trans_def<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
def
::
DefUpvar
(
..
)
=>
{
datum_callee
(
bcx
,
ref_expr
)
}
def
::
DefMod
(
..
)
|
def
::
DefForeignMod
(
..
)
|
def
::
Def
aultImpl
(
..
)
|
def
::
DefMod
(
..
)
|
def
::
DefForeignMod
(
..
)
|
def
::
Def
Trait
(
..
)
|
def
::
DefTy
(
..
)
|
def
::
DefPrimTy
(
..
)
|
def
::
DefAssociatedTy
(
..
)
|
def
::
DefUse
(
..
)
|
def
::
DefTyParamBinder
(
..
)
|
def
::
DefRegion
(
..
)
|
def
::
DefLabel
(
..
)
|
def
::
DefTyParam
(
..
)
|
...
...
src/librustc_typeck/astconv.rs
浏览文件 @
27747ac1
...
...
@@ -600,7 +600,7 @@ pub fn instantiate_trait_ref<'tcx>(
->
Rc
<
ty
::
TraitRef
<
'tcx
>>
{
match
::
lookup_def_tcx
(
this
.tcx
(),
ast_trait_ref
.path.span
,
ast_trait_ref
.ref_id
)
{
def
::
Def
aultImpl
(
trait_def_id
)
=>
{
def
::
Def
Trait
(
trait_def_id
)
=>
{
let
trait_ref
=
ast_path_to_trait_ref
(
this
,
rscope
,
trait_def_id
,
...
...
@@ -914,7 +914,7 @@ fn ast_ty_to_trait_ref<'tcx>(this: &AstConv<'tcx>,
match
ty
.node
{
ast
::
TyPath
(
ref
path
,
id
)
=>
{
match
this
.tcx
()
.def_map
.borrow
()
.get
(
&
id
)
{
Some
(
&
def
::
Def
aultImpl
(
trait_def_id
))
=>
{
Some
(
&
def
::
Def
Trait
(
trait_def_id
))
=>
{
let
mut
projection_bounds
=
Vec
::
new
();
let
trait_ref
=
object_path_to_poly_trait_ref
(
this
,
rscope
,
...
...
@@ -1194,7 +1194,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
Some
(
&
d
)
=>
d
};
match
a_def
{
def
::
Def
aultImpl
(
trait_def_id
)
=>
{
def
::
Def
Trait
(
trait_def_id
)
=>
{
// N.B. this case overlaps somewhat with
// TyObjectSum, see that fn for details
let
mut
projection_bounds
=
Vec
::
new
();
...
...
@@ -1804,7 +1804,7 @@ pub fn partition_bounds<'a>(tcx: &ty::ctxt,
match
*
ast_bound
{
ast
::
TraitTyParamBound
(
ref
b
,
ast
::
TraitBoundModifier
::
None
)
=>
{
match
::
lookup_def_tcx
(
tcx
,
b
.trait_ref.path.span
,
b
.trait_ref.ref_id
)
{
def
::
Def
aultImpl
(
trait_did
)
=>
{
def
::
Def
Trait
(
trait_did
)
=>
{
match
trait_def_ids
.get
(
&
trait_did
)
{
// Already seen this trait. We forbid
// duplicates in the list (for some
...
...
src/librustc_typeck/check/_match.rs
浏览文件 @
27747ac1
...
...
@@ -435,7 +435,7 @@ pub fn check_pat_struct<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &'tcx ast::Pat,
let
def
=
tcx
.def_map
.borrow
()[
pat
.id
]
.clone
();
let
(
enum_def_id
,
variant_def_id
)
=
match
def
{
def
::
Def
aultImpl
(
_
)
=>
{
def
::
Def
Trait
(
_
)
=>
{
let
name
=
pprust
::
path_to_string
(
path
);
span_err!
(
tcx
.sess
,
pat
.span
,
E0168
,
"use of trait `{}` in a struct pattern"
,
name
);
...
...
src/librustc_typeck/check/method/suggest.rs
浏览文件 @
27747ac1
...
...
@@ -330,7 +330,7 @@ fn handle_external_def(traits: &mut AllTraitsVec,
cstore
:
&
cstore
::
CStore
,
dl
:
decoder
::
DefLike
)
{
match
dl
{
decoder
::
DlDef
(
def
::
Def
aultImpl
(
did
))
=>
{
decoder
::
DlDef
(
def
::
Def
Trait
(
did
))
=>
{
traits
.push
(
TraitInfo
::
new
(
did
));
}
decoder
::
DlDef
(
def
::
DefMod
(
did
))
=>
{
...
...
src/librustc_typeck/check/mod.rs
浏览文件 @
27747ac1
...
...
@@ -3862,7 +3862,7 @@ fn check_struct_fields_on_error<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
variant_id
,
&
fields
[
..
]);
enum_id
}
Some
(
def
::
Def
aultImpl
(
def_id
))
=>
{
Some
(
def
::
Def
Trait
(
def_id
))
=>
{
span_err!
(
tcx
.sess
,
path
.span
,
E0159
,
"use of trait `{}` as a struct constructor"
,
pprust
::
path_to_string
(
path
));
...
...
@@ -4634,7 +4634,7 @@ fn type_scheme_and_predicates_for_def<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
def
::
DefStruct
(
id
)
|
def
::
DefConst
(
id
)
=>
{
(
ty
::
lookup_item_type
(
fcx
.tcx
(),
id
),
ty
::
lookup_predicates
(
fcx
.tcx
(),
id
))
}
def
::
Def
aultImpl
(
_
)
|
def
::
Def
Trait
(
_
)
|
def
::
DefTy
(
..
)
|
def
::
DefAssociatedTy
(
..
)
|
def
::
DefAssociatedPath
(
..
)
|
...
...
@@ -4738,7 +4738,7 @@ pub fn instantiate_path<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
def
::
DefTy
(
..
)
|
def
::
DefAssociatedTy
(
..
)
|
def
::
DefAssociatedPath
(
..
)
|
def
::
Def
aultImpl
(
..
)
|
def
::
Def
Trait
(
..
)
|
def
::
DefPrimTy
(
..
)
|
def
::
DefTyParam
(
..
)
=>
{
// Everything but the final segment should have no
...
...
src/librustdoc/clean/inline.rs
浏览文件 @
27747ac1
...
...
@@ -69,7 +69,7 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
let
mut
ret
=
Vec
::
new
();
let
did
=
def
.def_id
();
let
inner
=
match
def
{
def
::
Def
aultImpl
(
did
)
=>
{
def
::
Def
Trait
(
did
)
=>
{
record_extern_fqn
(
cx
,
did
,
clean
::
TypeTrait
);
clean
::
TraitItem
(
build_external_trait
(
cx
,
tcx
,
did
))
}
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
27747ac1
...
...
@@ -2430,7 +2430,7 @@ fn register_def(cx: &DocContext, def: def::Def) -> ast::DefId {
def
::
DefFn
(
i
,
_
)
=>
(
i
,
TypeFunction
),
def
::
DefTy
(
i
,
false
)
=>
(
i
,
TypeTypedef
),
def
::
DefTy
(
i
,
true
)
=>
(
i
,
TypeEnum
),
def
::
Def
aultImpl
(
i
)
=>
(
i
,
TypeTrait
),
def
::
Def
Trait
(
i
)
=>
(
i
,
TypeTrait
),
def
::
DefStruct
(
i
)
=>
(
i
,
TypeStruct
),
def
::
DefMod
(
i
)
=>
(
i
,
TypeModule
),
def
::
DefStatic
(
i
,
_
)
=>
(
i
,
TypeStatic
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录