Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6282e5da
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
6282e5da
编写于
2月 19, 2013
作者:
L
Luqman Aden
提交者:
Tim Chevalier
2月 20, 2013
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc: tidy
上级
601c2edb
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
43 addition
and
33 deletion
+43
-33
src/librustc/back/link.rs
src/librustc/back/link.rs
+3
-1
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+2
-1
src/librustc/middle/astencode.rs
src/librustc/middle/astencode.rs
+4
-2
src/librustc/middle/check_loop.rs
src/librustc/middle/check_loop.rs
+1
-1
src/librustc/middle/lint.rs
src/librustc/middle/lint.rs
+20
-20
src/librustc/middle/trans/_match.rs
src/librustc/middle/trans/_match.rs
+1
-1
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/base.rs
+8
-4
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/debuginfo.rs
+3
-2
src/librustc/middle/typeck/infer/resolve.rs
src/librustc/middle/typeck/infer/resolve.rs
+1
-1
未找到文件。
src/librustc/back/link.rs
浏览文件 @
6282e5da
...
...
@@ -686,7 +686,9 @@ pub fn exported_name(sess: Session,
path_name
(
sess
.ident_of
(
vers
.to_owned
()))));
}
pub
fn
mangle_exported_name
(
ccx
:
@
CrateContext
,
+
path
:
path
,
t
:
ty
::
t
)
->
~
str
{
pub
fn
mangle_exported_name
(
ccx
:
@
CrateContext
,
+
path
:
path
,
t
:
ty
::
t
)
->
~
str
{
let
hash
=
get_symbol_hash
(
ccx
,
t
);
return
exported_name
(
ccx
.sess
,
path
,
hash
,
...
...
src/librustc/metadata/encoder.rs
浏览文件 @
6282e5da
...
...
@@ -1071,7 +1071,8 @@ fn encode_attributes(ebml_w: writer::Encoder, attrs: &[attribute]) {
// metadata that Rust cares about for linking crates. This attribute requires
// 'name' and 'vers' items, so if the user didn't provide them we will throw
// them in anyway with default values.
fn
synthesize_crate_attrs
(
ecx
:
@
EncodeContext
,
crate
:
&
crate
)
->
~
[
attribute
]
{
fn
synthesize_crate_attrs
(
ecx
:
@
EncodeContext
,
crate
:
&
crate
)
->
~
[
attribute
]
{
fn
synthesize_link_attr
(
ecx
:
@
EncodeContext
,
+
items
:
~
[
@
meta_item
])
->
attribute
{
...
...
src/librustc/middle/astencode.rs
浏览文件 @
6282e5da
...
...
@@ -565,7 +565,8 @@ fn encode_method_map_entry(ecx: @e::EncodeContext,
}
impl
read_method_map_entry_helper
for
reader
::
Decoder
{
fn
read_method_map_entry
(
xcx
:
@
ExtendedDecodeContext
)
->
method_map_entry
{
fn
read_method_map_entry
(
xcx
:
@
ExtendedDecodeContext
)
->
method_map_entry
{
do
self
.read_rec
{
method_map_entry
{
self_arg
:
self
.read_field
(
~
"self_arg"
,
0u
,
||
{
...
...
@@ -672,7 +673,8 @@ fn encode_vtable_origin(ecx: @e::EncodeContext,
trait
vtable_decoder_helpers
{
fn
read_vtable_res
(
xcx
:
@
ExtendedDecodeContext
)
->
typeck
::
vtable_res
;
fn
read_vtable_origin
(
xcx
:
@
ExtendedDecodeContext
)
->
typeck
::
vtable_origin
;
fn
read_vtable_origin
(
xcx
:
@
ExtendedDecodeContext
)
->
typeck
::
vtable_origin
;
}
impl
vtable_decoder_helpers
for
reader
::
Decoder
{
...
...
src/librustc/middle/check_loop.rs
浏览文件 @
6282e5da
...
...
@@ -45,7 +45,7 @@ pub fn check_crate(tcx: ty::ctxt, crate: @crate) {
},
v
);
}
expr_fn_block
(
_
,
ref
b
)
=>
{
(
v
.visit_block
)((
*
b
),
Context
{
(
v
.visit_block
)((
*
b
),
Context
{
in_loop
:
false
,
can_ret
:
false
},
v
);
...
...
src/librustc/middle/lint.rs
浏览文件 @
6282e5da
...
...
@@ -130,42 +130,42 @@ pub fn get_lint_dict() -> LintDict {
(
@~
"unused_imports"
,
@
LintSpec
{
lint
:
unused_imports
,
lint
:
unused_imports
,
desc
:
"imports that are never used"
,
default
:
allow
}),
(
@~
"while_true"
,
@
LintSpec
{
lint
:
while_true
,
lint
:
while_true
,
desc
:
"suggest using loop { } instead of while(true) { }"
,
default
:
warn
}),
(
@~
"path_statement"
,
@
LintSpec
{
lint
:
path_statement
,
lint
:
path_statement
,
desc
:
"path statements with no effect"
,
default
:
warn
}),
(
@~
"unrecognized_lint"
,
@
LintSpec
{
lint
:
unrecognized_lint
,
lint
:
unrecognized_lint
,
desc
:
"unrecognized lint attribute"
,
default
:
warn
}),
(
@~
"non_implicitly_copyable_typarams"
,
@
LintSpec
{
lint
:
non_implicitly_copyable_typarams
,
lint
:
non_implicitly_copyable_typarams
,
desc
:
"passing non implicitly copyable types as copy type params"
,
default
:
warn
}),
(
@~
"vecs_implicitly_copyable"
,
@
LintSpec
{
lint
:
vecs_implicitly_copyable
,
lint
:
vecs_implicitly_copyable
,
desc
:
"make vecs and strs not implicitly copyable
\
(only checked at top level)"
,
default
:
warn
...
...
@@ -173,84 +173,84 @@ pub fn get_lint_dict() -> LintDict {
(
@~
"implicit_copies"
,
@
LintSpec
{
lint
:
implicit_copies
,
lint
:
implicit_copies
,
desc
:
"implicit copies of non implicitly copyable data"
,
default
:
warn
}),
(
@~
"deprecated_mode"
,
@
LintSpec
{
lint
:
deprecated_mode
,
lint
:
deprecated_mode
,
desc
:
"warn about deprecated uses of modes"
,
default
:
warn
}),
(
@~
"deprecated_pattern"
,
@
LintSpec
{
lint
:
deprecated_pattern
,
lint
:
deprecated_pattern
,
desc
:
"warn about deprecated uses of pattern bindings"
,
default
:
allow
}),
(
@~
"non_camel_case_types"
,
@
LintSpec
{
lint
:
non_camel_case_types
,
lint
:
non_camel_case_types
,
desc
:
"types, variants and traits should have camel case names"
,
default
:
allow
}),
(
@~
"managed_heap_memory"
,
@
LintSpec
{
lint
:
managed_heap_memory
,
lint
:
managed_heap_memory
,
desc
:
"use of managed (@ type) heap memory"
,
default
:
allow
}),
(
@~
"owned_heap_memory"
,
@
LintSpec
{
lint
:
owned_heap_memory
,
lint
:
owned_heap_memory
,
desc
:
"use of owned (~ type) heap memory"
,
default
:
allow
}),
(
@~
"heap_memory"
,
@
LintSpec
{
lint
:
heap_memory
,
lint
:
heap_memory
,
desc
:
"use of any (~ type or @ type) heap memory"
,
default
:
allow
}),
(
@~
"structural_records"
,
@
LintSpec
{
lint
:
structural_records
,
lint
:
structural_records
,
desc
:
"use of any structural records"
,
default
:
deny
}),
(
@~
"legacy modes"
,
@
LintSpec
{
lint
:
legacy_modes
,
lint
:
legacy_modes
,
desc
:
"allow legacy modes"
,
default
:
forbid
}),
(
@~
"type_limits"
,
@
LintSpec
{
lint
:
type_limits
,
lint
:
type_limits
,
desc
:
"comparisons made useless by limits of the types involved"
,
default
:
warn
}),
(
@~
"default_methods"
,
@
LintSpec
{
lint
:
default_methods
,
lint
:
default_methods
,
desc
:
"allow default methods"
,
default
:
deny
}),
(
@~
"deprecated_self"
,
@
LintSpec
{
lint
:
deprecated_self
,
lint
:
deprecated_self
,
desc
:
"warn about deprecated uses of `self`"
,
default
:
warn
}),
...
...
@@ -258,14 +258,14 @@ pub fn get_lint_dict() -> LintDict {
/* FIXME(#3266)--make liveness warnings lintable
(@~"unused_variable",
@LintSpec {
lint: unused_variable,
lint: unused_variable,
desc: "detect variables which are not used in any way",
default: warn
}),
(@~"dead_assignment",
@LintSpec {
lint: dead_assignment,
lint: dead_assignment,
desc: "detect assignments that will never be read",
default: warn
}),
...
...
src/librustc/middle/trans/_match.rs
浏览文件 @
6282e5da
...
...
@@ -854,7 +854,7 @@ pub fn extract_variant_args(bcx: block,
GEP_enum
(
bcx
,
blobptr
,
vdefs_tg
,
vdefs_var
,
/*bad*/
copy
enum_ty_substs
,
i
)
};
ExtractedBlock
{
vals
:
args
,
bcx
:
bcx
}
}
...
...
src/librustc/middle/trans/base.rs
浏览文件 @
6282e5da
...
...
@@ -353,7 +353,7 @@ pub fn malloc_general_dyn(bcx: block, t: ty::t, heap: heap, size: ValueRef)
let
Result
{
bcx
:
bcx
,
val
:
llbox
}
=
malloc_raw_dyn
(
bcx
,
t
,
heap
,
size
);
let
non_gc_box
=
non_gc_box_cast
(
bcx
,
llbox
);
let
body
=
GEPi
(
bcx
,
non_gc_box
,
[
0u
,
abi
::
box_field_body
]);
MallocResult
{
bcx
:
bcx
,
box
:
llbox
,
body
:
body
}
}
...
...
@@ -479,7 +479,9 @@ pub fn get_res_dtor(ccx: @CrateContext, did: ast::def_id,
inline
::
maybe_instantiate_inline
(
ccx
,
did
,
true
)
}
else
{
did
};
assert
did
.crate
==
ast
::
local_crate
;
let
(
val
,
_
)
=
monomorphize
::
monomorphic_fn
(
ccx
,
did
,
substs
,
None
,
None
,
None
);
let
(
val
,
_
)
=
monomorphize
::
monomorphic_fn
(
ccx
,
did
,
substs
,
None
,
None
,
None
);
val
}
else
if
did
.crate
==
ast
::
local_crate
{
get_item_val
(
ccx
,
did
.node
)
...
...
@@ -2206,7 +2208,8 @@ pub fn is_main_fn(sess: &Session, node_id: ast::node_id) -> bool {
// Create a _rust_main(args: ~[str]) function which will be called from the
// runtime rust_start function
pub
fn
create_main_wrapper
(
ccx
:
@
CrateContext
,
_
sp
:
span
,
main_llfn
:
ValueRef
)
{
pub
fn
create_main_wrapper
(
ccx
:
@
CrateContext
,
_
sp
:
span
,
main_llfn
:
ValueRef
)
{
let
llfn
=
create_main
(
ccx
,
main_llfn
);
create_entry_fn
(
ccx
,
llfn
);
...
...
@@ -2911,7 +2914,8 @@ pub fn fill_crate_map(ccx: @CrateContext, map: ValueRef) {
}
}
pub
fn
crate_ctxt_to_encode_parms
(
cx
:
@
CrateContext
)
->
encoder
::
EncodeParams
{
pub
fn
crate_ctxt_to_encode_parms
(
cx
:
@
CrateContext
)
->
encoder
::
EncodeParams
{
let
encode_inlined_item
:
encoder
::
encode_inlined_item
=
|
ecx
,
ebml_w
,
path
,
ii
|
astencode
::
encode_inlined_item
(
ecx
,
ebml_w
,
path
,
ii
,
cx
.maps
);
...
...
src/librustc/middle/trans/debuginfo.rs
浏览文件 @
6282e5da
...
...
@@ -146,7 +146,7 @@ struct LocalVarMetadata {
struct
TyDescMetadata
{
hash
:
uint
}
struct
BlockMetadata
{
struct
BlockMetadata
{
start
:
codemap
::
Loc
,
end
:
codemap
::
Loc
}
...
...
@@ -261,7 +261,8 @@ fn get_file_path_and_dir(work_dir: &str, full_path: &str) -> (~str, ~str) {
},
str
::
from_slice
(
work_dir
))
}
fn
create_file
(
cx
:
@
CrateContext
,
+
full_path
:
~
str
)
->
@
Metadata
<
FileMetadata
>
{
fn
create_file
(
cx
:
@
CrateContext
,
+
full_path
:
~
str
)
->
@
Metadata
<
FileMetadata
>
{
let
cache
=
get_cache
(
cx
);;
let
tg
=
FileDescriptorTag
;
match
cached_metadata
::
<@
Metadata
<
FileMetadata
>>
(
...
...
src/librustc/middle/typeck/infer/resolve.rs
浏览文件 @
6282e5da
...
...
@@ -223,7 +223,7 @@ fn resolve_ty_var(&mut self, vid: TyVid) -> ty::t {
let
bounds
=
nde
.possible_types
;
let
t1
=
match
bounds
{
Bounds
{
ub
:
_
,
lb
:
Some
(
t
)
}
if
!
type_is_bot
(
t
)
Bounds
{
ub
:
_
,
lb
:
Some
(
t
)
}
if
!
type_is_bot
(
t
)
=>
self
.resolve_type
(
t
),
Bounds
{
ub
:
Some
(
t
),
lb
:
_
}
=>
self
.resolve_type
(
t
),
Bounds
{
ub
:
_
,
lb
:
Some
(
t
)
}
=>
self
.resolve_type
(
t
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录