Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
057bc7d6
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,发现更多精彩内容 >>
提交
057bc7d6
编写于
10月 07, 2017
作者:
C
clippered
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #44968 Windows path in UI tests
上级
264aafe0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
4 deletion
+9
-4
src/test/ui/lint/unused_parens_json_suggestion.rs
src/test/ui/lint/unused_parens_json_suggestion.rs
+0
-2
src/test/ui/lint/unused_parens_json_suggestion.stderr
src/test/ui/lint/unused_parens_json_suggestion.stderr
+1
-1
src/tools/compiletest/src/runtest.rs
src/tools/compiletest/src/runtest.rs
+8
-1
未找到文件。
src/test/ui/lint/unused_parens_json_suggestion.rs
浏览文件 @
057bc7d6
...
@@ -10,8 +10,6 @@
...
@@ -10,8 +10,6 @@
// compile-flags: --error-format json
// compile-flags: --error-format json
// ignore-windows (see Issue #44968)
// The output for humans should just highlight the whole span without showing
// The output for humans should just highlight the whole span without showing
// the suggested replacement, but we also want to test that suggested
// the suggested replacement, but we also want to test that suggested
// replacement only removes one set of parentheses, rather than naïvely
// replacement only removes one set of parentheses, rather than naïvely
...
...
src/test/ui/lint/unused_parens_json_suggestion.stderr
浏览文件 @
057bc7d6
{"message":"unnecessary parentheses around assigned value","code":null,"level":"warning","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":
1014,"byte_end":1027,"line_start":24,"line_end":24,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(unused_parens)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":1014,"byte_end":1027,"line_start":24,"line_end":24
,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":"1 / (2 + 3)","expansion":null}],"children":[],"rendered":" let _a = 1 / (2 + 3);"}],"rendered":null}
{"message":"unnecessary parentheses around assigned value","code":null,"level":"warning","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":
976,"byte_end":989,"line_start":22,"line_end":22,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"#[warn(unused_parens)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove these parentheses","code":null,"level":"help","spans":[{"file_name":"$DIR/unused_parens_json_suggestion.rs","byte_start":976,"byte_end":989,"line_start":22,"line_end":22
,"column_start":14,"column_end":27,"is_primary":true,"text":[{"text":" let _a = (1 / (2 + 3));","highlight_start":14,"highlight_end":27}],"label":null,"suggested_replacement":"1 / (2 + 3)","expansion":null}],"children":[],"rendered":" let _a = 1 / (2 + 3);"}],"rendered":null}
src/tools/compiletest/src/runtest.rs
浏览文件 @
057bc7d6
...
@@ -2325,8 +2325,15 @@ fn get_mir_dump_dir(&self) -> PathBuf {
...
@@ -2325,8 +2325,15 @@ fn get_mir_dump_dir(&self) -> PathBuf {
fn
normalize_output
(
&
self
,
output
:
&
str
,
custom_rules
:
&
[(
String
,
String
)])
->
String
{
fn
normalize_output
(
&
self
,
output
:
&
str
,
custom_rules
:
&
[(
String
,
String
)])
->
String
{
let
parent_dir
=
self
.testpaths.file
.parent
()
.unwrap
();
let
parent_dir
=
self
.testpaths.file
.parent
()
.unwrap
();
let
parent_dir_str
=
parent_dir
.display
()
.to_string
();
let
cflags
=
self
.props.compile_flags
.join
(
" "
);
let
parent_dir_str
=
if
cflags
.contains
(
"--error-format json"
)
{
parent_dir
.display
()
.to_string
()
.replace
(
"
\\
"
,
"
\\\\
"
)
}
else
{
parent_dir
.display
()
.to_string
()
};
let
mut
normalized
=
output
.replace
(
&
parent_dir_str
,
"$DIR"
)
let
mut
normalized
=
output
.replace
(
&
parent_dir_str
,
"$DIR"
)
.replace
(
"
\\\\
"
,
"
\\
"
)
// denormalize for paths on windows
.replace
(
"
\\
"
,
"/"
)
// normalize for paths on windows
.replace
(
"
\\
"
,
"/"
)
// normalize for paths on windows
.replace
(
"
\r\n
"
,
"
\n
"
)
// normalize for linebreaks on windows
.replace
(
"
\r\n
"
,
"
\n
"
)
// normalize for linebreaks on windows
.replace
(
"
\t
"
,
"
\\
t"
);
// makes tabs visible
.replace
(
"
\t
"
,
"
\\
t"
);
// makes tabs visible
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录