Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
694f76d5
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,发现更多精彩内容 >>
提交
694f76d5
编写于
5月 18, 2019
作者:
V
Vadim Petrochenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
syntax: More consistent wording for some literal parsing errors
上级
fcc2f92f
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
20 addition
and
20 deletion
+20
-20
src/libsyntax/parse/literal.rs
src/libsyntax/parse/literal.rs
+2
-2
src/test/ui/old-suffixes-are-really-forbidden.stderr
src/test/ui/old-suffixes-are-really-forbidden.stderr
+2
-2
src/test/ui/parser/bad-lit-suffixes.rs
src/test/ui/parser/bad-lit-suffixes.rs
+2
-2
src/test/ui/parser/bad-lit-suffixes.stderr
src/test/ui/parser/bad-lit-suffixes.stderr
+2
-2
src/test/ui/parser/int-literal-too-large-span.rs
src/test/ui/parser/int-literal-too-large-span.rs
+1
-1
src/test/ui/parser/int-literal-too-large-span.stderr
src/test/ui/parser/int-literal-too-large-span.stderr
+1
-1
src/test/ui/parser/issue-5544-a.rs
src/test/ui/parser/issue-5544-a.rs
+1
-1
src/test/ui/parser/issue-5544-a.stderr
src/test/ui/parser/issue-5544-a.stderr
+1
-1
src/test/ui/parser/issue-5544-b.rs
src/test/ui/parser/issue-5544-b.rs
+1
-1
src/test/ui/parser/issue-5544-b.stderr
src/test/ui/parser/issue-5544-b.stderr
+1
-1
src/test/ui/parser/lex-bad-numeric-literals.rs
src/test/ui/parser/lex-bad-numeric-literals.rs
+2
-2
src/test/ui/parser/lex-bad-numeric-literals.stderr
src/test/ui/parser/lex-bad-numeric-literals.stderr
+2
-2
src/test/ui/parser/no-binary-float-literal.rs
src/test/ui/parser/no-binary-float-literal.rs
+1
-1
src/test/ui/parser/no-binary-float-literal.stderr
src/test/ui/parser/no-binary-float-literal.stderr
+1
-1
未找到文件。
src/libsyntax/parse/literal.rs
浏览文件 @
694f76d5
...
...
@@ -42,7 +42,7 @@ impl LitError {
.help
(
"valid widths are 8, 16, 32, 64 and 128"
)
.emit
();
}
else
{
let
msg
=
format!
(
"invalid suffix `{}` for
numeric
literal"
,
suf
);
let
msg
=
format!
(
"invalid suffix `{}` for
integer
literal"
,
suf
);
diag
.struct_span_err
(
span
,
&
msg
)
.span_label
(
span
,
format!
(
"invalid suffix `{}`"
,
suf
))
.help
(
"the suffix must be one of the integral types (`u32`, `isize`, etc)"
)
...
...
@@ -71,7 +71,7 @@ impl LitError {
.emit
();
}
LitError
::
IntTooLarge
=>
{
diag
.struct_span_err
(
span
,
"int literal is too large"
)
diag
.struct_span_err
(
span
,
"int
eger
literal is too large"
)
.emit
();
}
}
...
...
src/test/ui/old-suffixes-are-really-forbidden.stderr
浏览文件 @
694f76d5
error: invalid suffix `is` for
numeric
literal
error: invalid suffix `is` for
integer
literal
--> $DIR/old-suffixes-are-really-forbidden.rs:2:13
|
LL | let a = 1_is;
...
...
@@ -6,7 +6,7 @@ LL | let a = 1_is;
|
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
error: invalid suffix `us` for
numeric
literal
error: invalid suffix `us` for
integer
literal
--> $DIR/old-suffixes-are-really-forbidden.rs:3:13
|
LL | let b = 2_us;
...
...
src/test/ui/parser/bad-lit-suffixes.rs
浏览文件 @
694f76d5
...
...
@@ -22,8 +22,8 @@ fn main() {
1234
f1024
;
//~ ERROR invalid width `1024` for float literal
1234.5
f1024
;
//~ ERROR invalid width `1024` for float literal
1234
suffix
;
//~ ERROR invalid suffix `suffix` for
numeric
literal
0b101
suffix
;
//~ ERROR invalid suffix `suffix` for
numeric
literal
1234
suffix
;
//~ ERROR invalid suffix `suffix` for
integer
literal
0b101
suffix
;
//~ ERROR invalid suffix `suffix` for
integer
literal
1.0
suffix
;
//~ ERROR invalid suffix `suffix` for float literal
1.0e10
suffix
;
//~ ERROR invalid suffix `suffix` for float literal
}
src/test/ui/parser/bad-lit-suffixes.stderr
浏览文件 @
694f76d5
...
...
@@ -78,7 +78,7 @@ LL | 1234.5f1024;
|
= help: valid widths are 32 and 64
error: invalid suffix `suffix` for
numeric
literal
error: invalid suffix `suffix` for
integer
literal
--> $DIR/bad-lit-suffixes.rs:25:5
|
LL | 1234suffix;
...
...
@@ -86,7 +86,7 @@ LL | 1234suffix;
|
= help: the suffix must be one of the integral types (`u32`, `isize`, etc)
error: invalid suffix `suffix` for
numeric
literal
error: invalid suffix `suffix` for
integer
literal
--> $DIR/bad-lit-suffixes.rs:26:5
|
LL | 0b101suffix;
...
...
src/test/ui/parser/int-literal-too-large-span.rs
浏览文件 @
694f76d5
...
...
@@ -2,6 +2,6 @@
fn
main
()
{
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
//~^ ERROR int literal is too large
//~^ ERROR int
eger
literal is too large
;
// the span shouldn't point to this.
}
src/test/ui/parser/int-literal-too-large-span.stderr
浏览文件 @
694f76d5
error: int literal is too large
error: int
eger
literal is too large
--> $DIR/int-literal-too-large-span.rs:4:5
|
LL | 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
...
...
src/test/ui/parser/issue-5544-a.rs
浏览文件 @
694f76d5
fn
main
()
{
let
__
isize
=
340282366920938463463374607431768211456
;
// 2^128
//~^ ERROR int literal is too large
//~^ ERROR int
eger
literal is too large
}
src/test/ui/parser/issue-5544-a.stderr
浏览文件 @
694f76d5
error: int literal is too large
error: int
eger
literal is too large
--> $DIR/issue-5544-a.rs:2:19
|
LL | let __isize = 340282366920938463463374607431768211456; // 2^128
...
...
src/test/ui/parser/issue-5544-b.rs
浏览文件 @
694f76d5
fn
main
()
{
let
__
isize
=
0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff
;
//~^ ERROR int literal is too large
//~^ ERROR int
eger
literal is too large
}
src/test/ui/parser/issue-5544-b.stderr
浏览文件 @
694f76d5
error: int literal is too large
error: int
eger
literal is too large
--> $DIR/issue-5544-b.rs:2:19
|
LL | let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
...
...
src/test/ui/parser/lex-bad-numeric-literals.rs
浏览文件 @
694f76d5
...
...
@@ -13,8 +13,8 @@ fn main() {
0
o
;
//~ ERROR: no valid digits
1
e
+
;
//~ ERROR: expected at least one digit in exponent
0x539
.0
;
//~ ERROR: hexadecimal float literal is not supported
9900000000000000000000000000999999999999999999999999999999
;
//~ ERROR: int literal is too large
9900000000000000000000000000999999999999999999999999999999
;
//~ ERROR: int literal is too large
9900000000000000000000000000999999999999999999999999999999
;
//~ ERROR: int
eger
literal is too large
9900000000000000000000000000999999999999999999999999999999
;
//~ ERROR: int
eger
literal is too large
0
x
;
//~ ERROR: no valid digits
0
xu32
;
//~ ERROR: no valid digits
0
ou32
;
//~ ERROR: no valid digits
...
...
src/test/ui/parser/lex-bad-numeric-literals.stderr
浏览文件 @
694f76d5
...
...
@@ -112,13 +112,13 @@ error: octal float literal is not supported
LL | 0o2f32;
| ^^^^^^ not supported
error: int literal is too large
error: int
eger
literal is too large
--> $DIR/lex-bad-numeric-literals.rs:16:5
|
LL | 9900000000000000000000000000999999999999999999999999999999;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: int literal is too large
error: int
eger
literal is too large
--> $DIR/lex-bad-numeric-literals.rs:17:5
|
LL | 9900000000000000000000000000999999999999999999999999999999;
...
...
src/test/ui/parser/no-binary-float-literal.rs
浏览文件 @
694f76d5
...
...
@@ -4,5 +4,5 @@ fn main() {
0b101
.010
;
//~^ ERROR binary float literal is not supported
0b101
p4f64
;
//~^ ERROR invalid suffix `p4f64` for
numeric
literal
//~^ ERROR invalid suffix `p4f64` for
integer
literal
}
src/test/ui/parser/no-binary-float-literal.stderr
浏览文件 @
694f76d5
...
...
@@ -10,7 +10,7 @@ error: binary float literal is not supported
LL | 0b101010f64;
| ^^^^^^^^^^^ not supported
error: invalid suffix `p4f64` for
numeric
literal
error: invalid suffix `p4f64` for
integer
literal
--> $DIR/no-binary-float-literal.rs:6:5
|
LL | 0b101p4f64;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录