Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e09fc037
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,发现更多精彩内容 >>
提交
e09fc037
编写于
10月 17, 2014
作者:
N
Niko Matsakis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Various minor cases where errors are reported in slightly different ways.
上级
7f8ca536
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
12 deletion
+19
-12
src/test/compile-fail/issue-7575.rs
src/test/compile-fail/issue-7575.rs
+13
-6
src/test/compile-fail/selftype-traittype.rs
src/test/compile-fail/selftype-traittype.rs
+1
-1
src/test/compile-fail/unique-pinned-nocopy.rs
src/test/compile-fail/unique-pinned-nocopy.rs
+1
-1
src/test/compile-fail/unique-vec-res.rs
src/test/compile-fail/unique-vec-res.rs
+2
-2
src/test/compile-fail/vec-res-add.rs
src/test/compile-fail/vec-res-add.rs
+2
-2
未找到文件。
src/test/compile-fail/issue-7575.rs
浏览文件 @
e09fc037
...
...
@@ -8,17 +8,24 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test the mechanism for warning about possible missing `self` declarations.
trait
CtxtFn
{
fn
f8
(
self
,
uint
)
->
uint
;
fn
f9
(
uint
)
->
uint
;
//~ NOTE candidate
#
fn
f9
(
uint
)
->
uint
;
//~ NOTE candidate
}
trait
OtherTrait
{
fn
f9
(
uint
)
->
uint
;
//~ NOTE candidate
#
fn
f9
(
uint
)
->
uint
;
//~ NOTE candidate
}
trait
UnusedTrait
{
// This should never show up as a candidate
fn
f9
(
uint
)
->
uint
;
// Note: this trait is not implemented, but we can't really tell
// whether or not an impl would match anyhow without a self
// declaration to match against, so we wind up printing it as a
// candidate. This seems not unreasonable -- perhaps the user meant to
// implement it, after all.
trait
UnusedTrait
{
fn
f9
(
uint
)
->
uint
;
//~ NOTE candidate
}
impl
CtxtFn
for
uint
{
...
...
@@ -40,13 +47,13 @@ fn f9(i: uint) -> uint {
struct
MyInt
(
int
);
impl
MyInt
{
fn
fff
(
i
:
int
)
->
int
{
//~ NOTE candidate
#1 is `MyInt::fff`
fn
fff
(
i
:
int
)
->
int
{
//~ NOTE candidate
i
}
}
trait
ManyImplTrait
{
fn
is_str
()
->
bool
{
//~ NOTE candidate
#1 is
fn
is_str
()
->
bool
{
//~ NOTE candidate
false
}
}
...
...
src/test/compile-fail/selftype-traittype.rs
浏览文件 @
e09fc037
...
...
@@ -14,7 +14,7 @@ trait add {
}
fn
do_add
(
x
:
Box
<
add
+
'static
>
,
y
:
Box
<
add
+
'static
>
)
->
Box
<
add
+
'static
>
{
x
.plus
(
y
)
//~ ERROR
cannot call a method whose type contains a self-type through an object
x
.plus
(
y
)
//~ ERROR
E0038
}
fn
main
()
{}
src/test/compile-fail/unique-pinned-nocopy.rs
浏览文件 @
e09fc037
...
...
@@ -19,6 +19,6 @@ fn drop(&mut self) {}
fn
main
()
{
let
i
=
box
r
{
b
:
true
};
let
_
j
=
i
.clone
();
//~ ERROR not implement
ed
let
_
j
=
i
.clone
();
//~ ERROR not implement
println!
(
"{}"
,
i
);
}
src/test/compile-fail/unique-vec-res.rs
浏览文件 @
e09fc037
...
...
@@ -35,8 +35,8 @@ fn main() {
let
r1
=
vec!
(
box
r
{
i
:
i1
});
let
r2
=
vec!
(
box
r
{
i
:
i2
});
f
(
r1
.clone
(),
r2
.clone
());
//~^ ERROR
the trait `core::clone::Clone` is not implemented
//~^^ ERROR
the trait `core::clone::Clone` is not implemented
//~^ ERROR
does not implement any method in scope named `clone`
//~^^ ERROR
does not implement any method in scope named `clone`
println!
(
"{}"
,
(
r2
,
i1
.get
()));
println!
(
"{}"
,
(
r1
,
i2
.get
()));
}
src/test/compile-fail/vec-res-add.rs
浏览文件 @
e09fc037
...
...
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Show)]
struct
r
{
i
:
int
}
...
...
@@ -23,7 +24,6 @@ fn main() {
let
i
=
vec!
(
r
(
0
));
let
j
=
vec!
(
r
(
1
));
let
k
=
i
+
j
;
//~^ ERROR
not implemented
//~^ ERROR
binary operation `+` cannot be applied to type
println!
(
"{}"
,
j
);
//~^ ERROR not implemented
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录