Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
189c0085
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
189c0085
编写于
3月 07, 2014
作者:
F
Felix S. Klock II
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
alpha-rename .ident to .name in Lifetime, including in rustdoc.
上级
460ca4f0
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
29 addition
and
29 deletion
+29
-29
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/resolve_lifetime.rs
+7
-7
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/astconv.rs
+3
-3
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/collect.rs
+1
-1
src/librustc/util/ppaux.rs
src/librustc/util/ppaux.rs
+8
-8
src/librustdoc/clean.rs
src/librustdoc/clean.rs
+1
-1
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+1
-1
src/libsyntax/ext/build.rs
src/libsyntax/ext/build.rs
+2
-2
src/libsyntax/fold.rs
src/libsyntax/fold.rs
+1
-1
src/libsyntax/parse/mod.rs
src/libsyntax/parse/mod.rs
+3
-3
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+1
-1
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+1
-1
未找到文件。
src/librustc/middle/resolve_lifetime.rs
浏览文件 @
189c0085
...
...
@@ -145,7 +145,7 @@ fn visit_block(&mut self,
fn
visit_lifetime_ref
(
&
mut
self
,
lifetime_ref
:
&
ast
::
Lifetime
,
scope
:
&
'a
ScopeChain
<
'a
>
)
{
if
lifetime_ref
.
ident
==
special_idents
::
statik
.name
{
if
lifetime_ref
.
name
==
special_idents
::
statik
.name
{
self
.insert_lifetime
(
lifetime_ref
,
ast
::
DefStaticRegion
);
return
;
}
...
...
@@ -262,7 +262,7 @@ fn unresolved_lifetime_ref(&self,
self
.sess
.span_err
(
lifetime_ref
.span
,
format!
(
"use of undeclared lifetime name `'{}`"
,
token
::
get_name
(
lifetime_ref
.
ident
)));
token
::
get_name
(
lifetime_ref
.
name
)));
}
fn
check_lifetime_names
(
&
self
,
lifetimes
:
&
OptVec
<
ast
::
Lifetime
>
)
{
...
...
@@ -271,23 +271,23 @@ fn check_lifetime_names(&self, lifetimes: &OptVec<ast::Lifetime>) {
let
special_idents
=
[
special_idents
::
statik
];
for
lifetime
in
lifetimes
.iter
()
{
if
special_idents
.iter
()
.any
(|
&
i
|
i
.name
==
lifetime
.
ident
)
{
if
special_idents
.iter
()
.any
(|
&
i
|
i
.name
==
lifetime
.
name
)
{
self
.sess
.span_err
(
lifetime
.span
,
format!
(
"illegal lifetime parameter name: `{}`"
,
token
::
get_name
(
lifetime
.
ident
)));
token
::
get_name
(
lifetime
.
name
)));
}
}
for
j
in
range
(
i
+
1
,
lifetimes
.len
())
{
let
lifetime_j
=
lifetimes
.get
(
j
);
if
lifetime_i
.
ident
==
lifetime_j
.ident
{
if
lifetime_i
.
name
==
lifetime_j
.name
{
self
.sess
.span_err
(
lifetime_j
.span
,
format!
(
"lifetime name `'{}` declared twice in
\
the same scope"
,
token
::
get_name
(
lifetime_j
.
ident
)));
token
::
get_name
(
lifetime_j
.
name
)));
}
}
}
...
...
@@ -315,7 +315,7 @@ fn search_lifetimes(lifetimes: &OptVec<ast::Lifetime>,
lifetime_ref
:
&
ast
::
Lifetime
)
->
Option
<
(
uint
,
ast
::
NodeId
)
>
{
for
(
i
,
lifetime_decl
)
in
lifetimes
.iter
()
.enumerate
()
{
if
lifetime_decl
.
ident
==
lifetime_ref
.ident
{
if
lifetime_decl
.
name
==
lifetime_ref
.name
{
return
Some
((
i
,
lifetime_decl
.id
));
}
}
...
...
src/librustc/middle/typeck/astconv.rs
浏览文件 @
189c0085
...
...
@@ -92,18 +92,18 @@ pub fn ast_region_to_region(tcx: ty::ctxt, lifetime: &ast::Lifetime)
Some
(
&
ast
::
DefLateBoundRegion
(
binder_id
,
_
,
id
))
=>
{
ty
::
ReLateBound
(
binder_id
,
ty
::
BrNamed
(
ast_util
::
local_def
(
id
),
lifetime
.
ident
))
lifetime
.
name
))
}
Some
(
&
ast
::
DefEarlyBoundRegion
(
index
,
id
))
=>
{
ty
::
ReEarlyBound
(
id
,
index
,
lifetime
.
ident
)
ty
::
ReEarlyBound
(
id
,
index
,
lifetime
.
name
)
}
Some
(
&
ast
::
DefFreeRegion
(
scope_id
,
id
))
=>
{
ty
::
ReFree
(
ty
::
FreeRegion
{
scope_id
:
scope_id
,
bound_region
:
ty
::
BrNamed
(
ast_util
::
local_def
(
id
),
lifetime
.
ident
)
lifetime
.
name
)
})
}
};
...
...
src/librustc/middle/typeck/collect.rs
浏览文件 @
189c0085
...
...
@@ -966,7 +966,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
base_index
:
uint
)
->
ty
::
Generics
{
return
ty
::
Generics
{
region_param_defs
:
Rc
::
new
(
generics
.lifetimes
.iter
()
.map
(|
l
|
{
ty
::
RegionParameterDef
{
name
:
l
.
ident
,
ty
::
RegionParameterDef
{
name
:
l
.
name
,
def_id
:
local_def
(
l
.id
)
}
})
.collect
()),
type_param_defs
:
Rc
::
new
(
generics
.ty_params
.mapi_to_vec
(|
offset
,
param
|
{
...
...
src/librustc/util/ppaux.rs
浏览文件 @
189c0085
...
...
@@ -161,8 +161,8 @@ pub fn bound_region_to_str(cx: ctxt,
}
match
br
{
BrNamed
(
_
,
ident
)
=>
format!
(
"{}'{}{}"
,
prefix
,
token
::
get_name
(
ident
),
space_str
),
BrNamed
(
_
,
name
)
=>
format!
(
"{}'{}{}"
,
prefix
,
token
::
get_name
(
name
),
space_str
),
BrAnon
(
_
)
=>
prefix
.to_str
(),
BrFresh
(
_
)
=>
prefix
.to_str
(),
}
...
...
@@ -224,7 +224,7 @@ pub fn region_to_str(cx: ctxt, prefix: &str, space: bool, region: Region) -> ~st
// `explain_region()` or `note_and_explain_region()`.
match
region
{
ty
::
ReScope
(
_
)
=>
prefix
.to_str
(),
ty
::
ReEarlyBound
(
_
,
_
,
ident
)
=>
token
::
get_name
(
ident
)
.get
()
.to_str
(),
ty
::
ReEarlyBound
(
_
,
_
,
name
)
=>
token
::
get_name
(
name
)
.get
()
.to_str
(),
ty
::
ReLateBound
(
_
,
br
)
=>
bound_region_to_str
(
cx
,
prefix
,
space
,
br
),
ty
::
ReFree
(
ref
fr
)
=>
bound_region_to_str
(
cx
,
prefix
,
space
,
fr
.bound_region
),
ty
::
ReInfer
(
ReSkolemized
(
_
,
br
))
=>
{
...
...
@@ -720,9 +720,9 @@ impl Repr for ty::BoundRegion {
fn
repr
(
&
self
,
tcx
:
ctxt
)
->
~
str
{
match
*
self
{
ty
::
BrAnon
(
id
)
=>
format!
(
"BrAnon({})"
,
id
),
ty
::
BrNamed
(
id
,
ident
)
=>
format!
(
"BrNamed({}, {})"
,
id
.repr
(
tcx
),
token
::
get_name
(
ident
)),
ty
::
BrNamed
(
id
,
name
)
=>
format!
(
"BrNamed({}, {})"
,
id
.repr
(
tcx
),
token
::
get_name
(
name
)),
ty
::
BrFresh
(
id
)
=>
format!
(
"BrFresh({})"
,
id
),
}
}
...
...
@@ -731,9 +731,9 @@ fn repr(&self, tcx: ctxt) -> ~str {
impl
Repr
for
ty
::
Region
{
fn
repr
(
&
self
,
tcx
:
ctxt
)
->
~
str
{
match
*
self
{
ty
::
ReEarlyBound
(
id
,
index
,
ident
)
=>
{
ty
::
ReEarlyBound
(
id
,
index
,
name
)
=>
{
format!
(
"ReEarlyBound({}, {}, {})"
,
id
,
index
,
token
::
get_name
(
ident
))
id
,
index
,
token
::
get_name
(
name
))
}
ty
::
ReLateBound
(
binder_id
,
ref
bound_region
)
=>
{
...
...
src/librustdoc/clean.rs
浏览文件 @
189c0085
...
...
@@ -333,7 +333,7 @@ pub fn get_ref<'a>(&'a self) -> &'a str {
impl
Clean
<
Lifetime
>
for
ast
::
Lifetime
{
fn
clean
(
&
self
)
->
Lifetime
{
Lifetime
(
token
::
get_name
(
self
.
ident
)
.get
()
.to_owned
())
Lifetime
(
token
::
get_name
(
self
.
name
)
.get
()
.to_owned
())
}
}
...
...
src/libsyntax/ast.rs
浏览文件 @
189c0085
...
...
@@ -118,7 +118,7 @@ fn decode(d: &mut D) -> Ident {
pub
struct
Lifetime
{
id
:
NodeId
,
span
:
Span
,
ident
:
Name
name
:
Name
}
// a "Path" is essentially Rust's notion of a name;
...
...
src/libsyntax/ext/build.rs
浏览文件 @
189c0085
...
...
@@ -413,8 +413,8 @@ fn typarambound(&self, path: ast::Path) -> ast::TyParamBound {
ast
::
TraitTyParamBound
(
self
.trait_ref
(
path
))
}
fn
lifetime
(
&
self
,
span
:
Span
,
ident
:
ast
::
Name
)
->
ast
::
Lifetime
{
ast
::
Lifetime
{
id
:
ast
::
DUMMY_NODE_ID
,
span
:
span
,
ident
:
ident
}
fn
lifetime
(
&
self
,
span
:
Span
,
name
:
ast
::
Name
)
->
ast
::
Lifetime
{
ast
::
Lifetime
{
id
:
ast
::
DUMMY_NODE_ID
,
span
:
span
,
name
:
name
}
}
fn
stmt_expr
(
&
self
,
expr
:
@
ast
::
Expr
)
->
@
ast
::
Stmt
{
...
...
src/libsyntax/fold.rs
浏览文件 @
189c0085
...
...
@@ -435,7 +435,7 @@ pub fn fold_lifetime<T: Folder>(l: &Lifetime, fld: &mut T) -> Lifetime {
Lifetime
{
id
:
fld
.new_id
(
l
.id
),
span
:
fld
.new_span
(
l
.span
),
ident
:
l
.ident
name
:
l
.name
}
}
...
...
src/libsyntax/parse/mod.rs
浏览文件 @
189c0085
...
...
@@ -323,7 +323,7 @@ fn sp(a: u32, b: u32) -> Span {
segments
:
vec!
(
ast
::
PathSegment
{
identifier
:
str_to_ident
(
"a"
),
lifetimes
:
opt_vec
::
Empty
,
lifetimes
:
Vec
::
new
()
,
types
:
opt_vec
::
Empty
,
}
),
...
...
@@ -342,12 +342,12 @@ fn sp(a: u32, b: u32) -> Span {
segments
:
vec!
(
ast
::
PathSegment
{
identifier
:
str_to_ident
(
"a"
),
lifetimes
:
opt_vec
::
Empty
,
lifetimes
:
Vec
::
new
()
,
types
:
opt_vec
::
Empty
,
},
ast
::
PathSegment
{
identifier
:
str_to_ident
(
"b"
),
lifetimes
:
opt_vec
::
Empty
,
lifetimes
:
Vec
::
new
()
,
types
:
opt_vec
::
Empty
,
}
)
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
189c0085
...
...
@@ -1609,7 +1609,7 @@ pub fn parse_lifetime(&mut self) -> ast::Lifetime {
return
ast
::
Lifetime
{
id
:
ast
::
DUMMY_NODE_ID
,
span
:
span
,
ident
:
i
.name
name
:
i
.name
};
}
_
=>
{
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
189c0085
...
...
@@ -1956,7 +1956,7 @@ pub fn print_bounds(s: &mut State, bounds: &OptVec<ast::TyParamBound>,
pub
fn
print_lifetime
(
s
:
&
mut
State
,
lifetime
:
&
ast
::
Lifetime
)
->
io
::
IoResult
<
()
>
{
try!
(
word
(
&
mut
s
.s
,
"'"
));
print_name
(
s
,
lifetime
.
ident
)
print_name
(
s
,
lifetime
.
name
)
}
pub
fn
print_generics
(
s
:
&
mut
State
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录