Use real try blocks
This commit is contained in:
parent
7815c9b1c8
commit
d2514523db
3 changed files with 5 additions and 12 deletions
|
@ -254,14 +254,14 @@ fn dump_mir_results<'a, 'gcx, 'tcx>(
|
|||
);
|
||||
|
||||
// Also dump the inference graph constraints as a graphviz file.
|
||||
let _: io::Result<()> = try_block! {
|
||||
let _: io::Result<()> = try {
|
||||
let mut file =
|
||||
pretty::create_dump_file(infcx.tcx, "regioncx.all.dot", None, "nll", &0, source)?;
|
||||
regioncx.dump_graphviz_raw_constraints(&mut file)?;
|
||||
};
|
||||
|
||||
// Also dump the inference graph constraints as a graphviz file.
|
||||
let _: io::Result<()> = try_block! {
|
||||
let _: io::Result<()> = try {
|
||||
let mut file =
|
||||
pretty::create_dump_file(infcx.tcx, "regioncx.scc.dot", None, "nll", &0, source)?;
|
||||
regioncx.dump_graphviz_scc_constraints(&mut file)?;
|
||||
|
|
|
@ -26,6 +26,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
|
|||
#![feature(slice_concat_ext)]
|
||||
#![feature(try_from)]
|
||||
#![feature(reverse_bits)]
|
||||
#![feature(try_blocks)]
|
||||
|
||||
#![recursion_limit="256"]
|
||||
|
||||
|
@ -43,14 +44,6 @@ extern crate serialize as rustc_serialize; // used by deriving
|
|||
#[macro_use]
|
||||
extern crate syntax;
|
||||
|
||||
// Once we can use edition 2018 in the compiler,
|
||||
// replace this with real try blocks.
|
||||
macro_rules! try_block {
|
||||
($($inside:tt)*) => (
|
||||
(||{ ::std::ops::Try::from_ok({ $($inside)* }) })()
|
||||
)
|
||||
}
|
||||
|
||||
mod diagnostics;
|
||||
|
||||
mod borrow_check;
|
||||
|
|
|
@ -131,7 +131,7 @@ fn dump_matched_mir_node<'a, 'gcx, 'tcx, F>(
|
|||
) where
|
||||
F: FnMut(PassWhere, &mut dyn Write) -> io::Result<()>,
|
||||
{
|
||||
let _: io::Result<()> = try_block! {
|
||||
let _: io::Result<()> = try {
|
||||
let mut file = create_dump_file(tcx, "mir", pass_num, pass_name, disambiguator, source)?;
|
||||
writeln!(file, "// MIR for `{}`", node_path)?;
|
||||
writeln!(file, "// source = {:?}", source)?;
|
||||
|
@ -148,7 +148,7 @@ fn dump_matched_mir_node<'a, 'gcx, 'tcx, F>(
|
|||
};
|
||||
|
||||
if tcx.sess.opts.debugging_opts.dump_mir_graphviz {
|
||||
let _: io::Result<()> = try_block! {
|
||||
let _: io::Result<()> = try {
|
||||
let mut file =
|
||||
create_dump_file(tcx, "dot", pass_num, pass_name, disambiguator, source)?;
|
||||
write_mir_fn_graphviz(tcx, source.def_id, mir, &mut file)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue