| 1| |#![allow(unused_assignments, unused_variables, while_true)] | |
| 2| | | |
| 3| |// This test confirms an earlier problem was resolved, supporting the MIR graph generated by the | |
| 4| |// structure of this `fmt` function. | |
| 5| | | |
| 6| |struct DebugTest; | |
| 7| | | |
| 8| |impl std::fmt::Debug for DebugTest { | |
| 9| 1| fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | |
| 10| 1| if true { | |
| 11| 1| if false { | |
| 12| | while true { | |
| 13| | } | |
| 14| 1| } | |
| 15| 1| write!(f, "error")?; | |
| ^0 | |
| 16| | } else { | |
| 17| | } | |
| 18| 1| Ok(()) | |
| 19| 1| } | |
| 20| |} | |
| 21| | | |
| 22| 1|fn main() { | |
| 23| 1| let debug_test = DebugTest; | |
| 24| 1| println!("{:?}", debug_test); | |
| 25| 1|} | |
| 26| | | |
| 27| |/* | |
| 28| | | |
| 29| |This is the error message generated, before the issue was fixed: | |
| 30| | | |
| 31| |error: internal compiler error: compiler/rustc_mir/src/transform/coverage/mod.rs:374:42: | |
| 32| |Error processing: DefId(0:6 ~ bug_incomplete_cov_graph_traversal_simplified[317d]::{impl#0}::fmt): | |
| 33| |Error { message: "`TraverseCoverageGraphWithLoops` missed some `BasicCoverageBlock`s: | |
| 34| |[bcb6, bcb7, bcb9]" } | |
| 35| | | |
| 36| |*/ | |