Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
7f523e72
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,发现更多精彩内容 >>
提交
7f523e72
编写于
10月 24, 2014
作者:
J
Jakub Bukaj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update tests with the new error messages
上级
cca84e9e
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
45 addition
and
33 deletion
+45
-33
src/test/compile-fail/bad-bang-ann-3.rs
src/test/compile-fail/bad-bang-ann-3.rs
+1
-2
src/test/compile-fail/bad-bang-ann.rs
src/test/compile-fail/bad-bang-ann.rs
+1
-2
src/test/compile-fail/bang-tailexpr.rs
src/test/compile-fail/bang-tailexpr.rs
+2
-2
src/test/compile-fail/binop-fail-3.rs
src/test/compile-fail/binop-fail-3.rs
+5
-2
src/test/compile-fail/closure-that-fails.rs
src/test/compile-fail/closure-that-fails.rs
+3
-3
src/test/compile-fail/index-bot.rs
src/test/compile-fail/index-bot.rs
+1
-1
src/test/compile-fail/issue-13847.rs
src/test/compile-fail/issue-13847.rs
+1
-1
src/test/compile-fail/issue-15207.rs
src/test/compile-fail/issue-15207.rs
+5
-1
src/test/compile-fail/issue-15965.rs
src/test/compile-fail/issue-15965.rs
+6
-1
src/test/compile-fail/issue-17373.rs
src/test/compile-fail/issue-17373.rs
+2
-1
src/test/compile-fail/issue-5100.rs
src/test/compile-fail/issue-5100.rs
+2
-2
src/test/compile-fail/issue-5500.rs
src/test/compile-fail/issue-5500.rs
+1
-2
src/test/compile-fail/issue-897-2.rs
src/test/compile-fail/issue-897-2.rs
+6
-2
src/test/compile-fail/issue-897.rs
src/test/compile-fail/issue-897.rs
+1
-3
src/test/compile-fail/liveness-bad-bang-2.rs
src/test/compile-fail/liveness-bad-bang-2.rs
+3
-2
src/test/compile-fail/loop-does-not-diverge.rs
src/test/compile-fail/loop-does-not-diverge.rs
+1
-1
src/test/compile-fail/lub-match.rs
src/test/compile-fail/lub-match.rs
+4
-2
src/test/run-pass/issue-13352.rs
src/test/run-pass/issue-13352.rs
+0
-1
src/test/run-pass/unreachable-code.rs
src/test/run-pass/unreachable-code.rs
+0
-2
未找到文件。
src/test/compile-fail/bad-bang-ann-3.rs
浏览文件 @
7f523e72
...
...
@@ -11,8 +11,7 @@
// Tests that a function with a ! annotation always actually fails
fn
bad_bang
(
i
:
uint
)
->
!
{
return
7u
;
//~^ ERROR expected `!`, found `uint`
return
7u
;
//~ ERROR `return` in a function declared as diverging [E0166]
}
fn
main
()
{
bad_bang
(
5u
);
}
src/test/compile-fail/bad-bang-ann.rs
浏览文件 @
7f523e72
...
...
@@ -10,9 +10,8 @@
// Tests that a function with a ! annotation always actually fails
fn
bad_bang
(
i
:
uint
)
->
!
{
fn
bad_bang
(
i
:
uint
)
->
!
{
//~ ERROR computation may converge in a function marked as diverging
if
i
<
0u
{
}
else
{
fail
!
();
}
//~^ ERROR expected `!`, found `()`
}
fn
main
()
{
bad_bang
(
5u
);
}
src/test/compile-fail/bang-tailexpr.rs
浏览文件 @
7f523e72
...
...
@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn
f
()
->
!
{
3
i
//~ ERROR expected `!`, found `int`
fn
f
()
->
!
{
//~ ERROR computation may converge in a function marked as diverging
3
i
}
fn
main
()
{
}
src/test/
run
-fail/binop-fail-3.rs
→
src/test/
compile
-fail/binop-fail-3.rs
浏览文件 @
7f523e72
...
...
@@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:quux
fn
foo
()
->
!
{
fail
!
(
"quux"
);
}
fn
main
()
{
foo
()
==
foo
();
}
fn
main
()
{
foo
()
//~ ERROR the type of this value must be known in this context
==
foo
();
}
src/test/compile-fail/closure-that-fails.rs
浏览文件 @
7f523e72
...
...
@@ -14,7 +14,7 @@ fn main() {
// Type inference didn't use to be able to handle this:
foo
(||
fail
!
());
foo
(||
->
!
fail
!
());
foo
(||
22
);
//~ ERROR mismatched types
foo
(||
->
!
22
);
//~ ERROR mismatched types
let
x
=
||
->
!
1
;
//~ ERROR mismatched types
foo
(||
22
i
);
//~ ERROR computation may converge in a function marked as diverging
foo
(||
->
!
22
i
);
//~ ERROR computation may converge in a function marked as diverging
let
x
=
||
->
!
1
i
;
//~ ERROR computation may converge in a function marked as diverging
}
src/test/compile-fail/index-bot.rs
浏览文件 @
7f523e72
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
(
return
)[
0u
];
//~ ERROR
cannot index a value of type `!`
(
return
)[
0u
];
//~ ERROR
the type of this value must be known in this context
}
src/test/compile-fail/issue-13847.rs
浏览文件 @
7f523e72
...
...
@@ -9,5 +9,5 @@
// except according to those terms.
fn
main
()
{
return
.is_failure
//~ ERROR
unconstrained type variable
return
.is_failure
//~ ERROR
the type of this value must be known in this context
}
src/test/compile-fail/issue-15207.rs
浏览文件 @
7f523e72
...
...
@@ -9,5 +9,9 @@
// except according to those terms.
fn
main
()
{
loop
{
break
.push
(
1
);
}
//~ ERROR type `!` does not implement any method in scope named `push`
loop
{
break
.push
(
1
)
//~ ERROR the type of this value must be known in this context
//~^ ERROR multiple applicable methods in scope
;
}
}
src/test/compile-fail/issue-15965.rs
浏览文件 @
7f523e72
...
...
@@ -9,5 +9,10 @@
// except according to those terms.
fn
main
()
{
return
{
return
()
}
();
//~ ERROR expected function, found `!`
return
{
return
()
}
//~ ERROR the type of this value must be known in this context
()
//~^ ERROR the type of this value must be known in this context
//~^^ ERROR notation; the first type parameter for the function trait is neither a tuple nor unit
//~^^^ ERROR overloaded calls are experimental
;
}
src/test/compile-fail/issue-17373.rs
浏览文件 @
7f523e72
...
...
@@ -9,5 +9,6 @@
// except according to those terms.
fn
main
()
{
*
return
;
//~ ERROR type `!` cannot be dereferenced
*
return
//~ ERROR the type of this value must be known in this context
;
}
src/test/compile-fail/issue-5100.rs
浏览文件 @
7f523e72
...
...
@@ -27,13 +27,13 @@ fn main() {
match
(
true
,
false
)
{
box
(
true
,
false
)
=>
()
//~^ ERROR mismatched types: expected `(bool,bool)`, found `Box<<generic #1
1
>>`
//~^ ERROR mismatched types: expected `(bool,bool)`, found `Box<<generic #1
5
>>`
// (expected tuple, found box)
}
match
(
true
,
false
)
{
&
(
true
,
false
)
=>
()
//~^ ERROR mismatched types: expected `(bool,bool)`, found `&<generic #
15
>`
//~^ ERROR mismatched types: expected `(bool,bool)`, found `&<generic #
21
>`
// (expected tuple, found &-ptr)
}
...
...
src/test/
run
-fail/issue-5500.rs
→
src/test/
compile
-fail/issue-5500.rs
浏览文件 @
7f523e72
...
...
@@ -8,8 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:explicit failure
fn
main
()
{
&
fail
!
()
//~^ ERROR mismatched types: expected `()`, found `&<generic #2>` (expected (), found &-ptr)
}
src/test/compile-fail/issue-897-2.rs
浏览文件 @
7f523e72
...
...
@@ -12,8 +12,12 @@
fn
g
()
->
!
{
fail
!
();
}
fn
f
()
->
!
{
return
g
();
g
();
//~ ERROR: unreachable statement
return
g
();
//~ ERROR `return` in a function declared as diverging
g
();
}
fn
h
()
->
!
{
loop
{}
g
();
}
fn
main
()
{
f
()
}
src/test/compile-fail/issue-897.rs
浏览文件 @
7f523e72
...
...
@@ -8,12 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: unreachable statement
#![deny(unreachable_code)]
fn
f
()
->
!
{
return
fail
!
();
return
fail
!
();
//~ ERROR `return` in a function declared as diverging
fail
!
();
// the unreachable statement error is in <std macro>, at this line, there
// only is a note
}
...
...
src/test/compile-fail/liveness-bad-bang-2.rs
浏览文件 @
7f523e72
...
...
@@ -9,8 +9,9 @@
// except according to those terms.
// Tests that a function with a ! annotation always actually fails
// error-pattern: some control paths may return
fn
bad_bang
(
i
:
uint
)
->
!
{
println!
(
"{}"
,
3
i
);
}
fn
bad_bang
(
i
:
uint
)
->
!
{
//~ ERROR computation may converge in a function marked as diverging
println!
(
"{}"
,
3
i
);
}
fn
main
()
{
bad_bang
(
5u
);
}
src/test/compile-fail/loop-does-not-diverge.rs
浏览文件 @
7f523e72
...
...
@@ -14,7 +14,7 @@ fn forever() -> ! {
loop
{
break
;
}
return
42
i
;
//~ ERROR
expected `!`, found `int`
return
42
i
;
//~ ERROR
`return` in a function declared as diverging
}
fn
main
()
{
...
...
src/test/compile-fail/lub-match.rs
浏览文件 @
7f523e72
...
...
@@ -33,7 +33,8 @@ pub fn opt_str1<'a>(maybestr: &'a Option<String>) -> &'a str {
}
pub
fn
opt_str2
<
'a
>
(
maybestr
:
&
'a
Option
<
String
>
)
->
&
'static
str
{
match
*
maybestr
{
//~ ERROR cannot infer an appropriate lifetime for automatic coercion due to
match
*
maybestr
{
//~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements
None
=>
"(none)"
,
Some
(
ref
s
)
=>
{
let
s
:
&
'a
str
=
s
.as_slice
();
...
...
@@ -43,7 +44,8 @@ pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str {
}
pub
fn
opt_str3
<
'a
>
(
maybestr
:
&
'a
Option
<
String
>
)
->
&
'static
str
{
match
*
maybestr
{
//~ ERROR cannot infer an appropriate lifetime for automatic coercion due to
match
*
maybestr
{
//~^ ERROR cannot infer an appropriate lifetime due to conflicting requirements
Some
(
ref
s
)
=>
{
let
s
:
&
'a
str
=
s
.as_slice
();
s
...
...
src/test/run-pass/issue-13352.rs
浏览文件 @
7f523e72
...
...
@@ -17,5 +17,4 @@ fn main() {
unsafe
{
libc
::
exit
(
0
as
libc
::
c_int
);
}
});
2u
+
(
loop
{});
-
(
loop
{});
}
src/test/run-pass/unreachable-code.rs
浏览文件 @
7f523e72
...
...
@@ -23,8 +23,6 @@ fn call_id() {
fn
call_id_3
()
{
id
(
return
)
&&
id
(
return
);
}
fn
ret_ret
()
->
int
{
return
(
return
2
i
)
+
3
i
;
}
fn
ret_guard
()
{
match
2
i
{
x
if
(
return
)
=>
{
x
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录