Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
b24902ea
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,发现更多精彩内容 >>
提交
b24902ea
编写于
3月 12, 2021
作者:
Ö
Ömer Sinan Ağacan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Run analyses before thir-tree dumps
Fixes #83048
上级
77b996e1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
24 deletion
+45
-24
compiler/rustc_driver/src/pretty.rs
compiler/rustc_driver/src/pretty.rs
+30
-23
compiler/rustc_session/src/config.rs
compiler/rustc_session/src/config.rs
+1
-1
src/test/ui/issues/issue-83048.rs
src/test/ui/issues/issue-83048.rs
+5
-0
src/test/ui/issues/issue-83048.stderr
src/test/ui/issues/issue-83048.stderr
+9
-0
未找到文件。
compiler/rustc_driver/src/pretty.rs
浏览文件 @
b24902ea
...
...
@@ -471,21 +471,6 @@ pub fn print_after_hir_lowering<'tcx>(
format!
(
"{:#?}"
,
krate
)
}),
ThirTree
=>
{
let
mut
out
=
String
::
new
();
abort_on_err
(
rustc_typeck
::
check_crate
(
tcx
),
tcx
.sess
);
debug!
(
"pretty printing THIR tree"
);
for
did
in
tcx
.body_owners
()
{
let
hir
=
tcx
.hir
();
let
body
=
hir
.body
(
hir
.body_owned_by
(
hir
.local_def_id_to_hir_id
(
did
)));
let
arena
=
thir
::
Arena
::
default
();
let
thir
=
thir
::
build_thir
(
tcx
,
ty
::
WithOptConstParam
::
unknown
(
did
),
&
arena
,
&
body
.value
);
let
_
=
writeln!
(
out
,
"{:?}:
\n
{:#?}
\n
"
,
did
,
thir
);
}
out
}
_
=>
unreachable!
(),
};
...
...
@@ -501,18 +486,40 @@ fn print_with_analysis(
ppm
:
PpMode
,
ofile
:
Option
<&
Path
>
,
)
->
Result
<
(),
ErrorReported
>
{
let
mut
out
=
Vec
::
new
();
tcx
.analysis
(
LOCAL_CRATE
)
?
;
match
ppm
{
Mir
=>
write_mir_pretty
(
tcx
,
None
,
&
mut
out
)
.unwrap
(),
MirCFG
=>
write_mir_graphviz
(
tcx
,
None
,
&
mut
out
)
.unwrap
(),
let
out
=
match
ppm
{
Mir
=>
{
let
mut
out
=
Vec
::
new
();
write_mir_pretty
(
tcx
,
None
,
&
mut
out
)
.unwrap
();
String
::
from_utf8
(
out
)
.unwrap
()
}
MirCFG
=>
{
let
mut
out
=
Vec
::
new
();
write_mir_graphviz
(
tcx
,
None
,
&
mut
out
)
.unwrap
();
String
::
from_utf8
(
out
)
.unwrap
()
}
ThirTree
=>
{
let
mut
out
=
String
::
new
();
abort_on_err
(
rustc_typeck
::
check_crate
(
tcx
),
tcx
.sess
);
debug!
(
"pretty printing THIR tree"
);
for
did
in
tcx
.body_owners
()
{
let
hir
=
tcx
.hir
();
let
body
=
hir
.body
(
hir
.body_owned_by
(
hir
.local_def_id_to_hir_id
(
did
)));
let
arena
=
thir
::
Arena
::
default
();
let
thir
=
thir
::
build_thir
(
tcx
,
ty
::
WithOptConstParam
::
unknown
(
did
),
&
arena
,
&
body
.value
);
let
_
=
writeln!
(
out
,
"{:?}:
\n
{:#?}
\n
"
,
did
,
thir
);
}
out
}
_
=>
unreachable!
(),
}
}
;
let
out
=
std
::
str
::
from_utf8
(
&
out
)
.unwrap
();
write_or_print
(
out
,
ofile
);
write_or_print
(
&
out
,
ofile
);
Ok
(())
}
compiler/rustc_session/src/config.rs
浏览文件 @
b24902ea
...
...
@@ -2293,7 +2293,7 @@ pub fn needs_ast_map(&self) -> bool {
pub
fn
needs_analysis
(
&
self
)
->
bool
{
use
PpMode
::
*
;
matches!
(
*
self
,
Mir
|
MirCFG
)
matches!
(
*
self
,
Mir
|
MirCFG
|
ThirTree
)
}
}
...
...
src/test/ui/issues/issue-83048.rs
0 → 100644
浏览文件 @
b24902ea
// compile-flags: -Z unpretty=thir-tree
pub
fn
main
()
{
break
;
//~ ERROR: `break` outside of a loop [E0268]
}
src/test/ui/issues/issue-83048.stderr
0 → 100644
浏览文件 @
b24902ea
error[E0268]: `break` outside of a loop
--> $DIR/issue-83048.rs:4:5
|
LL | break;
| ^^^^^ cannot `break` outside of a loop
error: aborting due to previous error
For more information about this error, try `rustc --explain E0268`.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录