Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
4ae99cc8
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,发现更多精彩内容 >>
提交
4ae99cc8
编写于
12月 19, 2020
作者:
Y
Yuki Okushi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix ICE when pointing at multi bytes character
上级
d107a87d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
66 addition
and
21 deletion
+66
-21
compiler/rustc_parse/src/parser/mod.rs
compiler/rustc_parse/src/parser/mod.rs
+1
-5
src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs
...est/ui/parser/multibyte-char-use-seperator-issue-80134.rs
+12
-0
src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr
...ui/parser/multibyte-char-use-seperator-issue-80134.stderr
+52
-0
src/test/ui/similar-tokens.fixed
src/test/ui/similar-tokens.fixed
+0
-13
src/test/ui/similar-tokens.rs
src/test/ui/similar-tokens.rs
+0
-2
src/test/ui/similar-tokens.stderr
src/test/ui/similar-tokens.stderr
+1
-1
未找到文件。
compiler/rustc_parse/src/parser/mod.rs
浏览文件 @
4ae99cc8
...
...
@@ -721,13 +721,9 @@ fn parse_seq_to_before_tokens<T>(
Ok
(
t
)
=>
{
// Parsed successfully, therefore most probably the code only
// misses a separator.
let
mut
exp_span
=
self
.sess
.source_map
()
.next_point
(
sp
);
if
self
.sess
.source_map
()
.is_multiline
(
exp_span
)
{
exp_span
=
sp
;
}
expect_err
.span_suggestion_short
(
exp_span
,
sp
,
&
format!
(
"missing `{}`"
,
token_str
),
token_str
,
Applicability
::
MaybeIncorrect
,
...
...
src/test/ui/parser/multibyte-char-use-seperator-issue-80134.rs
0 → 100644
浏览文件 @
4ae99cc8
// Regression test for #80134.
fn
main
()
{
(()
é
);
//~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator
//~| ERROR: cannot find value `é` in this scope
//~| ERROR: non-ascii idents are not fully supported
(()
氷
);
//~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator
//~| ERROR: cannot find value `氷` in this scope
//~| ERROR: non-ascii idents are not fully supported
}
src/test/ui/parser/multibyte-char-use-seperator-issue-80134.stderr
0 → 100644
浏览文件 @
4ae99cc8
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `é`
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:4:8
|
LL | (()é);
| ^
| |
| expected one of `)`, `,`, `.`, `?`, or an operator
| help: missing `,`
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `氷`
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8
|
LL | (()氷);
| -^
| |
| expected one of `)`, `,`, `.`, `?`, or an operator
| help: missing `,`
error[E0425]: cannot find value `é` in this scope
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:4:8
|
LL | (()é);
| ^ not found in this scope
error[E0425]: cannot find value `氷` in this scope
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8
|
LL | (()氷);
| ^^ not found in this scope
error[E0658]: non-ascii idents are not fully supported
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:4:8
|
LL | (()é);
| ^
|
= note: see issue #55467 <https://github.com/rust-lang/rust/issues/55467> for more information
= help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable
error[E0658]: non-ascii idents are not fully supported
--> $DIR/multibyte-char-use-seperator-issue-80134.rs:8:8
|
LL | (()氷);
| ^^
|
= note: see issue #55467 <https://github.com/rust-lang/rust/issues/55467> for more information
= help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0425, E0658.
For more information about an error, try `rustc --explain E0425`.
src/test/ui/similar-tokens.fixed
已删除
100644 → 0
浏览文件 @
d107a87d
// run-rustfix
#![allow(unused_imports)]
pub mod x {
pub struct A;
pub struct B;
}
// `.` is similar to `,` so list parsing should continue to closing `}`
use x::{A, B}; //~ ERROR expected one of `,`, `::`, `as`, or `}`, found `.`
fn main() {}
src/test/ui/similar-tokens.rs
浏览文件 @
4ae99cc8
// run-rustfix
#![allow(unused_imports)]
pub
mod
x
{
...
...
src/test/ui/similar-tokens.stderr
浏览文件 @
4ae99cc8
error: expected one of `,`, `::`, `as`, or `}`, found `.`
--> $DIR/similar-tokens.rs:
11
:10
--> $DIR/similar-tokens.rs:
9
:10
|
LL | use x::{A. B};
| ^
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录