Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
00c70d1a
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,发现更多精彩内容 >>
提交
00c70d1a
编写于
7月 07, 2014
作者:
P
Patrick Walton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
librustc: Allow the new UFCS explicit self in trait definitions, and
remove `~self` from the test suite.
上级
fe49cbeb
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
31 addition
and
31 deletion
+31
-31
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+1
-1
src/test/compile-fail/issue-5153.rs
src/test/compile-fail/issue-5153.rs
+2
-2
src/test/compile-fail/lint-unused-mut-self.rs
src/test/compile-fail/lint-unused-mut-self.rs
+1
-1
src/test/compile-fail/object-pointer-types.rs
src/test/compile-fail/object-pointer-types.rs
+1
-1
src/test/debuginfo/generic-method-on-generic-struct.rs
src/test/debuginfo/generic-method-on-generic-struct.rs
+1
-1
src/test/debuginfo/method-on-enum.rs
src/test/debuginfo/method-on-enum.rs
+1
-1
src/test/debuginfo/method-on-generic-struct.rs
src/test/debuginfo/method-on-generic-struct.rs
+1
-1
src/test/debuginfo/method-on-struct.rs
src/test/debuginfo/method-on-struct.rs
+1
-1
src/test/debuginfo/method-on-trait.rs
src/test/debuginfo/method-on-trait.rs
+2
-2
src/test/debuginfo/method-on-tuple-struct.rs
src/test/debuginfo/method-on-tuple-struct.rs
+1
-1
src/test/debuginfo/self-in-default-method.rs
src/test/debuginfo/self-in-default-method.rs
+1
-1
src/test/debuginfo/self-in-generic-default-method.rs
src/test/debuginfo/self-in-generic-default-method.rs
+1
-1
src/test/run-pass/autoderef-method-on-trait.rs
src/test/run-pass/autoderef-method-on-trait.rs
+2
-2
src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
+2
-2
src/test/run-pass/autoderef-method-twice.rs
src/test/run-pass/autoderef-method-twice.rs
+2
-2
src/test/run-pass/autoderef-method.rs
src/test/run-pass/autoderef-method.rs
+2
-2
src/test/run-pass/explicit-self-objects-uniq.rs
src/test/run-pass/explicit-self-objects-uniq.rs
+2
-2
src/test/run-pass/explicit-self.rs
src/test/run-pass/explicit-self.rs
+1
-1
src/test/run-pass/issue-7320.rs
src/test/run-pass/issue-7320.rs
+1
-1
src/test/run-pass/objects-owned-object-owned-method.rs
src/test/run-pass/objects-owned-object-owned-method.rs
+2
-2
src/test/run-pass/self-in-mut-slot-default-method.rs
src/test/run-pass/self-in-mut-slot-default-method.rs
+1
-1
src/test/run-pass/uniq-self-in-mut-slot.rs
src/test/run-pass/uniq-self-in-mut-slot.rs
+2
-2
未找到文件。
src/librustdoc/clean/mod.rs
浏览文件 @
00c70d1a
...
...
@@ -1003,7 +1003,7 @@ fn clean(&self) -> Item {
};
let
s
=
match
s
{
ty
::
ByReferenceExplicitSelfCategory
(
..
)
=>
{
match
ty
::
get
(
*
self
.fty.sig.inputs
[
0
])
.sty
{
match
ty
::
get
(
self
.fty.sig.inputs
[
0
])
.sty
{
ty
::
ty_rptr
(
r
,
mt
)
=>
{
SelfBorrowed
(
r
.clean
(),
mt
.mutbl
.clean
())
}
...
...
src/test/compile-fail/issue-5153.rs
浏览文件 @
00c70d1a
...
...
@@ -11,11 +11,11 @@
// error-pattern: type `&Foo` does not implement any method in scope named `foo`
trait
Foo
{
fn
foo
(
~
self
);
fn
foo
(
self
:
Box
<
Self
>
);
}
impl
Foo
for
int
{
fn
foo
(
~
self
)
{
}
fn
foo
(
self
:
Box
<
int
>
)
{
}
}
fn
main
()
{
...
...
src/test/compile-fail/lint-unused-mut-self.rs
浏览文件 @
00c70d1a
...
...
@@ -16,7 +16,7 @@
struct
Foo
;
impl
Foo
{
fn
foo
(
mut
self
)
{}
//~ ERROR: variable does not need to be mutable
fn
bar
(
mut
~
self
)
{}
//~ ERROR: variable does not need to be mutable
fn
bar
(
mut
self
:
Box
<
Foo
>
)
{}
//~ ERROR: variable does not need to be mutable
}
fn
main
()
{}
src/test/compile-fail/object-pointer-types.rs
浏览文件 @
00c70d1a
...
...
@@ -13,7 +13,7 @@ trait Foo {
fn
borrowed
(
&
self
);
fn
borrowed_mut
(
&
mut
self
);
fn
owned
(
~
self
);
fn
owned
(
self
:
Box
<
Self
>
);
}
fn
borrowed_receiver
(
x
:
&
Foo
)
{
...
...
src/test/debuginfo/generic-method-on-generic-struct.rs
浏览文件 @
00c70d1a
...
...
@@ -134,7 +134,7 @@ fn self_by_val<T2>(self, arg1: int, arg2: T2) -> int {
arg1
}
fn
self_owned
<
T2
>
(
~
self
,
arg1
:
int
,
arg2
:
T2
)
->
int
{
fn
self_owned
<
T2
>
(
self
:
Box
<
Struct
<
T1
>>
,
arg1
:
int
,
arg2
:
T2
)
->
int
{
zzz
();
// #break
arg1
}
...
...
src/test/debuginfo/method-on-enum.rs
浏览文件 @
00c70d1a
...
...
@@ -136,7 +136,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
Enum
>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
arg1
+
arg2
}
...
...
src/test/debuginfo/method-on-generic-struct.rs
浏览文件 @
00c70d1a
...
...
@@ -134,7 +134,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
Struct
<
T
>>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
arg1
+
arg2
}
...
...
src/test/debuginfo/method-on-struct.rs
浏览文件 @
00c70d1a
...
...
@@ -133,7 +133,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
self
.x
+
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
Struct
>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
self
.x
+
arg1
+
arg2
}
...
...
src/test/debuginfo/method-on-trait.rs
浏览文件 @
00c70d1a
...
...
@@ -124,7 +124,7 @@ struct Struct {
trait
Trait
{
fn
self_by_ref
(
&
self
,
arg1
:
int
,
arg2
:
int
)
->
int
;
fn
self_by_val
(
self
,
arg1
:
int
,
arg2
:
int
)
->
int
;
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
;
fn
self_owned
(
self
:
Box
<
Self
>
,
arg1
:
int
,
arg2
:
int
)
->
int
;
}
impl
Trait
for
Struct
{
...
...
@@ -139,7 +139,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
self
.x
+
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
Struct
>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
self
.x
+
arg1
+
arg2
}
...
...
src/test/debuginfo/method-on-tuple-struct.rs
浏览文件 @
00c70d1a
...
...
@@ -131,7 +131,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
TupleStruct
>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
arg1
+
arg2
}
...
...
src/test/debuginfo/self-in-default-method.rs
浏览文件 @
00c70d1a
...
...
@@ -133,7 +133,7 @@ fn self_by_val(self, arg1: int, arg2: int) -> int {
arg1
+
arg2
}
fn
self_owned
(
~
self
,
arg1
:
int
,
arg2
:
int
)
->
int
{
fn
self_owned
(
self
:
Box
<
Self
>
,
arg1
:
int
,
arg2
:
int
)
->
int
{
zzz
();
// #break
arg1
+
arg2
}
...
...
src/test/debuginfo/self-in-generic-default-method.rs
浏览文件 @
00c70d1a
...
...
@@ -134,7 +134,7 @@ fn self_by_val<T>(self, arg1: int, arg2: T) -> int {
arg1
}
fn
self_owned
<
T
>
(
~
self
,
arg1
:
int
,
arg2
:
T
)
->
int
{
fn
self_owned
<
T
>
(
self
:
Box
<
Self
>
,
arg1
:
int
,
arg2
:
T
)
->
int
{
zzz
();
// #break
arg1
}
...
...
src/test/run-pass/autoderef-method-on-trait.rs
浏览文件 @
00c70d1a
...
...
@@ -10,11 +10,11 @@
trait
double
{
fn
double
(
~
self
)
->
uint
;
fn
double
(
self
:
Box
<
Self
>
)
->
uint
;
}
impl
double
for
uint
{
fn
double
(
~
self
)
->
uint
{
*
self
*
2u
}
fn
double
(
self
:
Box
<
uint
>
)
->
uint
{
*
self
*
2u
}
}
pub
fn
main
()
{
...
...
src/test/run-pass/autoderef-method-twice-but-not-thrice.rs
浏览文件 @
00c70d1a
...
...
@@ -10,11 +10,11 @@
trait
double
{
fn
double
(
~
self
)
->
uint
;
fn
double
(
self
:
Box
<
Self
>
)
->
uint
;
}
impl
double
for
Box
<
uint
>
{
fn
double
(
~
self
)
->
uint
{
**
self
*
2u
}
fn
double
(
self
:
Box
<
Box
<
uint
>>
)
->
uint
{
**
self
*
2u
}
}
pub
fn
main
()
{
...
...
src/test/run-pass/autoderef-method-twice.rs
浏览文件 @
00c70d1a
...
...
@@ -9,11 +9,11 @@
// except according to those terms.
trait
double
{
fn
double
(
~
self
)
->
uint
;
fn
double
(
self
:
Box
<
Self
>
)
->
uint
;
}
impl
double
for
uint
{
fn
double
(
~
self
)
->
uint
{
*
self
*
2u
}
fn
double
(
self
:
Box
<
uint
>
)
->
uint
{
*
self
*
2u
}
}
pub
fn
main
()
{
...
...
src/test/run-pass/autoderef-method.rs
浏览文件 @
00c70d1a
...
...
@@ -9,11 +9,11 @@
// except according to those terms.
trait
double
{
fn
double
(
~
self
)
->
uint
;
fn
double
(
self
:
Box
<
Self
>
)
->
uint
;
}
impl
double
for
uint
{
fn
double
(
~
self
)
->
uint
{
*
self
*
2u
}
fn
double
(
self
:
Box
<
uint
>
)
->
uint
{
*
self
*
2u
}
}
pub
fn
main
()
{
...
...
src/test/run-pass/explicit-self-objects-uniq.rs
浏览文件 @
00c70d1a
...
...
@@ -10,7 +10,7 @@
trait
Foo
{
fn
f
(
~
self
);
fn
f
(
self
:
Box
<
Self
>
);
}
struct
S
{
...
...
@@ -18,7 +18,7 @@ struct S {
}
impl
Foo
for
S
{
fn
f
(
~
self
)
{
fn
f
(
self
:
Box
<
S
>
)
{
assert_eq!
(
self
.x
,
3
);
}
}
...
...
src/test/run-pass/explicit-self.rs
浏览文件 @
00c70d1a
...
...
@@ -57,7 +57,7 @@ fn thing(x: A) -> thing {
}
impl
thing
{
pub
fn
bar
(
~
self
)
->
int
{
self
.x.a
}
pub
fn
bar
(
self
:
Box
<
thing
>
)
->
int
{
self
.x.a
}
pub
fn
quux
(
&
self
)
->
int
{
self
.x.a
}
pub
fn
baz
<
'a
>
(
&
'a
self
)
->
&
'a
A
{
&
self
.x
}
pub
fn
spam
(
self
)
->
int
{
self
.x.a
}
...
...
src/test/run-pass/issue-7320.rs
浏览文件 @
00c70d1a
...
...
@@ -10,7 +10,7 @@
trait
Foo
{
fn
foo
(
~
self
)
{
bar
(
self
as
Box
<
Foo
>
);
}
fn
foo
(
self
:
Box
<
Self
>
)
{
bar
(
self
as
Box
<
Foo
>
);
}
}
fn
bar
(
_
b
:
Box
<
Foo
>
)
{
}
...
...
src/test/run-pass/objects-owned-object-owned-method.rs
浏览文件 @
00c70d1a
...
...
@@ -14,7 +14,7 @@
trait
FooTrait
{
fn
foo
(
~
self
)
->
uint
;
fn
foo
(
self
:
Box
<
Self
>
)
->
uint
;
}
struct
BarStruct
{
...
...
@@ -22,7 +22,7 @@ struct BarStruct {
}
impl
FooTrait
for
BarStruct
{
fn
foo
(
~
self
)
->
uint
{
fn
foo
(
self
:
Box
<
BarStruct
>
)
->
uint
{
self
.x
}
}
...
...
src/test/run-pass/self-in-mut-slot-default-method.rs
浏览文件 @
00c70d1a
...
...
@@ -19,7 +19,7 @@ fn change(mut self) -> Self {
self
}
fn
change_again
(
mut
~
self
)
->
Box
<
Self
>
{
fn
change_again
(
mut
self
:
Box
<
Self
>
)
->
Box
<
Self
>
{
self
.set_to
(
45
);
self
}
...
...
src/test/run-pass/uniq-self-in-mut-slot.rs
浏览文件 @
00c70d1a
...
...
@@ -14,11 +14,11 @@ struct X {
}
trait
Changer
{
fn
change
(
mut
~
self
)
->
Box
<
Self
>
;
fn
change
(
mut
self
:
Box
<
Self
>
)
->
Box
<
Self
>
;
}
impl
Changer
for
X
{
fn
change
(
mut
~
self
)
->
Box
<
X
>
{
fn
change
(
mut
self
:
Box
<
X
>
)
->
Box
<
X
>
{
self
.a
=
55
;
self
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录