Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
ce7b8037
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,发现更多精彩内容 >>
提交
ce7b8037
编写于
6月 22, 2012
作者:
L
Lindsey Kuper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor capitalization/punctuation fixes in error messages
上级
46809f7a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
20 deletion
+21
-20
src/rustc/middle/typeck/check.rs
src/rustc/middle/typeck/check.rs
+17
-16
src/test/compile-fail/issue-1763.rs
src/test/compile-fail/issue-1763.rs
+1
-1
src/test/compile-fail/issue-2509-a.rs
src/test/compile-fail/issue-2509-a.rs
+1
-1
src/test/compile-fail/ret-non-nil.rs
src/test/compile-fail/ret-non-nil.rs
+1
-1
src/test/compile-fail/vec-field.rs
src/test/compile-fail/vec-field.rs
+1
-1
未找到文件。
src/rustc/middle/typeck/check.rs
浏览文件 @
ce7b8037
...
...
@@ -385,7 +385,7 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
// Check that there's at least one field
let
(
fields
,
_
)
=
split_class_items
(
members
);
if
fields
.len
()
<
1u
{
ccx
.tcx.sess
.span_err
(
it
.span
,
"
A
class must have at least one
\
ccx
.tcx.sess
.span_err
(
it
.span
,
"
a
class must have at least one
\
field"
);
}
// Check that the class is instantiable
...
...
@@ -942,7 +942,7 @@ fn check_binop(fcx: @fn_ctxt, expr: @ast::expr,
// separate case below.
tcx
.sess
.span_bug
(
expr
.span
,
#
fmt
[
"
C
omparison operator in expr_binop: %s"
,
#
fmt
[
"
c
omparison operator in expr_binop: %s"
,
ast_util
::
binop_to_str
(
op
)]);
}
_
{
lhs_t
}
...
...
@@ -1221,7 +1221,7 @@ fn check_expr_fn(fcx: @fn_ctxt,
result
::
ok
(
_
)
{
/* fall through */
}
result
::
err
(
_
)
{
tcx
.sess
.span_err
(
expr
.span
,
"
ret;
in function returning non-nil"
);
}
"
`ret;`
in function returning non-nil"
);
}
}
}
some
(
e
)
{
check_expr_with
(
fcx
,
e
,
ret_ty
);
}
...
...
@@ -1303,7 +1303,7 @@ fn check_expr_fn(fcx: @fn_ctxt,
result
::
ok
(
_
)
{}
result
::
err
(
err
)
{
tcx
.sess
.span_fatal
(
expr
.span
,
#
fmt
(
"a
loop
function's last argument
\
expr
.span
,
#
fmt
(
"a
`loop`
function's last argument
\
should return `bool`, not `%s`"
,
fcx
.infcx
.ty_to_str
(
fty
.output
)));
}
...
...
@@ -1311,8 +1311,9 @@ fn check_expr_fn(fcx: @fn_ctxt,
(
ty
::
mk_fn
(
tcx
,
{
output
:
ty
::
mk_nil
(
tcx
)
with
fty
}),
fty
.proto
)
}
_
{
tcx
.sess
.span_fatal
(
expr
.span
,
"a loop function's last argument
\
should be of function type"
);
tcx
.sess
.span_fatal
(
expr
.span
,
"a `loop` function's last
\
argument should be of function
\
type"
);
}
};
alt
check
b
.node
{
...
...
@@ -1338,7 +1339,7 @@ fn check_expr_fn(fcx: @fn_ctxt,
(
ty
::
mk_fn
(
tcx
,
fty
),
fty
.proto
)
}
_
{
tcx
.sess
.span_fatal
(
expr
.span
,
"a
do
function's last argument
\
tcx
.sess
.span_fatal
(
expr
.span
,
"a
`do`
function's last argument
\
should be of function type"
);
}
};
...
...
@@ -1786,8 +1787,8 @@ fn check_instantiable(tcx: ty::ctxt,
let
rty
=
ty
::
node_id_to_type
(
tcx
,
item_id
);
if
!
ty
::
is_instantiable
(
tcx
,
rty
)
{
tcx
.sess
.span_err
(
sp
,
#
fmt
[
"this type cannot be instantiated
\
without an instance of itself
.
\
Consider using option<%s>.
"
,
without an instance of itself
;
\
consider using `option<%s>`
"
,
ty_to_str
(
tcx
,
rty
)]);
}
}
...
...
@@ -1826,7 +1827,7 @@ fn check_enum_variants(ccx: @crate_ctxt,
}
if
vec
::
contains
(
disr_vals
,
disr_val
)
{
ccx
.tcx.sess
.span_err
(
v
.span
,
"discriminator value already exists
.
"
);
"discriminator value already exists"
);
}
disr_vals
+=
[
disr_val
];
let
ctor_ty
=
ty
::
node_id_to_type
(
ccx
.tcx
,
v
.node.id
);
...
...
@@ -1853,7 +1854,7 @@ fn check_enum_variants(ccx: @crate_ctxt,
_
{
false
}
}
})
{
ccx
.tcx.sess
.span_err
(
sp
,
"illegal recursive enum type
.
\
ccx
.tcx.sess
.span_err
(
sp
,
"illegal recursive enum type
;
\
wrap the inner value in a box to
\
make it representable"
);
}
...
...
@@ -2200,13 +2201,13 @@ fn check_bounds_are_used(ccx: @crate_ctxt,
if
!
r_used
{
ccx
.tcx.sess
.span_err
(
span
,
"lifetime `self` unused inside
\
reference-parameterized type
.
"
);
reference-parameterized type"
);
}
for
tps_used
.eachi
{
|
i
,
b
|
if
!
b
{
ccx
.tcx.sess
.span_err
(
span
,
#
fmt
[
"
Type parameter %s is unused.
"
,
*
tps
[
i
]
.ident
]);
span
,
#
fmt
[
"
type parameter `%s` is unused
"
,
*
tps
[
i
]
.ident
]);
}
}
}
...
...
@@ -2273,13 +2274,13 @@ fn arg(m: ast::rmode, ty: ty::t) -> ty::arg {
let
i_n_tps
=
(
*
i_ty
.bounds
)
.len
();
if
i_n_tps
!=
n_tps
{
tcx
.sess
.span_err
(
it
.span
,
#
fmt
(
"intrinsic has wrong number
\
of type parameters
.
found %u,
\
of type parameters
:
found %u,
\
expected %u"
,
i_n_tps
,
n_tps
));
}
else
{
require_same_types
(
tcx
,
none
,
it
.span
,
i_ty
.ty
,
fty
,
{||
#
fmt
[
"intrinsic has wrong type
.
\
expected
%s
"
,
{||
#
fmt
[
"intrinsic has wrong type
:
\
expected
`%s`
"
,
ty_to_str
(
ccx
.tcx
,
fty
)]});
}
}
src/test/compile-fail/issue-1763.rs
浏览文件 @
ce7b8037
// Issue #1763 - infer types correctly
type
actor
<
T
>
=
{
//! ERROR
Type parameter T is unused.
type
actor
<
T
>
=
{
//! ERROR
type parameter `T` is unused
unused
:
bool
};
...
...
src/test/compile-fail/issue-2509-a.rs
浏览文件 @
ce7b8037
class
c
{
//! ERROR
A
class must have at least one field
class
c
{
//! ERROR
a
class must have at least one field
new
()
{
}
}
...
...
src/test/compile-fail/ret-non-nil.rs
浏览文件 @
ce7b8037
// error-pattern:
ret;
in function returning non-nil
// error-pattern:
`ret;`
in function returning non-nil
fn
f
()
{
ret
;
}
...
...
src/test/compile-fail/vec-field.rs
浏览文件 @
ce7b8037
// error-pattern:attempted access of field `some_field_name` on type `[int]`
// error-pattern:attempted access of field `some_field_name` on type `[int]
/~
`
// issue #367
fn
f
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录