diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 9b1642df11401..1b9ccbd850bee 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -87,9 +87,12 @@ impl<'hir> LoweringContext<'_, 'hir> { ExprKind::Let(ref pat, ref scrutinee) => { self.lower_expr_let(e.span, pat, scrutinee) } - ExprKind::If(ref cond, ref then, ref else_opt) => { - self.lower_expr_if(e.span, cond, then, else_opt.as_deref()) - } + ExprKind::If(ref cond, ref then, ref else_opt) => match cond.kind { + ExprKind::Let(ref pat, ref scrutinee) => { + self.lower_expr_if_let(e.span, pat, scrutinee, then, else_opt.as_deref()) + } + _ => self.lower_expr_if(cond, then, else_opt.as_deref()), + }, ExprKind::While(ref cond, ref body, opt_label) => self .with_loop_scope(e.id, |this| { this.lower_expr_while_in_loop_scope(e.span, cond, body, opt_label) @@ -337,10 +340,30 @@ impl<'hir> LoweringContext<'_, 'hir> { fn lower_expr_if( &mut self, - span: Span, cond: &Expr, then: &Block, else_opt: Option<&Expr>, + ) -> hir::ExprKind<'hir> { + macro_rules! make_if { + ($opt:expr) => {{ + let then_expr = self.lower_block_expr(then); + hir::ExprKind::If(self.lower_expr(cond), self.arena.alloc(then_expr), $opt) + }}; + } + if let Some(rslt) = else_opt { + make_if!(Some(self.lower_expr(rslt))) + } else { + make_if!(None) + } + } + + fn lower_expr_if_let( + &mut self, + span: Span, + pat: &Pat, + scrutinee: &Expr, + then: &Block, + else_opt: Option<&Expr>, ) -> hir::ExprKind<'hir> { // FIXME(#53667): handle lowering of && and parens. @@ -353,30 +376,13 @@ impl<'hir> LoweringContext<'_, 'hir> { let else_arm = self.arm(else_pat, else_expr); // Handle then + scrutinee: - let (then_pat, scrutinee, desugar) = match cond.kind { - // `<pat> => <then>`: - ExprKind::Let(ref pat, ref scrutinee) => { - let scrutinee = self.lower_expr(scrutinee); - let pat = self.lower_pat(pat); - (pat, scrutinee, hir::MatchSource::IfLetDesugar { contains_else_clause }) - } - // `true => <then>`: - _ => { - // Lower condition: - let cond = self.lower_expr(cond); - let span_block = - self.mark_span_with_reason(DesugaringKind::CondTemporary, cond.span, None); - // Wrap in a construct equivalent to `{ let _t = $cond; _t }` - // to preserve drop semantics since `if cond { ... }` does not - // let temporaries live outside of `cond`. - let cond = self.expr_drop_temps(span_block, cond, ThinVec::new()); - let pat = self.pat_bool(span, true); - (pat, cond, hir::MatchSource::IfDesugar { contains_else_clause }) - } - }; + let scrutinee = self.lower_expr(scrutinee); + let then_pat = self.lower_pat(pat); + let then_expr = self.lower_block_expr(then); let then_arm = self.arm(then_pat, self.arena.alloc(then_expr)); + let desugar = hir::MatchSource::IfLetDesugar { contains_else_clause }; hir::ExprKind::Match(scrutinee, arena_vec![self; then_arm, else_arm], desugar) } diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index acd254ae85cb1..92b717adfe65b 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1398,6 +1398,7 @@ impl Expr<'_> { ExprKind::Lit(_) => ExprPrecedence::Lit, ExprKind::Type(..) | ExprKind::Cast(..) => ExprPrecedence::Cast, ExprKind::DropTemps(ref expr, ..) => expr.precedence(), + ExprKind::If(..) => ExprPrecedence::If, ExprKind::Loop(..) => ExprPrecedence::Loop, ExprKind::Match(..) => ExprPrecedence::Match, ExprKind::Closure(..) => ExprPrecedence::Closure, @@ -1459,6 +1460,7 @@ impl Expr<'_> { | ExprKind::MethodCall(..) | ExprKind::Struct(..) | ExprKind::Tup(..) + | ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Closure(..) | ExprKind::Block(..) @@ -1575,6 +1577,10 @@ pub enum ExprKind<'hir> { /// This construct only exists to tweak the drop order in HIR lowering. /// An example of that is the desugaring of `for` loops. DropTemps(&'hir Expr<'hir>), + /// An `if` block, with an optional else block. + /// + /// I.e., `if <expr> { <expr> } else { <expr> }`. + If(&'hir Expr<'hir>, &'hir Expr<'hir>, Option<&'hir Expr<'hir>>), /// A conditionless loop (can be exited with `break`, `continue`, or `return`). /// /// I.e., `'label: loop { <block> }`. @@ -1728,8 +1734,6 @@ pub enum LocalSource { pub enum MatchSource { /// A `match _ { .. }`. Normal, - /// An `if _ { .. }` (optionally with `else { .. }`). - IfDesugar { contains_else_clause: bool }, /// An `if let _ = _ { .. }` (optionally with `else { .. }`). IfLetDesugar { contains_else_clause: bool }, /// An `if let _ = _ => { .. }` match guard. @@ -1752,7 +1756,7 @@ impl MatchSource { use MatchSource::*; match self { Normal => "match", - IfDesugar { .. } | IfLetDesugar { .. } | IfLetGuardDesugar => "if", + IfLetDesugar { .. } | IfLetGuardDesugar => "if", WhileDesugar | WhileLetDesugar => "while", ForLoopDesugar => "for", TryDesugar => "?", diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index b0e82214cf95f..648937c5808be 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -1146,6 +1146,11 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>) ExprKind::DropTemps(ref subexpression) => { visitor.visit_expr(subexpression); } + ExprKind::If(ref cond, ref then, ref else_opt) => { + visitor.visit_expr(cond); + visitor.visit_expr(then); + walk_list!(visitor, visit_expr, else_opt); + } ExprKind::Loop(ref block, ref opt_label, _) => { walk_list!(visitor, visit_label, opt_label); visitor.visit_block(block); diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index ddd3827c81df6..0a749ff511292 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -1083,6 +1083,50 @@ impl<'a> State<'a> { self.ann.post(self, AnnNode::Block(blk)) } + fn print_else(&mut self, els: Option<&hir::Expr<'_>>) { + match els { + Some(_else) => { + match _else.kind { + // "another else-if" + hir::ExprKind::If(ref i, ref then, ref e) => { + self.cbox(INDENT_UNIT - 1); + self.ibox(0); + self.s.word(" else if "); + self.print_expr_as_cond(&i); + self.s.space(); + self.print_expr(&then); + self.print_else(e.as_ref().map(|e| &**e)) + } + // "final else" + hir::ExprKind::Block(ref b, _) => { + self.cbox(INDENT_UNIT - 1); + self.ibox(0); + self.s.word(" else "); + self.print_block(&b) + } + // BLEAH, constraints would be great here + _ => { + panic!("print_if saw if with weird alternative"); + } + } + } + _ => {} + } + } + + pub fn print_if( + &mut self, + test: &hir::Expr<'_>, + blk: &hir::Expr<'_>, + elseopt: Option<&hir::Expr<'_>>, + ) { + self.head("if"); + self.print_expr_as_cond(test); + self.s.space(); + self.print_expr(blk); + self.print_else(elseopt) + } + pub fn print_anon_const(&mut self, constant: &hir::AnonConst) { self.ann.nested(self, Nested::Body(constant.body)) } @@ -1352,6 +1396,9 @@ impl<'a> State<'a> { // Print `}`: self.bclose_maybe_open(expr.span, true); } + hir::ExprKind::If(ref test, ref blk, ref elseopt) => { + self.print_if(&test, &blk, elseopt.as_ref().map(|e| &**e)); + } hir::ExprKind::Loop(ref blk, opt_label, _) => { if let Some(label) = opt_label { self.print_ident(label.ident); @@ -2436,7 +2483,13 @@ impl<'a> State<'a> { // // Duplicated from `parse::classify`, but adapted for the HIR. fn expr_requires_semi_to_be_stmt(e: &hir::Expr<'_>) -> bool { - !matches!(e.kind, hir::ExprKind::Match(..) | hir::ExprKind::Block(..) | hir::ExprKind::Loop(..)) + !matches!( + e.kind, + hir::ExprKind::If(..) + | hir::ExprKind::Match(..) + | hir::ExprKind::Block(..) + | hir::ExprKind::Loop(..) + ) } /// This statement requires a semicolon after it. diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index c2e99224d8b36..18f83d6ddf75b 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -658,12 +658,12 @@ impl<'hir> Map<'hir> { CRATE_HIR_ID } - /// When on a match arm tail expression or on a match arm, give back the enclosing `match` - /// expression. + /// When on an if expression, a match arm tail expression or a match arm, give back + /// the enclosing `if` or `match` expression. /// - /// Used by error reporting when there's a type error in a match arm caused by the `match` + /// Used by error reporting when there's a type error in an if or match arm caused by the /// expression needing to be unit. - pub fn get_match_if_cause(&self, hir_id: HirId) -> Option<&'hir Expr<'hir>> { + pub fn get_if_cause(&self, hir_id: HirId) -> Option<&'hir Expr<'hir>> { for (_, node) in self.parent_iter(hir_id) { match node { Node::Item(_) @@ -671,7 +671,9 @@ impl<'hir> Map<'hir> { | Node::TraitItem(_) | Node::ImplItem(_) | Node::Stmt(Stmt { kind: StmtKind::Local(_), .. }) => break, - Node::Expr(expr @ Expr { kind: ExprKind::Match(..), .. }) => return Some(expr), + Node::Expr(expr @ Expr { kind: ExprKind::If(..) | ExprKind::Match(..), .. }) => { + return Some(expr); + } _ => {} } } diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs index cf2e4e8916d0a..c11b8f7459389 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs @@ -531,6 +531,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::Borrow { .. } | ExprKind::AddressOf { .. } | ExprKind::Match { .. } + | ExprKind::If { .. } | ExprKind::Loop { .. } | ExprKind::Block { .. } | ExprKind::Assign { .. } diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 3f381f3f15e8e..55bdbcfc5b916 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -251,6 +251,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::StaticRef { .. } | ExprKind::Block { .. } | ExprKind::Match { .. } + | ExprKind::If { .. } | ExprKind::NeverToAny { .. } | ExprKind::Use { .. } | ExprKind::Borrow { .. } diff --git a/compiler/rustc_mir_build/src/build/expr/category.rs b/compiler/rustc_mir_build/src/build/expr/category.rs index 8561170856fd4..9320b5810e396 100644 --- a/compiler/rustc_mir_build/src/build/expr/category.rs +++ b/compiler/rustc_mir_build/src/build/expr/category.rs @@ -45,6 +45,7 @@ impl Category { ExprKind::LogicalOp { .. } | ExprKind::Match { .. } + | ExprKind::If { .. } | ExprKind::NeverToAny { .. } | ExprKind::Use { .. } | ExprKind::Adt { .. } diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index 09281799041ee..9777a97b57ee0 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -69,6 +69,40 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ExprKind::Match { scrutinee, arms } => { this.match_expr(destination, scope, expr_span, block, scrutinee, arms) } + ExprKind::If { cond, then, else_opt } => { + let place = unpack!(block = this.as_temp(block, Some(this.local_scope()), cond, Mutability::Mut)); + let operand = Operand::Move(Place::from(place)); + + let mut then_block = this.cfg.start_new_block(); + let mut else_block = this.cfg.start_new_block(); + let term = TerminatorKind::if_(this.hir.tcx(), operand, then_block, else_block); + this.cfg.terminate(block, source_info, term); + + unpack!(then_block = this.into(destination, scope, then_block, then)); + else_block = if let Some(else_opt) = else_opt { + unpack!(this.into(destination, None, else_block, else_opt)) + } else { + // Body of the `if` expression without an `else` clause must return `()`, thus + // we implicitly generate a `else {}` if it is not specified. + let correct_si = this.source_info(expr_span.shrink_to_hi()); + this.cfg.push_assign_unit(else_block, correct_si, destination, this.hir.tcx()); + else_block + }; + + let join_block = this.cfg.start_new_block(); + this.cfg.terminate( + then_block, + source_info, + TerminatorKind::Goto { target: join_block }, + ); + this.cfg.terminate( + else_block, + source_info, + TerminatorKind::Goto { target: join_block }, + ); + + join_block.unit() + }, ExprKind::NeverToAny { source } => { let source = this.hir.mirror(source); let is_call = matches!(source.kind, ExprKind::Call { .. } | ExprKind::InlineAsm { .. }); diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 417f9bded0988..d66c309cfb1fc 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -537,6 +537,11 @@ fn make_mirror_unadjusted<'a, 'tcx>( }, Err(err) => bug!("invalid loop id for continue: {}", err), }, + hir::ExprKind::If(cond, then, else_opt) => ExprKind::If { + cond: cond.to_ref(), + then: then.to_ref(), + else_opt: else_opt.map(|el| el.to_ref()), + }, hir::ExprKind::Match(ref discr, ref arms, _) => ExprKind::Match { scrutinee: discr.to_ref(), arms: arms.iter().map(|a| convert_arm(cx, a)).collect(), diff --git a/compiler/rustc_mir_build/src/thir/mod.rs b/compiler/rustc_mir_build/src/thir/mod.rs index ace9cad4d2996..ed3d3927825af 100644 --- a/compiler/rustc_mir_build/src/thir/mod.rs +++ b/compiler/rustc_mir_build/src/thir/mod.rs @@ -139,6 +139,11 @@ crate enum ExprKind<'tcx> { Box { value: ExprRef<'tcx>, }, + If { + cond: ExprRef<'tcx>, + then: ExprRef<'tcx>, + else_opt: Option<ExprRef<'tcx>>, + }, Call { ty: Ty<'tcx>, fun: ExprRef<'tcx>, diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index a70c1a28176cd..397706851cb79 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -403,7 +403,7 @@ fn report_arm_reachability<'p, 'tcx>( match is_useful { NotUseful => { match source { - hir::MatchSource::IfDesugar { .. } | hir::MatchSource::WhileDesugar => bug!(), + hir::MatchSource::WhileDesugar => bug!(), hir::MatchSource::IfLetDesugar { .. } | hir::MatchSource::WhileLetDesugar => { // Check which arm we're on. diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs index 2d6bbff460d7f..c887a860303b5 100644 --- a/compiler/rustc_passes/src/check_const.rs +++ b/compiler/rustc_passes/src/check_const.rs @@ -49,9 +49,7 @@ impl NonConstExpr { // All other expressions are allowed. Self::Loop(Loop | While | WhileLet) - | Self::Match( - WhileDesugar | WhileLetDesugar | Normal | IfDesugar { .. } | IfLetDesugar { .. }, - ) => &[], + | Self::Match(WhileDesugar | WhileLetDesugar | Normal | IfLetDesugar { .. }) => &[], }; Some(gates) diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index fcea1b29ec367..6202cc312fc0e 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -419,7 +419,7 @@ impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> { } // live nodes required for interesting control flow: - hir::ExprKind::Match(..) | hir::ExprKind::Loop(..) => { + hir::ExprKind::If(..) | hir::ExprKind::Match(..) | hir::ExprKind::Loop(..) => { self.add_live_node_for_node(expr.hir_id, ExprNode(expr.span)); intravisit::walk_expr(self, expr); } @@ -846,6 +846,29 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { // at the label ident hir::ExprKind::Loop(ref blk, _, _) => self.propagate_through_loop(expr, &blk, succ), + hir::ExprKind::If(ref cond, ref then, ref else_opt) => { + // + // (cond) + // | + // v + // (expr) + // / \ + // | | + // v v + // (then)(els) + // | | + // v v + // ( succ ) + // + let else_ln = + self.propagate_through_opt_expr(else_opt.as_ref().map(|e| &**e), succ); + let then_ln = self.propagate_through_expr(&then, succ); + let ln = self.live_node(expr.hir_id, expr.span); + self.init_from_succ(ln, else_ln); + self.merge_from_succ(ln, then_ln); + self.propagate_through_expr(&cond, ln) + } + hir::ExprKind::Match(ref e, arms, _) => { // // (e) @@ -1336,6 +1359,7 @@ fn check_expr<'tcx>(this: &mut Liveness<'_, 'tcx>, expr: &'tcx Expr<'tcx>) { | hir::ExprKind::Tup(..) | hir::ExprKind::Binary(..) | hir::ExprKind::Cast(..) + | hir::ExprKind::If(..) | hir::ExprKind::DropTemps(..) | hir::ExprKind::Unary(..) | hir::ExprKind::Ret(..) diff --git a/compiler/rustc_passes/src/naked_functions.rs b/compiler/rustc_passes/src/naked_functions.rs index 788f1df328cc4..93fb23c018bf0 100644 --- a/compiler/rustc_passes/src/naked_functions.rs +++ b/compiler/rustc_passes/src/naked_functions.rs @@ -201,6 +201,7 @@ impl<'tcx> CheckInlineAssembly<'tcx> { | ExprKind::Type(..) | ExprKind::Loop(..) | ExprKind::Match(..) + | ExprKind::If(..) | ExprKind::Closure(..) | ExprKind::Assign(..) | ExprKind::AssignOp(..) diff --git a/compiler/rustc_passes/src/region.rs b/compiler/rustc_passes/src/region.rs index 1af79abe4b911..91421d7f5f22b 100644 --- a/compiler/rustc_passes/src/region.rs +++ b/compiler/rustc_passes/src/region.rs @@ -241,6 +241,17 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h terminating(r.hir_id.local_id); } + hir::ExprKind::If(ref expr, ref then, Some(ref otherwise)) => { + terminating(expr.hir_id.local_id); + terminating(then.hir_id.local_id); + terminating(otherwise.hir_id.local_id); + } + + hir::ExprKind::If(ref expr, ref then, None) => { + terminating(expr.hir_id.local_id); + terminating(then.hir_id.local_id); + } + hir::ExprKind::Loop(ref body, _, _) => { terminating(body.hir_id.local_id); } diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 79fea83a6674d..eaa9ee7209d56 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -2278,6 +2278,12 @@ impl<'v> Visitor<'v> for ReturnsVisitor<'v> { self.visit_expr(expr); } } + hir::ExprKind::If(_, then, else_opt) if self.in_block_tail => { + self.visit_expr(then); + if let Some(el) = else_opt { + self.visit_expr(el); + } + } hir::ExprKind::Match(_, arms, _) if self.in_block_tail => { for arm in arms { self.visit_expr(arm.body); diff --git a/compiler/rustc_typeck/src/check/_match.rs b/compiler/rustc_typeck/src/check/_match.rs index 6467e04407939..322ec9640f464 100644 --- a/compiler/rustc_typeck/src/check/_match.rs +++ b/compiler/rustc_typeck/src/check/_match.rs @@ -1,9 +1,9 @@ -use crate::check::coercion::CoerceMany; +use crate::check::coercion::{AsCoercionSite, CoerceMany}; use crate::check::{Diverges, Expectation, FnCtxt, Needs}; use rustc_hir::{self as hir, ExprKind}; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use rustc_infer::traits::Obligation; -use rustc_middle::ty::{self, ToPredicate, Ty}; +use rustc_middle::ty::{self, ToPredicate, Ty, TyS}; use rustc_span::Span; use rustc_trait_selection::opaque_types::InferCtxtExt as _; use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; @@ -12,6 +12,41 @@ use rustc_trait_selection::traits::{ StatementAsExpression, }; +macro_rules! create_maybe_get_coercion_reason { + ($fn_name:ident, $node:expr) => { + pub(crate) fn $fn_name(&self, hir_id: hir::HirId, sp: Span) -> Option<(Span, String)> { + let node = $node(self.tcx.hir(), hir_id); + if let hir::Node::Block(block) = node { + // check that the body's parent is an fn + let parent = self.tcx.hir().get( + self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(block.hir_id)), + ); + if let ( + Some(expr), + hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(..), .. }), + ) = (&block.expr, parent) + { + // check that the `if` expr without `else` is the fn body's expr + if expr.span == sp { + return self.get_fn_decl(hir_id).and_then(|(fn_decl, _)| { + let span = fn_decl.output.span(); + let snippet = self.tcx.sess.source_map().span_to_snippet(span).ok()?; + Some(( + span, + format!("expected `{}` because of this return type", snippet), + )) + }); + } + } + } + if let hir::Node::Local(hir::Local { ty: Some(_), pat, .. }) = node { + return Some((pat.span, "expected because of this assignment".to_string())); + } + None + } + }; +} + impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pub fn check_match( &self, @@ -25,7 +60,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { use hir::MatchSource::*; let (source_if, if_no_else, force_scrutinee_bool) = match match_src { - IfDesugar { contains_else_clause } => (true, !contains_else_clause, true), IfLetDesugar { contains_else_clause, .. } => (true, !contains_else_clause, false), WhileDesugar => (false, false, true), _ => (false, false, false), @@ -115,8 +149,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let arm_ty = if source_if && if_no_else && i != 0 - && self.if_fallback_coercion(expr.span, &arms[0].body, &mut coercion) - { + && self.if_fallback_coercion( + expr.span, + &arms[0].body, + &mut coercion, + |hir_id, span| self.maybe_get_coercion_reason(hir_id, span), + ) { tcx.ty_error() } else { // Only call this if this is not an `if` expr with an expected type and no `else` @@ -125,58 +163,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }; all_arms_diverge &= self.diverges.get(); - // When we have a `match` as a tail expression in a `fn` with a returned `impl Trait` - // we check if the different arms would work with boxed trait objects instead and - // provide a structured suggestion in that case. - let opt_suggest_box_span = match ( - orig_expected, - self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty)), - ) { - (Expectation::ExpectHasType(expected), Some((id, ty))) - if self.in_tail_expr && self.can_coerce(arm_ty, expected) => - { - let impl_trait_ret_ty = self.infcx.instantiate_opaque_types( - id, - self.body_id, - self.param_env, - ty, - arm.body.span, - ); - let mut suggest_box = !impl_trait_ret_ty.obligations.is_empty(); - for o in impl_trait_ret_ty.obligations { - match o.predicate.skip_binders_unchecked() { - ty::PredicateAtom::Trait(t, constness) => { - let pred = ty::PredicateAtom::Trait( - ty::TraitPredicate { - trait_ref: ty::TraitRef { - def_id: t.def_id(), - substs: self.infcx.tcx.mk_substs_trait(arm_ty, &[]), - }, - }, - constness, - ); - let obl = Obligation::new( - o.cause.clone(), - self.param_env, - pred.to_predicate(self.infcx.tcx), - ); - suggest_box &= self.infcx.predicate_must_hold_modulo_regions(&obl); - if !suggest_box { - // We've encountered some obligation that didn't hold, so the - // return expression can't just be boxed. We don't need to - // evaluate the rest of the obligations. - break; - } - } - _ => {} - } - } - // If all the obligations hold (or there are no obligations) the tail expression - // we can suggest to return a boxed trait object instead of an opaque type. - if suggest_box { self.ret_type_span } else { None } - } - _ => None, - }; + let opt_suggest_box_span = + self.opt_suggest_box_span(arm.body.span, arm_ty, orig_expected); if source_if { let then_expr = &arms[0].body; @@ -279,7 +267,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ) { use hir::MatchSource::*; let msg = match source { - IfDesugar { .. } | IfLetDesugar { .. } => "block in `if` expression", + IfLetDesugar { .. } => "block in `if` expression", WhileDesugar { .. } | WhileLetDesugar { .. } => "block in `while` expression", _ => "arm", }; @@ -291,15 +279,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// Handle the fallback arm of a desugared if(-let) like a missing else. /// /// Returns `true` if there was an error forcing the coercion to the `()` type. - fn if_fallback_coercion( + pub(crate) fn if_fallback_coercion<F, T>( &self, span: Span, then_expr: &'tcx hir::Expr<'tcx>, - coercion: &mut CoerceMany<'tcx, '_, rustc_hir::Arm<'tcx>>, - ) -> bool { + coercion: &mut CoerceMany<'tcx, '_, T>, + ret_reason: F, + ) -> bool + where + F: Fn(hir::HirId, Span) -> Option<(Span, String)>, + T: AsCoercionSite, + { // If this `if` expr is the parent's function return expr, // the cause of the type coercion is the return type, point at it. (#25228) - let ret_reason = self.maybe_get_coercion_reason(then_expr.hir_id, span); + let ret_reason = ret_reason(then_expr.hir_id, span); let cause = self.cause(span, ObligationCauseCode::IfExpressionWithNoElse); let mut error = false; coercion.coerce_forced_unit( @@ -322,38 +315,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { error } - fn maybe_get_coercion_reason(&self, hir_id: hir::HirId, span: Span) -> Option<(Span, String)> { - use hir::Node::{Block, Item, Local}; - - let hir = self.tcx.hir(); - let arm_id = hir.get_parent_node(hir_id); - let match_id = hir.get_parent_node(arm_id); - let containing_id = hir.get_parent_node(match_id); - - let node = hir.get(containing_id); - if let Block(block) = node { - // check that the body's parent is an fn - let parent = hir.get(hir.get_parent_node(hir.get_parent_node(block.hir_id))); - if let (Some(expr), Item(hir::Item { kind: hir::ItemKind::Fn(..), .. })) = - (&block.expr, parent) - { - // check that the `if` expr without `else` is the fn body's expr - if expr.span == span { - return self.get_fn_decl(hir_id).and_then(|(fn_decl, _)| { - let span = fn_decl.output.span(); - let snippet = self.tcx.sess.source_map().span_to_snippet(span).ok()?; - Some((span, format!("expected `{}` because of this return type", snippet))) - }); - } - } + create_maybe_get_coercion_reason!( + maybe_get_coercion_reason, + |hir: rustc_middle::hir::map::Map<'a>, id| { + let arm_id = hir.get_parent_node(id); + let match_id = hir.get_parent_node(arm_id); + let containing_id = hir.get_parent_node(match_id); + hir.get(containing_id) } - if let Local(hir::Local { ty: Some(_), pat, .. }) = node { - return Some((pat.span, "expected because of this assignment".to_string())); + ); + + create_maybe_get_coercion_reason!( + maybe_get_coercion_reason_if, + |hir: rustc_middle::hir::map::Map<'a>, id| { + let rslt = hir.get_parent_node(hir.get_parent_node(id)); + hir.get(rslt) } - None - } + ); - fn if_cause( + pub(crate) fn if_cause( &self, span: Span, then_expr: &'tcx hir::Expr<'tcx>, @@ -546,6 +526,58 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { (block.span, None) } } + + // When we have a `match` as a tail expression in a `fn` with a returned `impl Trait` + // we check if the different arms would work with boxed trait objects instead and + // provide a structured suggestion in that case. + pub(crate) fn opt_suggest_box_span( + &self, + span: Span, + outer_ty: &'tcx TyS<'tcx>, + orig_expected: Expectation<'tcx>, + ) -> Option<Span> { + match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) { + (Expectation::ExpectHasType(expected), Some((id, ty))) + if self.in_tail_expr && self.can_coerce(outer_ty, expected) => + { + let impl_trait_ret_ty = + self.infcx.instantiate_opaque_types(id, self.body_id, self.param_env, ty, span); + let mut suggest_box = !impl_trait_ret_ty.obligations.is_empty(); + for o in impl_trait_ret_ty.obligations { + match o.predicate.skip_binders_unchecked() { + ty::PredicateAtom::Trait(t, constness) => { + let pred = ty::PredicateAtom::Trait( + ty::TraitPredicate { + trait_ref: ty::TraitRef { + def_id: t.def_id(), + substs: self.infcx.tcx.mk_substs_trait(outer_ty, &[]), + }, + }, + constness, + ); + let obl = Obligation::new( + o.cause.clone(), + self.param_env, + pred.to_predicate(self.infcx.tcx), + ); + suggest_box &= self.infcx.predicate_must_hold_modulo_regions(&obl); + if !suggest_box { + // We've encountered some obligation that didn't hold, so the + // return expression can't just be boxed. We don't need to + // evaluate the rest of the obligations. + break; + } + } + _ => {} + } + } + // If all the obligations hold (or there are no obligations) the tail expression + // we can suggest to return a boxed trait object instead of an opaque type. + if suggest_box { self.ret_type_span } else { None } + } + _ => None, + } + } } fn arms_contain_ref_bindings(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> { diff --git a/compiler/rustc_typeck/src/check/coercion.rs b/compiler/rustc_typeck/src/check/coercion.rs index 67ec739d8614d..0d21c56f4cf4d 100644 --- a/compiler/rustc_typeck/src/check/coercion.rs +++ b/compiler/rustc_typeck/src/check/coercion.rs @@ -1443,14 +1443,14 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> { &mut err, expr, expected, found, cause.span, blk_id, ); let parent = fcx.tcx.hir().get(parent_id); - if let (Some(match_expr), true, false) = ( - fcx.tcx.hir().get_match_if_cause(expr.hir_id), + if let (Some(cond_expr), true, false) = ( + fcx.tcx.hir().get_if_cause(expr.hir_id), expected.is_unit(), pointing_at_return_type, ) { - if match_expr.span.desugaring_kind().is_none() { - err.span_label(match_expr.span, "expected this to be `()`"); - fcx.suggest_semicolon_at_end(match_expr.span, &mut err); + if cond_expr.span.desugaring_kind().is_none() { + err.span_label(cond_expr.span, "expected this to be `()`"); + fcx.suggest_semicolon_at_end(cond_expr.span, &mut err); } } fcx.get_node_fn_decl(parent).map(|(fn_decl, _, is_main)| (fn_decl, is_main)) diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs index d76a80d5a3990..8aa6c6d924a53 100644 --- a/compiler/rustc_typeck/src/check/expr.rs +++ b/compiler/rustc_typeck/src/check/expr.rs @@ -10,6 +10,7 @@ use crate::check::method::{probe, MethodError, SelfSource}; use crate::check::report_unexpected_variant_res; use crate::check::BreakableCtxt; use crate::check::Diverges; +use crate::check::DynamicCoerceMany; use crate::check::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectation}; use crate::check::FnCtxt; use crate::check::Needs; @@ -188,7 +189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Warn for non-block expressions with diverging children. match expr.kind { - ExprKind::Block(..) | ExprKind::Loop(..) | ExprKind::Match(..) => {} + ExprKind::Block(..) | ExprKind::If(..) | ExprKind::Loop(..) | ExprKind::Match(..) => {} // If `expr` is a result of desugaring the try block and is an ok-wrapped // diverging expression (e.g. it arose from desugaring of `try { return }`), // we skip issuing a warning because it is autogenerated code. @@ -285,6 +286,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self.check_expr_eq_type(&e, ty); ty } + ExprKind::If(ref cond, ref then_expr, ref opt_else_expr) => self.check_then_else( + &cond, + then_expr, + opt_else_expr.as_ref().map(|e| &**e), + expr.span, + expected, + ), ExprKind::DropTemps(ref e) => self.check_expr_with_expectation(e, expected), ExprKind::Array(ref args) => self.check_expr_array(args, expected, expr), ExprKind::ConstBlock(ref anon_const) => self.to_const(anon_const).ty, @@ -739,8 +747,67 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err.emit(); } + // A generic function for checking the 'then' and 'else' clauses in an 'if' + // or 'if-else' expression. + fn check_then_else( + &self, + cond_expr: &'tcx hir::Expr<'tcx>, + then_expr: &'tcx hir::Expr<'tcx>, + opt_else_expr: Option<&'tcx hir::Expr<'tcx>>, + sp: Span, + orig_expected: Expectation<'tcx>, + ) -> Ty<'tcx> { + let cond_ty = self.check_expr_has_type_or_error(cond_expr, self.tcx.types.bool, |_| {}); + + self.warn_if_unreachable(cond_expr.hir_id, then_expr.span, "block in `if` expression"); + + let cond_diverges = self.diverges.get(); + self.diverges.set(Diverges::Maybe); + + let expected = orig_expected.adjust_for_branches(self); + let then_ty = self.check_expr_with_expectation(then_expr, expected); + let then_diverges = self.diverges.get(); + self.diverges.set(Diverges::Maybe); + + // We've already taken the expected type's preferences + // into account when typing the `then` branch. To figure + // out the initial shot at a LUB, we thus only consider + // `expected` if it represents a *hard* constraint + // (`only_has_type`); otherwise, we just go with a + // fresh type variable. + let coerce_to_ty = expected.coercion_target_type(self, sp); + let mut coerce: DynamicCoerceMany<'_> = CoerceMany::new(coerce_to_ty); + + coerce.coerce(self, &self.misc(sp), then_expr, then_ty); + + if let Some(else_expr) = opt_else_expr { + let else_ty = self.check_expr_with_expectation(else_expr, expected); + let else_diverges = self.diverges.get(); + + let opt_suggest_box_span = + self.opt_suggest_box_span(else_expr.span, else_ty, orig_expected); + let if_cause = + self.if_cause(sp, then_expr, else_expr, then_ty, else_ty, opt_suggest_box_span); + + coerce.coerce(self, &if_cause, else_expr, else_ty); + + // We won't diverge unless both branches do (or the condition does). + self.diverges.set(cond_diverges | then_diverges & else_diverges); + } else { + self.if_fallback_coercion(sp, then_expr, &mut coerce, |hir_id, span| { + self.maybe_get_coercion_reason_if(hir_id, span) + }); + + // If the condition is false we can't diverge. + self.diverges.set(cond_diverges); + } + + let result_ty = coerce.complete(self); + if cond_ty.references_error() { self.tcx.ty_error() } else { result_ty } + } + /// Type check assignment expression `expr` of form `lhs = rhs`. - /// The expected type is `()` and is passsed to the function for the purposes of diagnostics. + /// The expected type is `()` and is passed to the function for the purposes of diagnostics. fn check_expr_assign( &self, expr: &'tcx hir::Expr<'tcx>, @@ -765,17 +832,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }; if !lhs.is_syntactic_place_expr() { // Do not suggest `if let x = y` as `==` is way more likely to be the intention. - if let hir::Node::Expr(hir::Expr { - kind: - ExprKind::Match( - _, - _, - hir::MatchSource::IfDesugar { .. } | hir::MatchSource::WhileDesugar, - ), - .. - }) = self.tcx.hir().get( - self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(expr.hir_id)), - ) { + let mut span_err = || { // Likely `if let` intended. err.span_suggestion_verbose( expr.span.shrink_to_lo(), @@ -783,6 +840,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { "let ".to_string(), applicability, ); + }; + if let hir::Node::Expr(hir::Expr { + kind: ExprKind::Match(_, _, hir::MatchSource::WhileDesugar), + .. + }) = self.tcx.hir().get( + self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(expr.hir_id)), + ) { + span_err(); + } else if let hir::Node::Expr(hir::Expr { kind: ExprKind::If { .. }, .. }) = + self.tcx.hir().get(self.tcx.hir().get_parent_node(expr.hir_id)) + { + span_err(); } } if eq { diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs index 3e60924d6fcf8..8fa0de623b0a4 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs @@ -803,33 +803,39 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// // ^^^^ point at this instead of the whole `if` expression /// ``` fn get_expr_coercion_span(&self, expr: &hir::Expr<'_>) -> rustc_span::Span { - if let hir::ExprKind::Match(_, arms, _) = &expr.kind { - let arm_spans: Vec<Span> = arms - .iter() - .filter_map(|arm| { - self.in_progress_typeck_results - .and_then(|typeck_results| { - typeck_results.borrow().node_type_opt(arm.body.hir_id) - }) - .and_then(|arm_ty| { - if arm_ty.is_never() { - None - } else { - Some(match &arm.body.kind { - // Point at the tail expression when possible. - hir::ExprKind::Block(block, _) => { - block.expr.as_ref().map(|e| e.span).unwrap_or(block.span) - } - _ => arm.body.span, - }) + let check_in_progress = |elem: &hir::Expr<'_>| { + self.in_progress_typeck_results + .and_then(|typeck_results| typeck_results.borrow().node_type_opt(elem.hir_id)) + .and_then(|ty| { + if ty.is_never() { + None + } else { + Some(match &elem.kind { + // Point at the tail expression when possible. + hir::ExprKind::Block(block, _) => { + block.expr.as_ref().map(|e| e.span).unwrap_or(block.span) } + _ => elem.span, }) + } }) - .collect(); - if arm_spans.len() == 1 { - return arm_spans[0]; + }; + + if let hir::ExprKind::If(_, _, Some(el)) = &expr.kind { + if let Some(rslt) = check_in_progress(el) { + return rslt; } } + + if let hir::ExprKind::Match(_, arms, _) = &expr.kind { + let mut iter = arms.iter().filter_map(|arm| check_in_progress(&arm.body)); + if let Some(span) = iter.next() { + if iter.next().is_none() { + return span; + } + } + } + expr.span } diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs b/compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs index 17dbf989d6683..e698ef5efbcac 100644 --- a/compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs +++ b/compiler/rustc_typeck/src/check/fn_ctxt/suggestions.rs @@ -358,6 +358,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ExprKind::Call(..) | ExprKind::MethodCall(..) | ExprKind::Loop(..) + | ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Block(..) => { err.span_suggestion( diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs index 3ce244e11bf45..01519e4c8f7c4 100644 --- a/compiler/rustc_typeck/src/expr_use_visitor.rs +++ b/compiler/rustc_typeck/src/expr_use_visitor.rs @@ -219,6 +219,14 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { self.consume_exprs(exprs); } + hir::ExprKind::If(ref cond_expr, ref then_expr, ref opt_else_expr) => { + self.consume_expr(&cond_expr); + self.consume_expr(&then_expr); + if let Some(ref else_expr) = *opt_else_expr { + self.consume_expr(&else_expr); + } + } + hir::ExprKind::Match(ref discr, arms, _) => { let discr_place = return_if_err!(self.mc.cat_expr(&discr)); self.borrow_expr(&discr, ty::ImmBorrow); diff --git a/compiler/rustc_typeck/src/mem_categorization.rs b/compiler/rustc_typeck/src/mem_categorization.rs index a601123c8d055..37f9e3d63b830 100644 --- a/compiler/rustc_typeck/src/mem_categorization.rs +++ b/compiler/rustc_typeck/src/mem_categorization.rs @@ -364,6 +364,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> { | hir::ExprKind::Cast(..) | hir::ExprKind::DropTemps(..) | hir::ExprKind::Array(..) + | hir::ExprKind::If(..) | hir::ExprKind::Tup(..) | hir::ExprKind::Binary(..) | hir::ExprKind::Block(..) diff --git a/src/test/incremental/hashes/if_expressions.rs b/src/test/incremental/hashes/if_expressions.rs index 59af1fc09c2de..ca8daae152cdd 100644 --- a/src/test/incremental/hashes/if_expressions.rs +++ b/src/test/incremental/hashes/if_expressions.rs @@ -94,7 +94,7 @@ pub fn add_else_branch(x: bool) -> u32 { } #[cfg(not(cfail1))] -#[rustc_clean(cfg="cfail2", except="hir_owner_nodes")] +#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")] #[rustc_clean(cfg="cfail3")] pub fn add_else_branch(x: bool) -> u32 { let mut ret = 1; diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff index 0d06c4960b363..64c270393735a 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff @@ -9,18 +9,12 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 - _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 +- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 + _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 -+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 ++ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6 } bb1: { - _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:14:6: 14:6 - StorageDead(_1); // scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2 - return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 - } - - bb2: { StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL // mir::Constant @@ -33,5 +27,11 @@ // + span: $SRC_DIR/std/src/macros.rs:LL:COL // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } + + bb2: { + _0 = const (); // scope 0 at $DIR/control-flow-simplification.rs:14:6: 14:6 + StorageDead(_1); // scope 0 at $DIR/control-flow-simplification.rs:14:5: 14:6 + return; // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2 + } } diff --git a/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot b/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot index 5b6d73a7deefb..eeedbb215c0dd 100644 --- a/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot +++ b/src/test/mir-opt/coverage_graphviz.main.InstrumentCoverage.0.dot @@ -3,8 +3,8 @@ digraph Cov_0_3 { node [fontname="Courier, monospace"]; edge [fontname="Courier, monospace"]; bcb2__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb2</td></tr><tr><td align="left" balign="left">Expression(bcb0 - bcb1) at 13:10-13:10<br/> 13:10-13:10: @4[0]: Coverage::Expression(4294967295) = 1 - 2 for $DIR/coverage_graphviz.rs:13:10 - 13:11</td></tr><tr><td align="left" balign="left">bb4: Goto</td></tr></table>>]; - bcb1__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb1</td></tr><tr><td align="left" balign="left">Counter(bcb1) at 12:13-12:18<br/> 12:13-12:18: @5[0]: _0 = const ()<br/>Expression(bcb1 + 0) at 15:2-15:2<br/> 15:2-15:2: @5.Return: return</td></tr><tr><td align="left" balign="left">bb3: FalseEdge</td></tr><tr><td align="left" balign="left">bb5: Return</td></tr></table>>]; - bcb0__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb0</td></tr><tr><td align="left" balign="left"></td></tr><tr><td align="left" balign="left">Counter(bcb0) at 9:1-11:17<br/> 11:12-11:17: @1.Call: _2 = bar() -> [return: bb2, unwind: bb6]<br/> 11:12-11:17: @2[0]: FakeRead(ForMatchedPlace, _2)</td></tr><tr><td align="left" balign="left">bb0: FalseUnwind<br/>bb1: Call</td></tr><tr><td align="left" balign="left">bb2: SwitchInt</td></tr></table>>]; + bcb1__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb1</td></tr><tr><td align="left" balign="left">Counter(bcb1) at 12:13-12:18<br/> 12:13-12:18: @3[0]: Coverage::Expression(4294967294) = 2 + 0 for $DIR/coverage_graphviz.rs:15:1 - 15:2<br/>Expression(bcb1 + 0) at 15:2-15:2<br/> 15:2-15:2: @3.Return: return</td></tr><tr><td align="left" balign="left">bb3: Return</td></tr></table>>]; + bcb0__Cov_0_3 [shape="none", label=<<table border="0" cellborder="1" cellspacing="0"><tr><td bgcolor="gray" align="center" colspan="1">bcb0</td></tr><tr><td align="left" balign="left"></td></tr><tr><td align="left" balign="left">Counter(bcb0) at 9:1-11:17<br/> 11:12-11:17: @1.Call: _2 = bar() -> [return: bb2, unwind: bb5]</td></tr><tr><td align="left" balign="left">bb0: FalseUnwind<br/>bb1: Call</td></tr><tr><td align="left" balign="left">bb2: SwitchInt</td></tr></table>>]; bcb2__Cov_0_3 -> bcb0__Cov_0_3 [label=<>]; bcb0__Cov_0_3 -> bcb2__Cov_0_3 [label=<false>]; bcb0__Cov_0_3 -> bcb1__Cov_0_3 [label=<otherwise>]; diff --git a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff index bf99f7efb4dd6..6d2dbb820f962 100644 --- a/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff +++ b/src/test/mir-opt/deaggregator_test_enum_2.test1.Deaggregator.diff @@ -12,20 +12,10 @@ bb0: { StorageLive(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 _3 = _1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9 - switchInt(_3) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 + switchInt(move _3) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } bb1: { - StorageLive(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 - _5 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 -- _0 = Foo::B(move _5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 -+ ((_0 as B).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 -+ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 - StorageDead(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18 - goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 - } - - bb2: { StorageLive(_4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 _4 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17 - _0 = Foo::A(move _4); // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18 @@ -35,8 +25,18 @@ goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 } + bb2: { + StorageLive(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 + _5 = _2; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17 +- _0 = Foo::B(move _5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 ++ ((_0 as B).0: i32) = move _5; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 ++ discriminant(_0) = 1; // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18 + StorageDead(_5); // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18 + goto -> bb3; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6 + } + bb3: { - StorageDead(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2 + StorageDead(_3); // scope 0 at $DIR/deaggregator_test_enum_2.rs:14:5: 14:6 return; // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2 } } diff --git a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff index 9c213eaed3c04..e11d24cac8c2e 100644 --- a/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff +++ b/src/test/mir-opt/dest-prop/branch.main.DestinationPropagation.diff @@ -36,10 +36,16 @@ } bb2: { - switchInt(_3) -> [false: bb3, otherwise: bb4]; // scope 1 at $DIR/branch.rs:15:13: 20:6 + switchInt(move _3) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/branch.rs:15:13: 20:6 } bb3: { +- _2 = _1; // scope 1 at $DIR/branch.rs:16:9: 16:10 ++ nop; // scope 1 at $DIR/branch.rs:16:9: 16:10 + goto -> bb6; // scope 1 at $DIR/branch.rs:15:13: 20:6 + } + + bb4: { StorageLive(_4); // scope 1 at $DIR/branch.rs:18:9: 18:14 _4 = val() -> bb5; // scope 1 at $DIR/branch.rs:18:9: 18:14 // mir::Constant @@ -47,12 +53,6 @@ // + literal: Const { ty: fn() -> i32 {val}, val: Value(Scalar(<ZST>)) } } - bb4: { -- _2 = _1; // scope 1 at $DIR/branch.rs:16:9: 16:10 -+ nop; // scope 1 at $DIR/branch.rs:16:9: 16:10 - goto -> bb6; // scope 1 at $DIR/branch.rs:15:13: 20:6 - } - bb5: { StorageDead(_4); // scope 1 at $DIR/branch.rs:18:14: 18:15 - _2 = _1; // scope 1 at $DIR/branch.rs:19:9: 19:10 @@ -61,7 +61,7 @@ } bb6: { - StorageDead(_3); // scope 1 at $DIR/branch.rs:20:6: 20:7 + StorageDead(_3); // scope 1 at $DIR/branch.rs:20:5: 20:6 _0 = const (); // scope 0 at $DIR/branch.rs:12:11: 21:2 - StorageDead(_2); // scope 1 at $DIR/branch.rs:21:1: 21:2 - StorageDead(_1); // scope 0 at $DIR/branch.rs:21:1: 21:2 diff --git a/src/test/mir-opt/equal_true.opt.InstCombine.diff b/src/test/mir-opt/equal_true.opt.InstCombine.diff index a26776e70d6b9..1bc4c0f8b37e3 100644 --- a/src/test/mir-opt/equal_true.opt.InstCombine.diff +++ b/src/test/mir-opt/equal_true.opt.InstCombine.diff @@ -14,21 +14,21 @@ - _2 = Eq(move _3, const true); // scope 0 at $DIR/equal_true.rs:4:8: 4:17 + _2 = move _3; // scope 0 at $DIR/equal_true.rs:4:8: 4:17 StorageDead(_3); // scope 0 at $DIR/equal_true.rs:4:16: 4:17 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb1: { - _0 = const 1_i32; // scope 0 at $DIR/equal_true.rs:4:31: 4:32 + _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:4:20: 4:21 goto -> bb3; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb2: { - _0 = const 0_i32; // scope 0 at $DIR/equal_true.rs:4:20: 4:21 + _0 = const 1_i32; // scope 0 at $DIR/equal_true.rs:4:31: 4:32 goto -> bb3; // scope 0 at $DIR/equal_true.rs:4:5: 4:34 } bb3: { - StorageDead(_2); // scope 0 at $DIR/equal_true.rs:5:1: 5:2 + StorageDead(_2); // scope 0 at $DIR/equal_true.rs:4:33: 4:34 return; // scope 0 at $DIR/equal_true.rs:5:2: 5:2 } } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff index 993ff660caaac..875e5a0a71f33 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_bool.SimplifyComparisonIntegral.diff @@ -9,21 +9,21 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 _2 = _1; // scope 0 at $DIR/if-condition-int.rs:17:8: 17:9 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb1: { - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:17:23: 17:24 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:17:12: 17:13 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb2: { - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:17:12: 17:13 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:17:23: 17:24 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:17:5: 17:26 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:18:1: 18:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:17:25: 17:26 return; // scope 0 at $DIR/if-condition-int.rs:18:2: 18:2 } } diff --git a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff index 8ae9168c95098..2c4952402a49d 100644 --- a/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.dont_opt_floats.SimplifyComparisonIntegral.diff @@ -16,21 +16,21 @@ // + span: $DIR/if-condition-int.rs:53:13: 53:18 // + literal: Const { ty: f32, val: Value(Scalar(0xc2280000)) } StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:53:17: 53:18 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb1: { - _0 = const 1_i32; // scope 0 at $DIR/if-condition-int.rs:53:32: 53:33 + _0 = const 0_i32; // scope 0 at $DIR/if-condition-int.rs:53:21: 53:22 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb2: { - _0 = const 0_i32; // scope 0 at $DIR/if-condition-int.rs:53:21: 53:22 + _0 = const 1_i32; // scope 0 at $DIR/if-condition-int.rs:53:32: 53:33 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:53:5: 53:35 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:54:1: 54:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:53:34: 53:35 return; // scope 0 at $DIR/if-condition-int.rs:54:2: 54:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff index ae0960028a8b4..661591658df89 100644 --- a/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_char.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:9 - _2 = Eq(move _3, const 'x'); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 -+ _2 = Eq(_3, const 'x'); // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 ++ nop; // scope 0 at $DIR/if-condition-int.rs:21:8: 21:16 + nop; // scope 0 at $DIR/if-condition-int.rs:21:15: 21:16 -+ switchInt(move _3) -> ['x': bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 ++ switchInt(move _3) -> ['x': bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:21:30: 21:31 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:21:19: 21:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:21:19: 21:20 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:21:30: 21:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:21:5: 21:33 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:22:1: 22:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:21:32: 21:33 return; // scope 0 at $DIR/if-condition-int.rs:22:2: 22:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff index 8d59e51ac2b11..7d0ed7338d7d2 100644 --- a/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_i8.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:9 - _2 = Eq(move _3, const 42_i8); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 -+ _2 = Eq(_3, const 42_i8); // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 ++ nop; // scope 0 at $DIR/if-condition-int.rs:25:8: 25:15 + nop; // scope 0 at $DIR/if-condition-int.rs:25:14: 25:15 -+ switchInt(move _3) -> [42_i8: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 ++ switchInt(move _3) -> [42_i8: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:25:29: 25:30 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:25:18: 25:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:25:18: 25:19 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:25:29: 25:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:25:5: 25:32 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:26:1: 26:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:25:31: 25:32 return; // scope 0 at $DIR/if-condition-int.rs:26:2: 26:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff index c4975661efe50..bf388a141b617 100644 --- a/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_multiple_ifs.SimplifyComparisonIntegral.diff @@ -15,40 +15,40 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 -+ _2 = Eq(_3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ nop; // scope 0 at $DIR/if-condition-int.rs:33:8: 33:15 + nop; // scope 0 at $DIR/if-condition-int.rs:33:14: 33:15 -+ switchInt(move _3) -> [42_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 } bb1: { ++ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:34:9: 34:10 + goto -> bb6; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 + } + + bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 StorageLive(_4); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 StorageLive(_5); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 _5 = _1; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:16 - _4 = Ne(move _5, const 21_u32); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 - StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -- switchInt(_4) -> [false: bb3, otherwise: bb4]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 -+ _4 = Ne(_5, const 21_u32); // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 +- switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 ++ nop; // scope 0 at $DIR/if-condition-int.rs:35:15: 35:22 + nop; // scope 0 at $DIR/if-condition-int.rs:35:21: 35:22 -+ switchInt(move _5) -> [21_u32: bb3, otherwise: bb4]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - } - - bb2: { -+ StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:34:9: 34:10 - goto -> bb6; // scope 0 at $DIR/if-condition-int.rs:33:5: 39:6 ++ switchInt(move _5) -> [21_u32: bb4, otherwise: bb3]; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } bb3: { + StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - _0 = const 2_u32; // scope 0 at $DIR/if-condition-int.rs:38:9: 38:10 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:36:9: 36:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } bb4: { + StorageDead(_5); // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:36:9: 36:10 + _0 = const 2_u32; // scope 0 at $DIR/if-condition-int.rs:38:9: 38:10 goto -> bb5; // scope 0 at $DIR/if-condition-int.rs:35:12: 39:6 } @@ -58,7 +58,7 @@ } bb6: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:40:1: 40:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:39:5: 39:6 return; // scope 0 at $DIR/if-condition-int.rs:40:2: 40:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff index d7f544e44c0fe..bee2e030b7ed5 100644 --- a/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_negative.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:9 - _2 = Eq(move _3, const -42_i32); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 -+ _2 = Eq(_3, const -42_i32); // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 ++ nop; // scope 0 at $DIR/if-condition-int.rs:29:8: 29:16 + nop; // scope 0 at $DIR/if-condition-int.rs:29:15: 29:16 -+ switchInt(move _3) -> [-42_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 ++ switchInt(move _3) -> [-42_i32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:29:30: 29:31 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:29:19: 29:20 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:29:19: 29:20 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:29:30: 29:31 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:29:5: 29:33 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:30:1: 30:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:29:32: 29:33 return; // scope 0 at $DIR/if-condition-int.rs:30:2: 30:2 } } diff --git a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff index 51e00e680c286..09a87591be107 100644 --- a/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/if_condition_int.opt_u32.SimplifyComparisonIntegral.diff @@ -13,26 +13,26 @@ _3 = _1; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:9 - _2 = Eq(move _3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 - StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -- switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 -+ _2 = Eq(_3, const 42_u32); // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 +- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 ++ nop; // scope 0 at $DIR/if-condition-int.rs:12:8: 12:15 + nop; // scope 0 at $DIR/if-condition-int.rs:12:14: 12:15 -+ switchInt(move _3) -> [42_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 ++ switchInt(move _3) -> [42_u32: bb1, otherwise: bb2]; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb1: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 - _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:12:29: 12:30 + _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:12:18: 12:19 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb2: { + StorageDead(_3); // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 - _0 = const 0_u32; // scope 0 at $DIR/if-condition-int.rs:12:18: 12:19 + _0 = const 1_u32; // scope 0 at $DIR/if-condition-int.rs:12:29: 12:30 goto -> bb3; // scope 0 at $DIR/if-condition-int.rs:12:5: 12:32 } bb3: { - StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:13:1: 13:2 + StorageDead(_2); // scope 0 at $DIR/if-condition-int.rs:12:31: 12:32 return; // scope 0 at $DIR/if-condition-int.rs:13:2: 13:2 } } diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff index 3dc33354a5a56..a746baa63eb53 100644 --- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff +++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff @@ -19,10 +19,19 @@ _3 = _1; // scope 0 at $DIR/inline-diverging.rs:13:8: 13:9 _2 = Gt(move _3, const 0_i32); // scope 0 at $DIR/inline-diverging.rs:13:8: 13:13 StorageDead(_3); // scope 0 at $DIR/inline-diverging.rs:13:12: 13:13 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/inline-diverging.rs:13:5: 17:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/inline-diverging.rs:13:5: 17:6 } bb1: { + StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 + _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 + _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 + StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 + StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:17:5: 17:6 + return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 + } + + bb2: { StorageLive(_6); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 - panic(); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 + StorageLive(_7); // scope 0 at $DIR/inline-diverging.rs:16:9: 16:16 @@ -39,14 +48,5 @@ + // + span: $DIR/inline-diverging.rs:16:9: 16:16 + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } - - bb2: { - StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _4 = _1; // scope 0 at $DIR/inline-diverging.rs:14:9: 14:10 - _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:14:9: 14:17 - StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:14:16: 14:17 - StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:18:1: 18:2 - return; // scope 0 at $DIR/inline-diverging.rs:18:2: 18:2 - } } diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff index 99497a6fc791c..066ac8d82d36b 100644 --- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff +++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff @@ -90,16 +90,16 @@ + + bb3: { + _8 = move _7; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 -+ switchInt(_8) -> [false: bb4, otherwise: bb5]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ switchInt(move _8) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + + bb4: { -+ ((_1 as Yielded).0: i32) = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ ((_1 as Yielded).0: i32) = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + + bb5: { -+ ((_1 as Yielded).0: i32) = const 7_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 ++ ((_1 as Yielded).0: i32) = const 13_i32; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + goto -> bb6; // scope 6 at $DIR/inline-generator.rs:9:14: 9:46 + } + diff --git a/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff index a8b523d06dfc7..ee8fcdcde4095 100644 --- a/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff +++ b/src/test/mir-opt/inst_combine_deref.do_not_miscompile.InstCombine.diff @@ -53,22 +53,10 @@ StorageDead(_10); // scope 4 at $DIR/inst_combine_deref.rs:60:20: 60:21 _8 = Not(move _9); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 StorageDead(_9); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - switchInt(_8) -> [false: bb1, otherwise: bb2]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 + switchInt(move _8) -> [false: bb2, otherwise: bb1]; // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 } bb1: { - _7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:23: 60:23 - StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 - _0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2 - StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2 - StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2 - return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2 - } - - bb2: { StorageLive(_11); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 core::panicking::panic(const "assertion failed: *y == 99"); // scope 4 at $DIR/inst_combine_deref.rs:60:5: 60:23 // mir::Constant @@ -81,5 +69,17 @@ // + span: $DIR/inst_combine_deref.rs:1:1: 1:1 // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [97, 115, 115, 101, 114, 116, 105, 111, 110, 32, 102, 97, 105, 108, 101, 100, 58, 32, 42, 121, 32, 61, 61, 32, 57, 57], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [67108863], len: Size { raw: 26 } }, size: Size { raw: 26 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 26 }) } } + + bb2: { + _7 = const (); // scope 4 at $DIR/inst_combine_deref.rs:60:23: 60:23 + StorageDead(_8); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + StorageDead(_7); // scope 4 at $DIR/inst_combine_deref.rs:60:22: 60:23 + _0 = const (); // scope 0 at $DIR/inst_combine_deref.rs:54:24: 61:2 + StorageDead(_4); // scope 3 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_3); // scope 2 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_2); // scope 1 at $DIR/inst_combine_deref.rs:61:1: 61:2 + StorageDead(_1); // scope 0 at $DIR/inst_combine_deref.rs:61:1: 61:2 + return; // scope 0 at $DIR/inst_combine_deref.rs:61:2: 61:2 + } } diff --git a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff index 9bd8c9cf61331..226db9558ef46 100644 --- a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff +++ b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff @@ -9,42 +9,37 @@ bb0: { + Coverage::Counter(1) for /the/src/instrument_coverage.rs:10:1 - 12:17; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 - falseUnwind -> [real: bb1, cleanup: bb6]; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 + falseUnwind -> [real: bb1, cleanup: bb5]; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 } bb1: { StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 - _2 = bar() -> [return: bb2, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 + _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 // mir::Constant // + span: /the/src/instrument_coverage.rs:12:12: 12:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } bb2: { - FakeRead(ForMatchedPlace, _2); // scope 0 at /the/src/instrument_coverage.rs:12:12: 12:17 - switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 + switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 } bb3: { -+ Coverage::Expression(4294967294) = 2 + 0 for /the/src/instrument_coverage.rs:16:1 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 -+ Coverage::Counter(2) for /the/src/instrument_coverage.rs:13:13 - 13:18; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 - falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at /the/src/instrument_coverage.rs:12:9: 14:10 ++ Coverage::Expression(4294967294) = 2 + 0 for /the/src/instrument_coverage.rs:16:1 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:16:2: 16:2 ++ Coverage::Counter(2) for /the/src/instrument_coverage.rs:13:13 - 13:18; // scope 0 at /the/src/instrument_coverage.rs:16:2: 16:2 + _0 = const (); // scope 0 at /the/src/instrument_coverage.rs:13:13: 13:18 + StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:14:9: 14:10 + return; // scope 0 at /the/src/instrument_coverage.rs:16:2: 16:2 } bb4: { + Coverage::Expression(4294967295) = 1 - 2 for /the/src/instrument_coverage.rs:14:10 - 14:11; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 _1 = const (); // scope 0 at /the/src/instrument_coverage.rs:14:10: 14:10 - StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:15:5: 15:6 + StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:14:9: 14:10 goto -> bb0; // scope 0 at /the/src/instrument_coverage.rs:11:5: 15:6 } - bb5: { - _0 = const (); // scope 0 at /the/src/instrument_coverage.rs:13:13: 13:18 - StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:15:5: 15:6 - return; // scope 0 at /the/src/instrument_coverage.rs:16:2: 16:2 - } - - bb6 (cleanup): { + bb5 (cleanup): { resume; // scope 0 at /the/src/instrument_coverage.rs:10:1: 16:2 } } diff --git a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir index 30036e4034af6..e9e5a101a64a5 100644 --- a/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir +++ b/src/test/mir-opt/issue_38669.main.SimplifyCfg-initial.after.mir @@ -19,19 +19,22 @@ fn main() -> () { } bb1: { - falseUnwind -> [real: bb2, cleanup: bb6]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 + falseUnwind -> [real: bb2, cleanup: bb5]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } bb2: { StorageLive(_3); // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 StorageLive(_4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 _4 = _1; // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - FakeRead(ForMatchedPlace, _4); // scope 1 at $DIR/issue-38669.rs:7:12: 7:24 - switchInt(_4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + switchInt(move _4) -> [false: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 } bb3: { - falseEdge -> [real: bb5, imaginary: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10 + _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 + StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 + StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 + StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 + return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2 } bb4: { @@ -43,15 +46,7 @@ fn main() -> () { goto -> bb1; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6 } - bb5: { - _0 = const (); // scope 1 at $DIR/issue-38669.rs:8:13: 8:18 - StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 - StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10 - StorageDead(_1); // scope 0 at $DIR/issue-38669.rs:12:1: 12:2 - return; // scope 0 at $DIR/issue-38669.rs:12:2: 12:2 - } - - bb6 (cleanup): { + bb5 (cleanup): { resume; // scope 0 at $DIR/issue-38669.rs:4:1: 12:2 } } diff --git a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir index 5011c2adfa581..4fc7f9daa22b9 100644 --- a/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir +++ b/src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir @@ -33,15 +33,10 @@ fn main() -> () { } bb1: { - switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + switchInt(move _2) -> [false: bb3, otherwise: bb2]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 } bb2: { - _0 = const (); // scope 1 at $DIR/issue-41888.rs:14:6: 14:6 - goto -> bb7; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 - } - - bb3: { StorageLive(_3); // scope 1 at $DIR/issue-41888.rs:9:13: 9:20 StorageLive(_4); // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 _4 = K; // scope 1 at $DIR/issue-41888.rs:9:18: 9:19 @@ -50,6 +45,11 @@ fn main() -> () { goto -> bb12; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10 } + bb3: { + _0 = const (); // scope 1 at $DIR/issue-41888.rs:14:6: 14:6 + goto -> bb7; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6 + } + bb4: { StorageDead(_3); // scope 1 at $DIR/issue-41888.rs:9:19: 9:20 _5 = discriminant(_1); // scope 1 at $DIR/issue-41888.rs:10:16: 10:24 @@ -71,6 +71,7 @@ fn main() -> () { } bb7: { + StorageDead(_2); // scope 1 at $DIR/issue-41888.rs:14:5: 14:6 goto -> bb18; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 } @@ -79,7 +80,6 @@ fn main() -> () { _8 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 _9 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 StorageDead(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 - StorageDead(_2); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2 return; // scope 0 at $DIR/issue-41888.rs:15:2: 15:2 } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff index 4db83c5c683d2..435b2a1360a6b 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff @@ -99,19 +99,10 @@ StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _9) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb2: { _13 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] @@ -143,6 +134,15 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb2: { + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb3: { (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff index 4db83c5c683d2..435b2a1360a6b 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -99,19 +99,10 @@ StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_9) -> [false: bb1, otherwise: bb2]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _9) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb1: { - StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb2: { _13 = const main::promoted[0]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // ty::Const // + ty: &[&str; 3] @@ -143,6 +134,15 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb2: { + StorageDead(_9); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb3: { (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff index 4e362f3556b20..d87cb2af8baac 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff @@ -151,23 +151,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -222,6 +209,19 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb4: { + _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb5: { StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff index 4e362f3556b20..d87cb2af8baac 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -151,23 +151,10 @@ StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - switchInt(_15) -> [false: bb3, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL } bb3: { - _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 - StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 - StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 - return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 - } - - bb4: { StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -222,6 +209,19 @@ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute::<for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar(<ZST>)) } } + bb4: { + _8 = const (); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + _0 = const (); // scope 0 at $DIR/issue-73223.rs:1:11: 9:2 + StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:9:1: 9:2 + return; // scope 0 at $DIR/issue-73223.rs:9:2: 9:2 + } + bb5: { StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL diff --git a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir index 56df50c089318..f109937dbf937 100644 --- a/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir +++ b/src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir @@ -16,12 +16,14 @@ fn main() -> () { StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6 StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 _2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12 - switchInt(_2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 } bb1: { - falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6 + _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 + StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 + StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 + return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 } bb2: { @@ -29,29 +31,22 @@ fn main() -> () { StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 StorageLive(_4); // scope 0 at $DIR/loop_test.rs:13:5: 16:6 - goto -> bb4; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 + goto -> bb3; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } bb3: { - _0 = const (); // scope 0 at $DIR/loop_test.rs:11:9: 11:15 - StorageDead(_2); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 - StorageDead(_1); // scope 0 at $DIR/loop_test.rs:12:5: 12:6 - return; // scope 0 at $DIR/loop_test.rs:17:2: 17:2 + falseUnwind -> [real: bb4, cleanup: bb5]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 } bb4: { - falseUnwind -> [real: bb5, cleanup: bb6]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6 - } - - bb5: { StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18 FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6 - goto -> bb4; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 + goto -> bb3; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 } - bb6 (cleanup): { + bb5 (cleanup): { resume; // scope 0 at $DIR/loop_test.rs:6:1: 17:2 } } diff --git a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir index 654dd8275c9de..740a6e0edb0c4 100644 --- a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir +++ b/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir @@ -3,24 +3,28 @@ fn f_u64() -> () { let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:34:16: 34:16 scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21 - debug t => _2; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - let _1: (); // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - let mut _2: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let mut _1: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:35:5: 35:21 } } bb0: { - _2 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21 - StorageLive(_1); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 - _1 = f_non_zst::<u64>(move _2) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + _2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 // mir::Constant // + span: $DIR/lower_intrinsics.rs:35:5: 35:21 // + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(Scalar(<ZST>)) } } bb1: { - StorageDead(_1); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 + StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:35:5: 35:21 _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:34:16: 36:2 return; // scope 0 at $DIR/lower_intrinsics.rs:36:2: 36:2 } diff --git a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff index 4e7cd77035eec..95beab2ec9af7 100644 --- a/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff +++ b/src/test/mir-opt/match_arm_scopes.complicated_match.SimplifyCfg-initial.after-ElaborateDrops.after.diff @@ -47,7 +47,7 @@ } bb3: { -- falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 +- falseEdge -> [real: bb13, imaginary: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:15:25: 15:38 - } - - bb4: { @@ -55,7 +55,7 @@ - } - - bb5: { -- falseEdge -> [real: bb22, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 +- falseEdge -> [real: bb20, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:21 - } - - bb6: { @@ -63,14 +63,14 @@ _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:32: 16:33 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:35: 16:36 -- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } - bb7: { + bb4: { _0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- drop(_7) -> [return: bb20, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- drop(_7) -> [return: bb18, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 + drop(_7) -> [return: bb15, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 } @@ -85,33 +85,28 @@ StorageLive(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 StorageLive(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _10 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- FakeRead(ForMatchedPlace, _10); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_10) -> [false: bb6, otherwise: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _10) -> [false: bb10, otherwise: bb9]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _10) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } - bb9: { -- falseEdge -> [real: bb11, imaginary: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -- } -- -- bb10: { + bb6: { - _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 + _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 + StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb11: { +- bb10: { + bb7: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _9 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 +- switchInt(move _9) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _9) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb12: { +- bb11: { + bb8: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -126,7 +121,7 @@ + goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb13: { +- bb12: { + bb9: { StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 @@ -135,7 +130,7 @@ + goto -> bb1; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb14: { +- bb13: { + bb10: { StorageLive(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 _6 = &(_2.0: bool); // scope 0 at $DIR/match-arm-scopes.rs:15:26: 15:27 @@ -146,33 +141,28 @@ StorageLive(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 StorageLive(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 _13 = _1; // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- FakeRead(ForMatchedPlace, _13); // scope 0 at $DIR/match-arm-scopes.rs:15:45: 15:49 -- switchInt(_13) -> [false: bb16, otherwise: bb15]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(_13) -> [false: bb11, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 +- switchInt(move _13) -> [false: bb15, otherwise: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _13) -> [false: bb12, otherwise: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb15: { -- falseEdge -> [real: bb17, imaginary: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -- } -- -- bb16: { +- bb14: { + bb11: { - _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 + _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 -- switchInt(move _12) -> [false: bb19, otherwise: bb18]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 -+ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 + StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 +- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 ++ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 } -- bb17: { +- bb15: { + bb12: { - _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 + _12 = (*_6); // scope 0 at $DIR/match-arm-scopes.rs:15:70: 15:71 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 - StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb25; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 -+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 +- switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 ++ switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb18: { +- bb16: { + bb13: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 - FakeRead(ForMatchGuard, _3); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 @@ -187,7 +177,7 @@ + goto -> bb4; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb19: { +- bb17: { + bb14: { StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 @@ -196,67 +186,67 @@ + goto -> bb2; // scope 0 at $DIR/match-arm-scopes.rs:15:42: 15:73 } -- bb20: { +- bb18: { + bb15: { StorageDead(_7); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_5); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb21: { +- bb19: { + bb16: { _0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- drop(_16) -> [return: bb23, unwind: bb27]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 +- drop(_16) -> [return: bb21, unwind: bb25]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 + drop(_16) -> [return: bb18, unwind: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 } -- bb22: { +- bb20: { + bb17: { StorageLive(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 _15 = (_2.1: bool); // scope 0 at $DIR/match-arm-scopes.rs:16:16: 16:17 StorageLive(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:19: 16:20 -- goto -> bb21; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb16; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb23: { +- bb21: { + bb18: { StorageDead(_16); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 StorageDead(_15); // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42 -- goto -> bb24; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 +- goto -> bb22; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 + goto -> bb19; // scope 0 at $DIR/match-arm-scopes.rs:14:5: 17:6 } -- bb24: { -- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- bb22: { +- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + bb19: { + goto -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb25: { +- bb23: { + bb20: { StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_6); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 -- drop(_2) -> [return: bb26, unwind: bb28]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- drop(_2) -> [return: bb24, unwind: bb26]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + drop(_2) -> [return: bb21, unwind: bb23]; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb26: { +- bb24: { + bb21: { return; // scope 0 at $DIR/match-arm-scopes.rs:18:2: 18:2 } -- bb27 (cleanup): { -- drop(_2) -> bb28; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 +- bb25 (cleanup): { +- drop(_2) -> bb26; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 + bb22 (cleanup): { + goto -> bb27; // scope 0 at $DIR/match-arm-scopes.rs:18:1: 18:2 } -- bb28 (cleanup): { +- bb26 (cleanup): { + bb23 (cleanup): { resume; // scope 0 at $DIR/match-arm-scopes.rs:13:1: 18:2 + } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff index d0b1a96b9aef7..20240348230f2 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff @@ -30,7 +30,7 @@ } bb3: { - switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 + switchInt(move _2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 } bb4: { @@ -39,7 +39,7 @@ } bb5: { - StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6 return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff index d0b1a96b9aef7..20240348230f2 100644 --- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff @@ -30,7 +30,7 @@ } bb3: { - switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 + switchInt(move _2) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:7:5: 9:6 } bb4: { @@ -39,7 +39,7 @@ } bb5: { - StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:9:5: 9:6 return; // scope 0 at $DIR/matches_reduce_branches.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff index 1f46d3777bed8..1d895852354c9 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff @@ -25,9 +25,9 @@ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 -- switchInt(_6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 -+ _7 = _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 ++ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47 + StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 @@ -45,41 +45,41 @@ bb3: { StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48 -- switchInt(_5) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 -+ _8 = _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 ++ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb4: { - _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb5: { - _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 + _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb6: { StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68 -- switchInt(_4) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 -+ _9 = _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 ++ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb7: { - _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb8: { - _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 + _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff index 1f46d3777bed8..1d895852354c9 100644 --- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff +++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff @@ -25,9 +25,9 @@ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:24: 40:28 -- switchInt(_6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 +- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 -+ _7 = _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 ++ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:42: 40:47 + StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 + goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:40:21: 40:48 @@ -45,41 +45,41 @@ bb3: { StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:40:47: 40:48 -- switchInt(_5) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 +- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 -+ _8 = _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 ++ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 + goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb4: { - _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 + _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb5: { - _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:50: 40:54 + _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:62: 40:67 goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:40:18: 40:68 } bb6: { StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:40:67: 40:68 -- switchInt(_4) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 +- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 -+ _9 = _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 ++ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 + goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb7: { - _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 + _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } bb8: { - _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:40:70: 40:74 + _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:40:82: 40:87 goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:40:15: 40:88 } diff --git a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff index 997c021d2ef21..fb25cb90021f3 100644 --- a/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff +++ b/src/test/mir-opt/multiple_return_terminators.test.MultipleReturnTerminators.diff @@ -9,21 +9,21 @@ bb0: { StorageLive(_2); // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 _2 = _1; // scope 0 at $DIR/multiple_return_terminators.rs:5:8: 5:9 - switchInt(_2) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 + switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb1: { - _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:7:12: 9:6 + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:5:10: 7:6 goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb2: { - _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:5:10: 7:6 + _0 = const (); // scope 0 at $DIR/multiple_return_terminators.rs:7:12: 9:6 goto -> bb3; // scope 0 at $DIR/multiple_return_terminators.rs:5:5: 9:6 } bb3: { - StorageDead(_2); // scope 0 at $DIR/multiple_return_terminators.rs:10:1: 10:2 + StorageDead(_2); // scope 0 at $DIR/multiple_return_terminators.rs:9:5: 9:6 return; // scope 0 at $DIR/multiple_return_terminators.rs:10:2: 10:2 } } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir index d8538a5461ed6..8c939d5fc3da5 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir @@ -5,19 +5,19 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} -| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} -| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]} +| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]} +| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} -| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} | '_#3r live at {bb1[0]} | '_#4r live at {bb1[1..=3]} -| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#5r live at {bb1[4..=7], bb2[0..=2]} | '_#3r: '_#4r due to Assignment at Single(bb1[0]) | '_#4r: '_#5r due to Assignment at Single(bb1[3]) | @@ -52,7 +52,7 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } bb1: { @@ -63,55 +63,50 @@ fn main() -> () { FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb4, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 + // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb3: { StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb5, unwind: bb7]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb4: { - StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - // mir::Constant - // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 - // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } + StorageDead(_9); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb6; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb5: { - StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb6; // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb6: { - StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb7: { - StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + StorageDead(_7); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:24:5: 24:6 + StorageDead(_6); // bb6[1]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb6[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb6[3]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb6[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb6[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8 (cleanup): { - resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb7 (cleanup): { + resume; // bb7[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir index 15aba40f169cd..00704baa6c19f 100644 --- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir +++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir @@ -5,19 +5,19 @@ | '_#1r | Local | ['_#1r] | | Inferred Region Values -| '_#0r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#0r, '_#1r} -| '_#1r | U0 | {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0], '_#1r} +| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r} +| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r} | '_#2r | U0 | {} -| '_#3r | U0 | {bb1[0..=8], bb2[0], bb4[0..=2]} -| '_#4r | U0 | {bb1[1..=8], bb2[0], bb4[0..=2]} -| '_#5r | U0 | {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]} +| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]} +| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]} | | Inference Constraints -| '_#0r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} -| '_#1r live at {bb0[0..=8], bb1[0..=8], bb2[0], bb3[0..=1], bb4[0..=3], bb5[0..=3], bb6[0..=2], bb7[0..=5], bb8[0]} +| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} +| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=1], bb4[0..=3], bb5[0..=2], bb6[0..=5], bb7[0]} | '_#3r live at {bb1[0]} | '_#4r live at {bb1[1..=3]} -| '_#5r live at {bb1[4..=8], bb2[0], bb4[0..=2]} +| '_#5r live at {bb1[4..=7], bb2[0..=2]} | '_#3r: '_#4r due to Assignment at Single(bb1[0]) | '_#4r: '_#5r due to Assignment at Single(bb1[3]) | @@ -52,7 +52,7 @@ fn main() -> () { _3 = const Const(Value(Scalar(0x0000000000000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17 _4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 _5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 - assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb8]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 + assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb7]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18 } bb1: { @@ -63,55 +63,50 @@ fn main() -> () { FakeRead(ForLet, _6); // bb1[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10 StorageLive(_7); // bb1[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 _7 = const Const(Value(Scalar(0x01)): bool); // bb1[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - FakeRead(ForMatchedPlace, _7); // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12 - switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + switchInt(move _7) -> [Const(Value(Scalar(0x00)): bool): bb3, otherwise: bb2]; // bb1[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb2: { - falseEdge -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageLive(_8); // bb2[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + StorageLive(_9); // bb2[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _9 = (*_6); // bb2[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 + _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb4, unwind: bb7]; // bb2[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 + // mir::Constant + // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 + // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb3: { StorageLive(_10); // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 - _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb6, unwind: bb8]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 + _10 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x0000000000000016)): usize)) -> [return: bb5, unwind: bb7]; // bb3[1]: scope 3 at $DIR/region-subtyping-basic.rs:23:9: 23:18 // mir::Constant // + span: $DIR/region-subtyping-basic.rs:23:9: 23:14 // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } } bb4: { - StorageLive(_8); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - StorageLive(_9); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _9 = (*_6); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:21:15: 21:17 - _8 = Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb5, unwind: bb8]; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18 - // mir::Constant - // + span: $DIR/region-subtyping-basic.rs:21:9: 21:14 - // + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) } + StorageDead(_9); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 + StorageDead(_8); // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb4[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 + goto -> bb6; // bb4[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb5: { - StorageDead(_9); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:17: 21:18 - StorageDead(_8); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:13: 22:6 - goto -> bb7; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 + StorageDead(_10); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 + _0 = const Const(Value(Scalar(<ZST>)): ()); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 + goto -> bb6; // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 } bb6: { - StorageDead(_10); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:23:18: 23:19 - _0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:22:12: 24:6 - goto -> bb7; // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6 - } - - bb7: { - StorageDead(_6); // bb7[0]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_3); // bb7[1]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_2); // bb7[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_1); // bb7[3]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - StorageDead(_7); // bb7[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 - return; // bb7[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 + StorageDead(_7); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:24:5: 24:6 + StorageDead(_6); // bb6[1]: scope 2 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_3); // bb6[2]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_2); // bb6[3]: scope 1 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + StorageDead(_1); // bb6[4]: scope 0 at $DIR/region-subtyping-basic.rs:25:1: 25:2 + return; // bb6[5]: scope 0 at $DIR/region-subtyping-basic.rs:25:2: 25:2 } - bb8 (cleanup): { - resume; // bb8[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 + bb7 (cleanup): { + resume; // bb7[0]: scope 0 at $DIR/region-subtyping-basic.rs:16:1: 25:2 } } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff index 5588877aec950..52e705fdbeba8 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff @@ -21,31 +21,26 @@ } - bb2: { -- nop; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb1: { -+ switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ switchInt(move _2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } - bb3: { -- goto -> bb5; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -- } -- -- bb4: { + bb2: { - _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 + return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } -- bb5: { +- bb4: { + bb3: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 + _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 + goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - -- bb6 (cleanup): { +- bb5 (cleanup): { - resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 } } diff --git a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff index e62935225d805..fef3ae2e461d8 100644 --- a/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff +++ b/src/test/mir-opt/simplify_cfg.main.SimplifyCfg-initial.diff @@ -9,69 +9,63 @@ bb0: { - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -+ falseUnwind -> [real: bb1, cleanup: bb6]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 ++ falseUnwind -> [real: bb1, cleanup: bb5]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } bb1: { -- falseUnwind -> [real: bb2, cleanup: bb11]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 +- falseUnwind -> [real: bb2, cleanup: bb10]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - - bb2: { StorageLive(_2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- _2 = bar() -> [return: bb3, unwind: bb11]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -+ _2 = bar() -> [return: bb2, unwind: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 +- _2 = bar() -> [return: bb3, unwind: bb10]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 ++ _2 = bar() -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 // mir::Constant // + span: $DIR/simplify_cfg.rs:7:12: 7:15 // + literal: Const { ty: fn() -> bool {bar}, val: Value(Scalar(<ZST>)) } } - bb3: { +- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb2: { - FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17 -- switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ switchInt(_2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 ++ switchInt(move _2) -> [false: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 } - bb4: { -- falseEdge -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + bb3: { -+ falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 + _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 ++ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 ++ return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 } - bb5: { + bb4: { _1 = const (); // scope 0 at $DIR/simplify_cfg.rs:9:10: 9:10 -- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 -+ StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 -+ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 - } - -- bb6: { -+ bb5: { - _0 = const (); // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 -- goto -> bb10; // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18 +- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb7: { +- bb6: { - unreachable; // scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10 - } - -- bb8: { -- goto -> bb9; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 +- bb7: { +- goto -> bb8; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10 - } - -- bb9: { - StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 +- bb8: { + StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 - goto -> bb1; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 -- } -- -- bb10: { -- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6 - return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 ++ goto -> bb0; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6 } -- bb11 (cleanup): { -+ bb6 (cleanup): { +- bb9: { +- StorageDead(_2); // scope 0 at $DIR/simplify_cfg.rs:9:9: 9:10 +- return; // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2 +- } +- +- bb10 (cleanup): { ++ bb5 (cleanup): { resume; // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2 } } diff --git a/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff b/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff index bf3caf505eda1..2cd57cb8474ec 100644 --- a/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff +++ b/src/test/mir-opt/simplify_if.main.SimplifyBranches-after-const-prop.diff @@ -9,16 +9,11 @@ bb0: { StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 _1 = const false; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13 -- switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 -+ goto -> bb1; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 +- switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 ++ goto -> bb2; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 } bb1: { - _0 = const (); // scope 0 at $DIR/simplify_if.rs:8:6: 8:6 - goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 - } - - bb2: { StorageLive(_2); // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 _2 = noop() -> bb3; // scope 0 at $DIR/simplify_if.rs:7:9: 7:15 // mir::Constant @@ -26,6 +21,11 @@ // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) } } + bb2: { + _0 = const (); // scope 0 at $DIR/simplify_if.rs:8:6: 8:6 + goto -> bb4; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6 + } + bb3: { StorageDead(_2); // scope 0 at $DIR/simplify_if.rs:7:15: 7:16 _0 = const (); // scope 0 at $DIR/simplify_if.rs:6:14: 8:6 @@ -33,7 +33,7 @@ } bb4: { - StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:9:1: 9:2 + StorageDead(_1); // scope 0 at $DIR/simplify_if.rs:8:5: 8:6 return; // scope 0 at $DIR/simplify_if.rs:9:2: 9:2 } } diff --git a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff index 9f7507a5cadb2..70725e5f14f7d 100644 --- a/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff +++ b/src/test/mir-opt/simplify_locals_fixedpoint.foo.SimplifyLocals.diff @@ -47,21 +47,21 @@ _8 = _6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13 _7 = Gt(move _8, const 42_u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20 StorageDead(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20 - switchInt(_7) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 + switchInt(move _7) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb4: { - _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:10: 7:10 + _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10 goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb5: { - _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10 + _0 = const (); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:10: 7:10 goto -> bb6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10 } bb6: { - StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6 + StorageDead(_7); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:7:9: 7:10 StorageDead(_6); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6 goto -> bb7; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6 } diff --git a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff index 6f44de1e4a4f5..23a3fbd5f4651 100644 --- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff @@ -44,18 +44,18 @@ - StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16 - _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16 -- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 +- switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - - bb4: { -- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20 -- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10 +- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20 +- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10 - goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - - bb5: { -- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20 -- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10 +- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20 +- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10 - goto -> bb6; // scope 2 at $DIR/unreachable.rs:12:9: 16:10 - } - diff --git a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff index 9bca06a3e2b28..3eda18317057b 100644 --- a/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm.main.UnreachablePropagation.diff @@ -46,18 +46,18 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 StorageLive(_6); // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16 _6 = const true; // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16 - switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 + switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } bb4: { - _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 + _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } bb5: { - _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10 + _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10 goto -> bb6; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10 } diff --git a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff index cbc24eab0f568..d0d52e869d624 100644 --- a/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_asm_2.main.UnreachablePropagation.diff @@ -49,21 +49,10 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 StorageLive(_6); // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16 _6 = const true; // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16 - switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 + switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 } bb4: { - StorageLive(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41 - llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39 - _8 = const (); // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 - StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41 - _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20 - _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 -- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 -+ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 - } - - bb5: { StorageLive(_7); // scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41 llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39 _7 = const (); // scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41 @@ -71,6 +60,17 @@ _4 = const 21_i32; // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20 _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10 - goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 ++ unreachable; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 + } + + bb5: { + StorageLive(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39 + _8 = const (); // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41 + StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41 + _4 = const 42_i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20 + _5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10 +- goto -> bb6; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10 - } - - bb6: { diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff index fd8286f1c4f39..2c0cc04085efa 100644 --- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff +++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff @@ -45,16 +45,11 @@ StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 _6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13 -- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- switchInt(move _6) -> [false: bb5, otherwise: bb4]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 + goto -> bb4; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 } bb4: { -- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10 -- goto -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 -- } -- -- bb5: { - _5 = loop_forever() -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 + _5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27 // mir::Constant @@ -62,8 +57,12 @@ // + literal: Const { ty: fn() {loop_forever}, val: Value(Scalar(<ZST>)) } } + bb5: { +- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:17:10: 17:10 +- goto -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10 +- } +- - bb6: { -+ bb5: { StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10 StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22 diff --git a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir index c27c68d870247..0c034891a80db 100644 --- a/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir +++ b/src/test/mir-opt/while_storage.while_loop.PreCodegen.after.mir @@ -40,19 +40,19 @@ fn while_loop(_1: bool) -> () { bb4: { StorageDead(_5); // scope 0 at $DIR/while-storage.rs:11:22: 11:23 - switchInt(_4) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10 + switchInt(move _4) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10 } bb5: { - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb0; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 + _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18 + StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + goto -> bb7; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 } bb6: { - _0 = const (); // scope 0 at $DIR/while-storage.rs:12:13: 12:18 - StorageDead(_4); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 - goto -> bb7; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 + StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 + StorageDead(_2); // scope 0 at $DIR/while-storage.rs:14:5: 14:6 + goto -> bb0; // scope 0 at $DIR/while-storage.rs:10:5: 14:6 } bb7: { diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.main.-------.InstrumentCoverage.0.html index 9834124694ec7..176587af25be0 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.main.-------.InstrumentCoverage.0.html @@ -77,27 +77,24 @@ 16:11-16:24: @2[3]: _4 = Gt(move _5, const 0_i32) 16:11-16:24: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>countdown > 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="17:12-17:21: @5[3]: _8 = _1 -17:12-17:25: @5[4]: _7 = Lt(move _8, const 5_i32) -17:12-17:25: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown < 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:13-18:31: @8.Call: _9 = might_abort(const false) -> [return: bb9, unwind: bb22] -17:26-19:10: @9[1]: _6 = const ()"><span class="annotation">@6,8,9⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="18:13-18:31: @8.Call: _9 = might_abort(const false) -> [return: bb9, unwind: bb22] -17:26-19:10: @9[1]: _6 = const ()"> might_abort(false);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="18:13-18:31: @8.Call: _9 = might_abort(const false) -> [return: bb9, unwind: bb22] -17:26-19:10: @9[1]: _6 = const ()"> }<span class="annotation">⦉@6,8,9</span></span></span><span><span class="code even" style="--layer: 1" title="19:10-19:10: @7[0]: _6 = const ()"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +17:12-17:25: @5[4]: _7 = Lt(move _8, const 5_i32)"><span class="annotation">@3,5⦊</span>countdown < 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:13-18:31: @6.Call: _9 = might_abort(const false) -> [return: bb8, unwind: bb19] +17:26-19:10: @8[1]: _6 = const ()"><span class="annotation">@6,8⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:13-18:31: @6.Call: _9 = might_abort(const false) -> [return: bb8, unwind: bb19] +17:26-19:10: @8[1]: _6 = const ()"> might_abort(false);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:13-18:31: @6.Call: _9 = might_abort(const false) -> [return: bb8, unwind: bb19] +17:26-19:10: @8[1]: _6 = const ()"> }<span class="annotation">⦉@6,8</span></span></span><span><span class="code even" style="--layer: 1" title="19:10-19:10: @7[0]: _6 = const ()"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> // See discussion (below the `Notes` section) on coverage results for the closing brace.</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="21:12-21:21: @10[5]: _12 = _1 -21:12-21:25: @10[6]: _11 = Lt(move _12, const 5_i32) -21:12-21:25: @10[8]: FakeRead(ForMatchedPlace, _11)"><span class="annotation">@10⦊</span>countdown < 5<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="21:28-21:46: @13.Call: _13 = might_abort(const false) -> [return: bb14, unwind: bb22] -21:26-21:49: @14[1]: _10 = const ()"><span class="annotation">@11,13,14⦊</span>{ might_abort(false); }<span class="annotation">⦉@11,13,14</span></span></span><span><span class="code odd" style="--layer: 1" title="21:49-21:49: @12[0]: _10 = const ()"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span><span class="code" style="--layer: 0"> // Counts for different regions on one line.</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="21:12-21:21: @9[5]: _12 = _1 +21:12-21:25: @9[6]: _11 = Lt(move _12, const 5_i32)"><span class="annotation">@9⦊</span>countdown < 5<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="21:28-21:46: @10.Call: _13 = might_abort(const false) -> [return: bb12, unwind: bb19] +21:26-21:49: @12[1]: _10 = const ()"><span class="annotation">@10,12⦊</span>{ might_abort(false); }<span class="annotation">⦉@10,12</span></span></span><span><span class="code odd" style="--layer: 1" title="21:49-21:49: @11[0]: _10 = const ()"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"> // Counts for different regions on one line.</span></span> <span class="line"><span class="code" style="--layer: 0"> // For the following example, the closing brace is the last character on the line.</span></span> <span class="line"><span class="code" style="--layer: 0"> // This shows the character after the closing brace is highlighted, even if that next</span></span> <span class="line"><span class="code" style="--layer: 0"> // character is a newline.</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="25:12-25:21: @15[5]: _16 = _1 -25:12-25:25: @15[6]: _15 = Lt(move _16, const 5_i32) -25:12-25:25: @15[8]: FakeRead(ForMatchedPlace, _15)"><span class="annotation">@15⦊</span>countdown < 5<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:28-25:46: @18.Call: _17 = might_abort(const false) -> [return: bb19, unwind: bb22] -25:26-25:49: @19[1]: _14 = const ()"><span class="annotation">@16,18,19⦊</span>{ might_abort(false); }<span class="annotation">⦉@16,18,19</span></span></span><span><span class="code even" style="--layer: 1" title="25:49-25:49: @17[0]: _14 = const ()"><span class="annotation">@17⦊</span>‸<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:23: @20[2]: _18 = CheckedSub(_1, const 1_i32) -26:9-26:23: @21[0]: _1 = move (_18.0: i32)"><span class="annotation">@20,21⦊</span>countdown -= 1<span class="annotation">⦉@20,21</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="25:12-25:21: @13[5]: _16 = _1 +25:12-25:25: @13[6]: _15 = Lt(move _16, const 5_i32)"><span class="annotation">@13⦊</span>countdown < 5<span class="annotation">⦉@13</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:28-25:46: @14.Call: _17 = might_abort(const false) -> [return: bb16, unwind: bb19] +25:26-25:49: @16[1]: _14 = const ()"><span class="annotation">@14,16⦊</span>{ might_abort(false); }<span class="annotation">⦉@14,16</span></span></span><span><span class="code even" style="--layer: 1" title="25:49-25:49: @15[0]: _14 = const ()"><span class="annotation">@15⦊</span>‸<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:23: @17[2]: _18 = CheckedSub(_1, const 1_i32) +26:9-26:23: @18[0]: _1 = move (_18.0: i32)"><span class="annotation">@17,18⦊</span>countdown -= 1<span class="annotation">⦉@17,18</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:8-28:10: @4[4]: _20 = () 28:5-28:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _20) diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.might_abort.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.might_abort.-------.InstrumentCoverage.0.html index ab7108ae570b7..b058dce298342 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.might_abort.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.abort/abort.might_abort.-------.InstrumentCoverage.0.html @@ -70,36 +70,35 @@ </head> <body> <div class="code" style="counter-reset: line 4"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0⦊</span>fn might_abort(should_abort: bool) <span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">{</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="6:8-6:20: @0[1]: _2 = _1 -6:8-6:20: @0[2]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>should_abort<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:18-7:31: @3[6]: _33 = const might_abort::promoted[3] -7:18-7:31: @3[7]: _9 = &(*_33) -7:18-7:31: @3[8]: _8 = &(*_9) -7:18-7:31: @3[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) -7:9-7:33: @3[15]: _15 = () -7:9-7:33: @3[16]: FakeRead(ForMatchedPlace, _15) -7:9-7:33: @3[17]: _32 = const might_abort::promoted[2] -7:9-7:33: @3[18]: _13 = &(*_32) -7:9-7:33: @3[19]: _12 = &(*_13) -7:9-7:33: @3[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -7:9-7:33: @3.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb4, unwind: bb8] -7:9-7:33: @4.Call: _5 = _print(move _6) -> [return: bb5, unwind: bb8] -7:9-7:33: @5[5]: _4 = const () -8:9-8:37: @5.Call: begin_panic::<&str>(const "panics and aborts") -> bb8"><span class="annotation">@1,3,4,5⦊</span>println!("aborting...");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="7:18-7:31: @3[6]: _33 = const might_abort::promoted[3] -7:18-7:31: @3[7]: _9 = &(*_33) -7:18-7:31: @3[8]: _8 = &(*_9) -7:18-7:31: @3[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) -7:9-7:33: @3[15]: _15 = () -7:9-7:33: @3[16]: FakeRead(ForMatchedPlace, _15) -7:9-7:33: @3[17]: _32 = const might_abort::promoted[2] -7:9-7:33: @3[18]: _13 = &(*_32) -7:9-7:33: @3[19]: _12 = &(*_13) -7:9-7:33: @3[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -7:9-7:33: @3.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb4, unwind: bb8] -7:9-7:33: @4.Call: _5 = _print(move _6) -> [return: bb5, unwind: bb8] -7:9-7:33: @5[5]: _4 = const () -8:9-8:37: @5.Call: begin_panic::<&str>(const "panics and aborts") -> bb8"> panic!("panics and aborts");<span class="annotation">⦉@1,3,4,5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="6:8-6:20: @0[1]: _2 = _1"><span class="annotation">@0⦊</span>should_abort<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:18-7:31: @1[6]: _33 = const might_abort::promoted[3] +7:18-7:31: @1[7]: _9 = &(*_33) +7:18-7:31: @1[8]: _8 = &(*_9) +7:18-7:31: @1[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) +7:9-7:33: @1[15]: _15 = () +7:9-7:33: @1[16]: FakeRead(ForMatchedPlace, _15) +7:9-7:33: @1[17]: _32 = const might_abort::promoted[2] +7:9-7:33: @1[18]: _13 = &(*_32) +7:9-7:33: @1[19]: _12 = &(*_13) +7:9-7:33: @1[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +7:9-7:33: @1.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb3, unwind: bb7] +7:9-7:33: @3.Call: _5 = _print(move _6) -> [return: bb4, unwind: bb7] +7:9-7:33: @4[5]: _4 = const () +8:9-8:37: @4.Call: begin_panic::<&str>(const "panics and aborts") -> bb7"><span class="annotation">@1,3,4⦊</span>println!("aborting...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="7:18-7:31: @1[6]: _33 = const might_abort::promoted[3] +7:18-7:31: @1[7]: _9 = &(*_33) +7:18-7:31: @1[8]: _8 = &(*_9) +7:18-7:31: @1[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) +7:9-7:33: @1[15]: _15 = () +7:9-7:33: @1[16]: FakeRead(ForMatchedPlace, _15) +7:9-7:33: @1[17]: _32 = const might_abort::promoted[2] +7:9-7:33: @1[18]: _13 = &(*_32) +7:9-7:33: @1[19]: _12 = &(*_13) +7:9-7:33: @1[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +7:9-7:33: @1.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb3, unwind: bb7] +7:9-7:33: @3.Call: _5 = _print(move _6) -> [return: bb4, unwind: bb7] +7:9-7:33: @4[5]: _4 = const () +8:9-8:37: @4.Call: begin_panic::<&str>(const "panics and aborts") -> bb7"> panic!("panics and aborts");<span class="annotation">⦉@1,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else </span><span><span class="code even" style="--layer: 1" title="10:18-10:31: @2[6]: _31 = const might_abort::promoted[1] 10:18-10:31: @2[7]: _23 = &(*_31) 10:18-10:31: @2[8]: _22 = &(*_23) @@ -110,11 +109,11 @@ 10:9-10:33: @2[18]: _27 = &(*_30) 10:9-10:33: @2[19]: _26 = &(*_27) 10:9-10:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -10:9-10:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -10:9-10:33: @7[5]: _18 = const () -9:12-11:6: @7[7]: _0 = const () -12:2-12:2: @7.Return: return"><span class="annotation">@2,6,7⦊</span>{</span></span> +10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +10:9-10:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +10:9-10:33: @6[5]: _18 = const () +9:12-11:6: @6[7]: _0 = const () +12:2-12:2: @6.Return: return"><span class="annotation">@2,5,6⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="10:18-10:31: @2[6]: _31 = const might_abort::promoted[1] 10:18-10:31: @2[7]: _23 = &(*_31) 10:18-10:31: @2[8]: _22 = &(*_23) @@ -125,11 +124,11 @@ 10:9-10:33: @2[18]: _27 = &(*_30) 10:9-10:33: @2[19]: _26 = &(*_27) 10:9-10:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -10:9-10:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -10:9-10:33: @7[5]: _18 = const () -9:12-11:6: @7[7]: _0 = const () -12:2-12:2: @7.Return: return"> println!("Don't Panic");</span></span> +10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +10:9-10:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +10:9-10:33: @6[5]: _18 = const () +9:12-11:6: @6[7]: _0 = const () +12:2-12:2: @6.Return: return"> println!("Don't Panic");</span></span> <span class="line"><span class="code even" style="--layer: 1" title="10:18-10:31: @2[6]: _31 = const might_abort::promoted[1] 10:18-10:31: @2[7]: _23 = &(*_31) 10:18-10:31: @2[8]: _22 = &(*_23) @@ -140,11 +139,11 @@ 10:9-10:33: @2[18]: _27 = &(*_30) 10:9-10:33: @2[19]: _26 = &(*_27) 10:9-10:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -10:9-10:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -10:9-10:33: @7[5]: _18 = const () -9:12-11:6: @7[7]: _0 = const () -12:2-12:2: @7.Return: return"> }</span></span> +10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +10:9-10:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +10:9-10:33: @6[5]: _18 = const () +9:12-11:6: @6[7]: _0 = const () +12:2-12:2: @6.Return: return"> }</span></span> <span class="line"><span class="code even" style="--layer: 1" title="10:18-10:31: @2[6]: _31 = const might_abort::promoted[1] 10:18-10:31: @2[7]: _23 = &(*_31) 10:18-10:31: @2[8]: _22 = &(*_23) @@ -155,10 +154,10 @@ 10:9-10:33: @2[18]: _27 = &(*_30) 10:9-10:33: @2[19]: _26 = &(*_27) 10:9-10:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -10:9-10:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -10:9-10:33: @7[5]: _18 = const () -9:12-11:6: @7[7]: _0 = const () -12:2-12:2: @7.Return: return">}<span class="annotation">⦉@2,6,7</span></span></span></span></div> +10:9-10:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +10:9-10:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +10:9-10:33: @6[5]: _18 = const () +9:12-11:6: @6[7]: _0 = const () +12:2-12:2: @6.Return: return">}<span class="annotation">⦉@2,5,6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html index f24de8e08432a..365e94cd31e50 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.main.-------.InstrumentCoverage.0.html @@ -77,22 +77,20 @@ 11:11-11:24: @2[3]: _4 = Gt(move _5, const 0_i32) 11:11-11:24: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>countdown > 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="12:12-12:21: @5[3]: _8 = _1 -12:12-12:26: @5[4]: _7 = Eq(move _8, const 1_i32) -12:12-12:26: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] -12:27-14:10: @9[1]: _6 = const ()"><span class="annotation">@6,8,9⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] -12:27-14:10: @9[1]: _6 = const ()"> might_fail_assert(3);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @8.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb9, unwind: bb17] -12:27-14:10: @9[1]: _6 = const ()"> }<span class="annotation">⦉@6,8,9</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="14:19-14:28: @7[2]: _11 = _1 -14:19-14:32: @7[3]: _10 = Lt(move _11, const 5_i32) -14:19-14:32: @7[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] -14:33-16:10: @13[1]: _6 = const ()"><span class="annotation">@10,12,13⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] -14:33-16:10: @13[1]: _6 = const ()"> might_fail_assert(2);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @12.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb13, unwind: bb17] -14:33-16:10: @13[1]: _6 = const ()"> }<span class="annotation">⦉@10,12,13</span></span></span><span><span class="code even" style="--layer: 1" title="16:10-16:10: @11[0]: _6 = const ()"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:23: @15[2]: _13 = CheckedSub(_1, const 1_i32) -17:9-17:23: @16[0]: _1 = move (_13.0: i32)"><span class="annotation">@15,16⦊</span>countdown -= 1<span class="annotation">⦉@15,16</span></span></span><span class="code" style="--layer: 0">;</span></span> +12:12-12:26: @5[4]: _7 = Eq(move _8, const 1_i32)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:13-13:33: @6.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb8, unwind: bb15] +12:27-14:10: @8[1]: _6 = const ()"><span class="annotation">@6,8⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @6.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb8, unwind: bb15] +12:27-14:10: @8[1]: _6 = const ()"> might_fail_assert(3);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:13-13:33: @6.Call: _9 = might_fail_assert(const 3_u32) -> [return: bb8, unwind: bb15] +12:27-14:10: @8[1]: _6 = const ()"> }<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="14:19-14:28: @7[2]: _11 = _1 +14:19-14:32: @7[3]: _10 = Lt(move _11, const 5_i32)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:13-15:33: @9.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb11, unwind: bb15] +14:33-16:10: @11[1]: _6 = const ()"><span class="annotation">@9,11⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @9.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb11, unwind: bb15] +14:33-16:10: @11[1]: _6 = const ()"> might_fail_assert(2);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="15:13-15:33: @9.Call: _12 = might_fail_assert(const 2_u32) -> [return: bb11, unwind: bb15] +14:33-16:10: @11[1]: _6 = const ()"> }<span class="annotation">⦉@9,11</span></span></span><span><span class="code even" style="--layer: 1" title="16:10-16:10: @10[0]: _6 = const ()"><span class="annotation">@10⦊</span>‸<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:9-17:23: @13[2]: _13 = CheckedSub(_1, const 1_i32) +17:9-17:23: @14[0]: _1 = move (_13.0: i32)"><span class="annotation">@13,14⦊</span>countdown -= 1<span class="annotation">⦉@13,14</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="19:8-19:10: @4[4]: _15 = () 19:5-19:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15) diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.might_fail_assert.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.might_fail_assert.-------.InstrumentCoverage.0.html index 13cfebfe6e50e..823bb0cfd8404 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.might_fail_assert.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.assert/assert.might_fail_assert.-------.InstrumentCoverage.0.html @@ -80,18 +80,18 @@ 5:5-5:48: @0[22]: _15 = (_13.0: &u32) 5:5-5:48: @0[25]: _17 = &(*_15) 5:5-5:48: @0[27]: _18 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -5:5-5:48: @0.Call: _16 = ArgumentV1::new::<u32>(move _17, move _18) -> [return: bb1, unwind: bb13] +5:5-5:48: @0.Call: _16 = ArgumentV1::new::<u32>(move _17, move _18) -> [return: bb1, unwind: bb12] 5:5-5:48: @1[2]: _12 = [move _16] 5:5-5:48: @1[5]: _11 = &_12 5:5-5:48: @1[6]: _10 = &(*_11) 5:5-5:48: @1[7]: _9 = move _10 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -5:5-5:48: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb13] -5:5-5:48: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb13] +5:5-5:48: @1.Call: _4 = Arguments::new_v1(move _5, move _9) -> [return: bb2, unwind: bb12] +5:5-5:48: @2.Call: _3 = _print(move _4) -> [return: bb3, unwind: bb12] 5:5-5:48: @3[6]: _2 = const ()"><span class="annotation">@0,1,2,3,4⦊</span>println!("does 1 + 1 = {}?", one_plus_one);<span class="annotation">⦉@0,1,2,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> assert_eq!(</span><span><span class="code even" style="--layer: 1" title="6:16-6:21: @3[11]: _23 = CheckedAdd(const 1_u32, const 1_u32)"><span class="annotation">@0,1,2,3,4⦊</span>1 + 1<span class="annotation">⦉@0,1,2,3,4</span></span></span><span class="code" style="--layer: 0">, one_plus_one, </span><span><span class="code odd" style="--layer: 1" title="6:37-6:61: @7[28]: _70 = const might_fail_assert::promoted[1] -6:37-6:61: @7[29]: _50 = &(*_70) -6:37-6:61: @7[30]: _49 = &(*_50) -6:37-6:61: @7[31]: _48 = move _49 as &[&str] (Pointer(Unsize))"><span class="annotation">@5,7,8,9,10,11,12⦊</span>"the argument was wrong"<span class="annotation">⦉@5,7,8,9,10,11,12</span></span></span><span class="code" style="--layer: 0">);</span></span> +<span class="line"><span class="code" style="--layer: 0"> assert_eq!(</span><span><span class="code even" style="--layer: 1" title="6:16-6:21: @3[11]: _23 = CheckedAdd(const 1_u32, const 1_u32)"><span class="annotation">@0,1,2,3,4⦊</span>1 + 1<span class="annotation">⦉@0,1,2,3,4</span></span></span><span class="code" style="--layer: 0">, one_plus_one, </span><span><span class="code odd" style="--layer: 1" title="6:37-6:61: @5[28]: _70 = const might_fail_assert::promoted[1] +6:37-6:61: @5[29]: _50 = &(*_70) +6:37-6:61: @5[30]: _49 = &(*_50) +6:37-6:61: @5[31]: _48 = move _49 as &[&str] (Pointer(Unsize))"><span class="annotation">@5,7,8,9,10,11⦊</span>"the argument was wrong"<span class="annotation">⦉@5,7,8,9,10,11</span></span></span><span class="code" style="--layer: 0">);</span></span> <span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="7:2-7:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.c-{closure#0}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.c-{closure#0}.-------.InstrumentCoverage.0.html index 82a22ccb4e673..21bfce701fe6e 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.c-{closure#0}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.c-{closure#0}.-------.InstrumentCoverage.0.html @@ -70,15 +70,13 @@ </head> <body> <div class="code" style="counter-reset: line 4"><span class="line"> <span><span class="code even" style="--layer: 1" title="6:8-6:9: @0[5]: _5 = _3 -6:8-6:14: @0[6]: _4 = Eq(move _5, const 8_u8) -6:8-6:14: @0[8]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> +6:8-6:14: @0[6]: _4 = Eq(move _5, const 8_u8)"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="6:8-6:9: @0[5]: _5 = _3 -6:8-6:14: @0[6]: _4 = Eq(move _5, const 8_u8) -6:8-6:14: @0[8]: FakeRead(ForMatchedPlace, _4)"> if x == 8<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:9-7:10: @3[0]: _0 = const 1_u8"><span class="annotation">@1,3⦊</span>1<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +6:8-6:14: @0[6]: _4 = Eq(move _5, const 8_u8)"> if x == 8<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="7:9-7:10: @1[0]: _0 = const 1_u8"><span class="annotation">@1⦊</span>1<span class="annotation">⦉@1</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="9:9-9:10: @2[0]: _0 = const 0_u8"><span class="annotation">@2⦊</span>0<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="11:2-11:2: @4.Return: return"><span class="annotation">@4⦊</span>‸<span class="annotation">⦉@4</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="11:2-11:2: @3.Return: return"><span class="annotation">@3⦊</span>‸<span class="annotation">⦉@3</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j-c.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j-c.-------.InstrumentCoverage.0.html index a8e2d7e2f396e..e6384b7598fc2 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j-c.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.async/async.j-c.-------.InstrumentCoverage.0.html @@ -70,12 +70,10 @@ </head> <body> <div class="code" style="counter-reset: line 50"><span class="line"> <span><span class="code even" style="--layer: 1" title="52:12-52:13: @0[2]: _3 = _1 -52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8) -52:12-52:18: @0[5]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>fn c(x: u8) -> u8 {</span></span> +52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"><span class="annotation">@0⦊</span>fn c(x: u8) -> u8 {</span></span> <span class="line"><span class="code even" style="--layer: 1" title="52:12-52:13: @0[2]: _3 = _1 -52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8) -52:12-52:18: @0[5]: FakeRead(ForMatchedPlace, _2)"> if x == 8<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="53:13-53:14: @3[0]: _0 = const 1_u8"><span class="annotation">@1,3⦊</span>1<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"> // This line appears covered, but the 1-character expression span covering the `1`</span></span> +52:12-52:18: @0[3]: _2 = Eq(move _3, const 8_u8)"> if x == 8<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="53:13-53:14: @1[0]: _0 = const 1_u8"><span class="annotation">@1⦊</span>1<span class="annotation">⦉@1</span></span></span><span class="code" style="--layer: 0"> // This line appears covered, but the 1-character expression span covering the `1`</span></span> <span class="line"><span class="code" style="--layer: 0"> // is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because</span></span> <span class="line"><span class="code" style="--layer: 0"> // `fn j()` executes the open brace for the funciton body, followed by the function's</span></span> <span class="line"><span class="code" style="--layer: 0"> // first executable statement, `match x`. Inner function declarations are not</span></span> @@ -87,6 +85,6 @@ <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="63:13-63:14: @2[0]: _0 = const 0_u8"><span class="annotation">@2⦊</span>0<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="65:6-65:6: @4.Return: return"><span class="annotation">@4⦊</span>‸<span class="annotation">⦉@4</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="65:6-65:6: @3.Return: return"><span class="annotation">@3⦊</span>‸<span class="annotation">⦉@3</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html index 523e839a918dd..b4b171dc955cb 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#0}.-------.InstrumentCoverage.0.html @@ -72,28 +72,25 @@ <div class="code" style="counter-reset: line 32"><span class="line"> <span class="code" style="--layer: 0">||</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="35:29-35:30: @0[1]: _2 = const 0_i32 35:13-35:26: @0[2]: FakeRead(ForLet, _2) -36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool)) -36:12-36:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> +36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool))"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="35:29-35:30: @0[1]: _2 = const 0_i32 35:13-35:26: @0[2]: FakeRead(ForLet, _2) -36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool)) -36:12-36:20: @0[6]: FakeRead(ForMatchedPlace, _4)"> let mut countdown = 0;</span></span> +36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool))"> let mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="35:29-35:30: @0[1]: _2 = const 0_i32 35:13-35:26: @0[2]: FakeRead(ForLet, _2) -36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool)) -36:12-36:20: @0[6]: FakeRead(ForMatchedPlace, _4)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 -36:21-38:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 -36:21-38:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @3[0]: _2 = const 10_i32 -36:21-38:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="38:10-38:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" -39:9-39:23: @4[5]: _5 = &(*_6) -39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -40:6-40:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 2".to_owned()</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="39:9-39:23: @4[4]: _6 = const "alt string 2" -39:9-39:23: @4[5]: _5 = &(*_6) -39:9-39:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -40:6-40:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +36:12-36:20: @0[5]: _4 = (*((*_1).0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="37:13-37:27: @1[0]: _2 = const 10_i32 +36:21-38:10: @1[1]: _3 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @1[0]: _2 = const 10_i32 +36:21-38:10: @1[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="37:13-37:27: @1[0]: _2 = const 10_i32 +36:21-38:10: @1[1]: _3 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="38:10-38:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="39:9-39:23: @3[4]: _6 = const "alt string 2" +39:9-39:23: @3[5]: _5 = &(*_6) +39:9-39:34: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +40:6-40:6: @4.Return: return"><span class="annotation">@3,4⦊</span>"alt string 2".to_owned()</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="39:9-39:23: @3[4]: _6 = const "alt string 2" +39:9-39:23: @3[5]: _5 = &(*_6) +39:9-39:34: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +40:6-40:6: @4.Return: return"> }<span class="annotation">⦉@3,4</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#10}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#10}.-------.InstrumentCoverage.0.html index fdae1a012bc72..c1edc3eb929b0 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#10}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#10}.-------.InstrumentCoverage.0.html @@ -72,28 +72,25 @@ <div class="code" style="counter-reset: line 17"><span class="line"> <span class="code" style="--layer: 0">||</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:37-20:38: @0[1]: _2 = const 0_i32 20:21-20:34: @0[2]: FakeRead(ForLet, _2) -21:20-21:28: @0[5]: _4 = (*(_1.0: &bool)) -21:20-21:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> +21:20-21:28: @0[5]: _4 = (*(_1.0: &bool))"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="20:37-20:38: @0[1]: _2 = const 0_i32 20:21-20:34: @0[2]: FakeRead(ForLet, _2) -21:20-21:28: @0[5]: _4 = (*(_1.0: &bool)) -21:20-21:28: @0[6]: FakeRead(ForMatchedPlace, _4)"> let mut countdown = 0;</span></span> +21:20-21:28: @0[5]: _4 = (*(_1.0: &bool))"> let mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="20:37-20:38: @0[1]: _2 = const 0_i32 20:21-20:34: @0[2]: FakeRead(ForLet, _2) -21:20-21:28: @0[5]: _4 = (*(_1.0: &bool)) -21:20-21:28: @0[6]: FakeRead(ForMatchedPlace, _4)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 -21:29-23:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 -21:29-23:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @3[0]: _2 = const 10_i32 -21:29-23:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="23:18-23:18: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" -24:17-24:31: @4[5]: _5 = &(*_6) -24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -25:14-25:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 1".to_owned()</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="24:17-24:31: @4[4]: _6 = const "alt string 1" -24:17-24:31: @4[5]: _5 = &(*_6) -24:17-24:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -25:14-25:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +21:20-21:28: @0[5]: _4 = (*(_1.0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:21-22:35: @1[0]: _2 = const 10_i32 +21:29-23:18: @1[1]: _3 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @1[0]: _2 = const 10_i32 +21:29-23:18: @1[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:21-22:35: @1[0]: _2 = const 10_i32 +21:29-23:18: @1[1]: _3 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="23:18-23:18: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="24:17-24:31: @3[4]: _6 = const "alt string 1" +24:17-24:31: @3[5]: _5 = &(*_6) +24:17-24:42: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +25:14-25:14: @4.Return: return"><span class="annotation">@3,4⦊</span>"alt string 1".to_owned()</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="24:17-24:31: @3[4]: _6 = const "alt string 1" +24:17-24:31: @3[5]: _5 = &(*_6) +24:17-24:42: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +25:14-25:14: @4.Return: return"> }<span class="annotation">⦉@3,4</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#11}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#11}.-------.InstrumentCoverage.0.html index 48f3944b8b762..24c1cadacac4a 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#11}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#11}.-------.InstrumentCoverage.0.html @@ -72,28 +72,25 @@ <div class="code" style="counter-reset: line 59"><span class="line"> <span class="code" style="--layer: 0">||</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="62:37-62:38: @0[1]: _2 = const 0_i32 62:21-62:34: @0[2]: FakeRead(ForLet, _2) -63:20-63:28: @0[5]: _4 = (*(_1.0: &bool)) -63:20-63:28: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> +63:20-63:28: @0[5]: _4 = (*(_1.0: &bool))"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="62:37-62:38: @0[1]: _2 = const 0_i32 62:21-62:34: @0[2]: FakeRead(ForLet, _2) -63:20-63:28: @0[5]: _4 = (*(_1.0: &bool)) -63:20-63:28: @0[6]: FakeRead(ForMatchedPlace, _4)"> let mut countdown = 0;</span></span> +63:20-63:28: @0[5]: _4 = (*(_1.0: &bool))"> let mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="62:37-62:38: @0[1]: _2 = const 0_i32 62:21-62:34: @0[2]: FakeRead(ForLet, _2) -63:20-63:28: @0[5]: _4 = (*(_1.0: &bool)) -63:20-63:28: @0[6]: FakeRead(ForMatchedPlace, _4)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 -63:29-65:18: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 -63:29-65:18: @3[1]: _3 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @3[0]: _2 = const 10_i32 -63:29-65:18: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="65:18-65:18: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" -66:17-66:31: @4[5]: _5 = &(*_6) -66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -67:14-67:14: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 3".to_owned()</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="66:17-66:31: @4[4]: _6 = const "alt string 3" -66:17-66:31: @4[5]: _5 = &(*_6) -66:17-66:42: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -67:14-67:14: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +63:20-63:28: @0[5]: _4 = (*(_1.0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="64:21-64:35: @1[0]: _2 = const 10_i32 +63:29-65:18: @1[1]: _3 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @1[0]: _2 = const 10_i32 +63:29-65:18: @1[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="64:21-64:35: @1[0]: _2 = const 10_i32 +63:29-65:18: @1[1]: _3 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="65:18-65:18: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="66:17-66:31: @3[4]: _6 = const "alt string 3" +66:17-66:31: @3[5]: _5 = &(*_6) +66:17-66:42: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +67:14-67:14: @4.Return: return"><span class="annotation">@3,4⦊</span>"alt string 3".to_owned()</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="66:17-66:31: @3[4]: _6 = const "alt string 3" +66:17-66:31: @3[5]: _5 = &(*_6) +66:17-66:42: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +67:14-67:14: @4.Return: return"> }<span class="annotation">⦉@3,4</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html index 233ebf11b2cdc..7a3921c5aec76 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#1}.-------.InstrumentCoverage.0.html @@ -72,28 +72,25 @@ <div class="code" style="counter-reset: line 74"><span class="line"> <span class="code" style="--layer: 0">||</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="77:29-77:30: @0[1]: _2 = const 0_i32 77:13-77:26: @0[2]: FakeRead(ForLet, _2) -78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool)) -78:12-78:20: @0[6]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> +78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool))"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="77:29-77:30: @0[1]: _2 = const 0_i32 77:13-77:26: @0[2]: FakeRead(ForLet, _2) -78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool)) -78:12-78:20: @0[6]: FakeRead(ForMatchedPlace, _4)"> let mut countdown = 0;</span></span> +78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool))"> let mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="77:29-77:30: @0[1]: _2 = const 0_i32 77:13-77:26: @0[2]: FakeRead(ForLet, _2) -78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool)) -78:12-78:20: @0[6]: FakeRead(ForMatchedPlace, _4)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 -78:21-80:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 -78:21-80:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @3[0]: _2 = const 10_i32 -78:21-80:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="80:10-80:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" -81:9-81:23: @4[5]: _5 = &(*_6) -81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -82:6-82:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"alt string 4".to_owned()</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="81:9-81:23: @4[4]: _6 = const "alt string 4" -81:9-81:23: @4[5]: _5 = &(*_6) -81:9-81:34: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -82:6-82:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +78:12-78:20: @0[5]: _4 = (*((*_1).0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="79:13-79:27: @1[0]: _2 = const 10_i32 +78:21-80:10: @1[1]: _3 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @1[0]: _2 = const 10_i32 +78:21-80:10: @1[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="79:13-79:27: @1[0]: _2 = const 10_i32 +78:21-80:10: @1[1]: _3 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="80:10-80:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="81:9-81:23: @3[4]: _6 = const "alt string 4" +81:9-81:23: @3[5]: _5 = &(*_6) +81:9-81:34: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +82:6-82:6: @4.Return: return"><span class="annotation">@3,4⦊</span>"alt string 4".to_owned()</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="81:9-81:23: @3[4]: _6 = const "alt string 4" +81:9-81:23: @3[5]: _5 = &(*_6) +81:9-81:34: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +82:6-82:6: @4.Return: return"> }<span class="annotation">⦉@3,4</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html index 1cdca25cd6640..06b817e4318e8 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#2}.-------.InstrumentCoverage.0.html @@ -72,60 +72,57 @@ <div class="code" style="counter-reset: line 96"><span class="line"> <span class="code" style="--layer: 0">|val|</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="99:29-99:30: @0[1]: _3 = const 0_i32 99:13-99:26: @0[2]: FakeRead(ForLet, _3) -100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool)) -100:12-100:20: @0[6]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@0⦊</span>{</span></span> +100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool))"><span class="annotation">@0⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="99:29-99:30: @0[1]: _3 = const 0_i32 99:13-99:26: @0[2]: FakeRead(ForLet, _3) -100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool)) -100:12-100:20: @0[6]: FakeRead(ForMatchedPlace, _5)"> let mut countdown = 0;</span></span> +100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool))"> let mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="99:29-99:30: @0[1]: _3 = const 0_i32 99:13-99:26: @0[2]: FakeRead(ForLet, _3) -100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool)) -100:12-100:20: @0[6]: FakeRead(ForMatchedPlace, _5)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="101:13-101:27: @3[0]: _3 = const 10_i32 -100:21-102:10: @3[1]: _4 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="101:13-101:27: @3[0]: _3 = const 10_i32 -100:21-102:10: @3[1]: _4 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="101:13-101:27: @3[0]: _3 = const 10_i32 -100:21-102:10: @3[1]: _4 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="102:10-102:10: @2[0]: _4 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="103:17-103:23: @4[7]: _22 = const main::{closure#2}::promoted[0] -103:17-103:23: @4[8]: _10 = &(*_22) -103:17-103:23: @4[9]: _9 = &(*_10) -103:17-103:23: @4[10]: _8 = move _9 as &[&str] (Pointer(Unsize)) -103:25-103:28: @4[18]: _17 = &_2 -103:9-103:29: @4[19]: _16 = (move _17,) -103:9-103:29: @4[21]: FakeRead(ForMatchedPlace, _16) -103:9-103:29: @4[23]: _18 = (_16.0: &&str) -103:9-103:29: @4[26]: _20 = &(*_18) -103:9-103:29: @4[28]: _21 = <&str as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r &str, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -103:9-103:29: @4.Call: _19 = ArgumentV1::new::<&str>(move _20, move _21) -> [return: bb5, unwind: bb10] -103:9-103:29: @5[2]: _15 = [move _19] -103:9-103:29: @5[5]: _14 = &_15 -103:9-103:29: @5[6]: _13 = &(*_14) -103:9-103:29: @5[7]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -103:9-103:29: @5.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb6, unwind: bb10] -103:9-103:29: @6.Call: _6 = format(move _7) -> [return: bb7, unwind: bb10] -103:9-103:29: @7[1]: FakeRead(ForLet, _6) -103:9-103:29: @7[6]: _0 = move _6 -104:6-104:6: @8.Return: return"><span class="annotation">@4,5,6,7,8⦊</span>format!("'{}'", val)</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="103:17-103:23: @4[7]: _22 = const main::{closure#2}::promoted[0] -103:17-103:23: @4[8]: _10 = &(*_22) -103:17-103:23: @4[9]: _9 = &(*_10) -103:17-103:23: @4[10]: _8 = move _9 as &[&str] (Pointer(Unsize)) -103:25-103:28: @4[18]: _17 = &_2 -103:9-103:29: @4[19]: _16 = (move _17,) -103:9-103:29: @4[21]: FakeRead(ForMatchedPlace, _16) -103:9-103:29: @4[23]: _18 = (_16.0: &&str) -103:9-103:29: @4[26]: _20 = &(*_18) -103:9-103:29: @4[28]: _21 = <&str as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r &str, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -103:9-103:29: @4.Call: _19 = ArgumentV1::new::<&str>(move _20, move _21) -> [return: bb5, unwind: bb10] -103:9-103:29: @5[2]: _15 = [move _19] -103:9-103:29: @5[5]: _14 = &_15 -103:9-103:29: @5[6]: _13 = &(*_14) -103:9-103:29: @5[7]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -103:9-103:29: @5.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb6, unwind: bb10] -103:9-103:29: @6.Call: _6 = format(move _7) -> [return: bb7, unwind: bb10] -103:9-103:29: @7[1]: FakeRead(ForLet, _6) -103:9-103:29: @7[6]: _0 = move _6 -104:6-104:6: @8.Return: return"> }<span class="annotation">⦉@4,5,6,7,8</span></span></span></span></div> +100:12-100:20: @0[5]: _5 = (*((*_1).0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="101:13-101:27: @1[0]: _3 = const 10_i32 +100:21-102:10: @1[1]: _4 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="101:13-101:27: @1[0]: _3 = const 10_i32 +100:21-102:10: @1[1]: _4 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="101:13-101:27: @1[0]: _3 = const 10_i32 +100:21-102:10: @1[1]: _4 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="102:10-102:10: @2[0]: _4 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="103:17-103:23: @3[7]: _22 = const main::{closure#2}::promoted[0] +103:17-103:23: @3[8]: _10 = &(*_22) +103:17-103:23: @3[9]: _9 = &(*_10) +103:17-103:23: @3[10]: _8 = move _9 as &[&str] (Pointer(Unsize)) +103:25-103:28: @3[18]: _17 = &_2 +103:9-103:29: @3[19]: _16 = (move _17,) +103:9-103:29: @3[21]: FakeRead(ForMatchedPlace, _16) +103:9-103:29: @3[23]: _18 = (_16.0: &&str) +103:9-103:29: @3[26]: _20 = &(*_18) +103:9-103:29: @3[28]: _21 = <&str as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r &str, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +103:9-103:29: @3.Call: _19 = ArgumentV1::new::<&str>(move _20, move _21) -> [return: bb4, unwind: bb9] +103:9-103:29: @4[2]: _15 = [move _19] +103:9-103:29: @4[5]: _14 = &_15 +103:9-103:29: @4[6]: _13 = &(*_14) +103:9-103:29: @4[7]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +103:9-103:29: @4.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb5, unwind: bb9] +103:9-103:29: @5.Call: _6 = format(move _7) -> [return: bb6, unwind: bb9] +103:9-103:29: @6[1]: FakeRead(ForLet, _6) +103:9-103:29: @6[6]: _0 = move _6 +104:6-104:6: @7.Return: return"><span class="annotation">@3,4,5,6,7⦊</span>format!("'{}'", val)</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="103:17-103:23: @3[7]: _22 = const main::{closure#2}::promoted[0] +103:17-103:23: @3[8]: _10 = &(*_22) +103:17-103:23: @3[9]: _9 = &(*_10) +103:17-103:23: @3[10]: _8 = move _9 as &[&str] (Pointer(Unsize)) +103:25-103:28: @3[18]: _17 = &_2 +103:9-103:29: @3[19]: _16 = (move _17,) +103:9-103:29: @3[21]: FakeRead(ForMatchedPlace, _16) +103:9-103:29: @3[23]: _18 = (_16.0: &&str) +103:9-103:29: @3[26]: _20 = &(*_18) +103:9-103:29: @3[28]: _21 = <&str as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r &str, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +103:9-103:29: @3.Call: _19 = ArgumentV1::new::<&str>(move _20, move _21) -> [return: bb4, unwind: bb9] +103:9-103:29: @4[2]: _15 = [move _19] +103:9-103:29: @4[5]: _14 = &_15 +103:9-103:29: @4[6]: _13 = &(*_14) +103:9-103:29: @4[7]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +103:9-103:29: @4.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb5, unwind: bb9] +103:9-103:29: @5.Call: _6 = format(move _7) -> [return: bb6, unwind: bb9] +103:9-103:29: @6[1]: FakeRead(ForLet, _6) +103:9-103:29: @6[6]: _0 = move _6 +104:6-104:6: @7.Return: return"> }<span class="annotation">⦉@3,4,5,6,7</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html index 032a6a7e435c1..0940775840093 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.closure/closure.main-{closure#3}.-------.InstrumentCoverage.0.html @@ -72,22 +72,20 @@ <div class="code" style="counter-reset: line 119"><span class="line"> <span class="code" style="--layer: 0">|</span></span> <span class="line"><span class="code" style="--layer: 0"> mut countdown</span></span> <span class="line"><span class="code" style="--layer: 0"> |</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="124:12-124:20: @0[2]: _4 = (*((*_1).0: &bool)) -124:12-124:20: @0[3]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="124:12-124:20: @0[2]: _4 = (*((*_1).0: &bool)) -124:12-124:20: @0[3]: FakeRead(ForMatchedPlace, _4)"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="125:13-125:27: @3[0]: _2 = const 10_i32 -124:21-126:10: @3[1]: _3 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="125:13-125:27: @3[0]: _2 = const 10_i32 -124:21-126:10: @3[1]: _3 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="125:13-125:27: @3[0]: _2 = const 10_i32 -124:21-126:10: @3[1]: _3 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="126:10-126:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="127:9-127:35: @4[4]: _6 = const "closure should be unused" -127:9-127:35: @4[5]: _5 = &(*_6) -127:9-127:46: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -128:6-128:6: @5.Return: return"><span class="annotation">@4,5⦊</span>"closure should be unused".to_owned()</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="127:9-127:35: @4[4]: _6 = const "closure should be unused" -127:9-127:35: @4[5]: _5 = &(*_6) -127:9-127:46: @4.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb5, unwind: bb6] -128:6-128:6: @5.Return: return"> }<span class="annotation">⦉@4,5</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="124:12-124:20: @0[2]: _4 = (*((*_1).0: &bool))"><span class="annotation">@0⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="124:12-124:20: @0[2]: _4 = (*((*_1).0: &bool))"> if is_false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="125:13-125:27: @1[0]: _2 = const 10_i32 +124:21-126:10: @1[1]: _3 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="125:13-125:27: @1[0]: _2 = const 10_i32 +124:21-126:10: @1[1]: _3 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="125:13-125:27: @1[0]: _2 = const 10_i32 +124:21-126:10: @1[1]: _3 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="126:10-126:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="127:9-127:35: @3[4]: _6 = const "closure should be unused" +127:9-127:35: @3[5]: _5 = &(*_6) +127:9-127:46: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +128:6-128:6: @4.Return: return"><span class="annotation">@3,4⦊</span>"closure should be unused".to_owned()</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="127:9-127:35: @3[4]: _6 = const "closure should be unused" +127:9-127:35: @3[5]: _5 = &(*_6) +127:9-127:46: @3.Call: _0 = <str as ToOwned>::to_owned(move _5) -> [return: bb4, unwind: bb5] +128:6-128:6: @4.Return: return"> }<span class="annotation">⦉@3,4</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.conditions/conditions.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.conditions/conditions.main.-------.InstrumentCoverage.0.html index e16b366e2162e..184dba6abd17f 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.conditions/conditions.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.conditions/conditions.main.-------.InstrumentCoverage.0.html @@ -72,255 +72,236 @@ <div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0⦊</span>fn main() <span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">{</span></span> <span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="4:25-4:26: @0[1]: _1 = const 0_u32 4:9-4:22: @0[2]: FakeRead(ForLet, _1) -5:8-5:12: @0[5]: _3 = const true -5:8-5:12: @0[6]: FakeRead(ForMatchedPlace, _3)"><span class="annotation">@0⦊</span>mut countdown = 0;</span></span> +5:8-5:12: @0[5]: _3 = const true"><span class="annotation">@0⦊</span>mut countdown = 0;</span></span> <span class="line"><span class="code even" style="--layer: 1" title="4:25-4:26: @0[1]: _1 = const 0_u32 4:9-4:22: @0[2]: FakeRead(ForLet, _1) -5:8-5:12: @0[5]: _3 = const true -5:8-5:12: @0[6]: FakeRead(ForMatchedPlace, _3)"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 -5:13-7:6: @3[1]: _2 = const ()"><span class="annotation">@1,3⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 -5:13-7:6: @3[1]: _2 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @3[0]: _1 = const 10_u32 -5:13-7:6: @3[1]: _2 = const ()"> }<span class="annotation">⦉@1,3</span></span></span><span><span class="code even" style="--layer: 1" title="7:6-7:6: @2[0]: _2 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +5:8-5:12: @0[5]: _3 = const true"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:9-6:23: @1[0]: _1 = const 10_u32 +5:13-7:6: @1[1]: _2 = const ()"><span class="annotation">@1⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @1[0]: _1 = const 10_u32 +5:13-7:6: @1[1]: _2 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:9-6:23: @1[0]: _1 = const 10_u32 +5:13-7:6: @1[1]: _2 = const ()"> }<span class="annotation">⦉@1</span></span></span><span><span class="code even" style="--layer: 1" title="7:6-7:6: @2[0]: _2 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> const B: u32 = 100;</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="10:9-10:10: @25[0]: FakeRead(ForLet, _4)"><span class="annotation">@25⦊</span>x<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="10:16-10:25: @4[5]: _6 = _1 -10:16-10:29: @4[6]: _5 = Gt(move _6, const 7_u32) -10:16-10:29: @4[8]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@4⦊</span>countdown > 7<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @7[0]: _7 = CheckedSub(_1, const 4_u32) -11:9-11:23: @8[0]: _1 = move (_7.0: u32) -12:9-12:10: @8[1]: _4 = const B"><span class="annotation">@5,7,8⦊</span>countdown -= 4;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @7[0]: _7 = CheckedSub(_1, const 4_u32) -11:9-11:23: @8[0]: _1 = move (_7.0: u32) -12:9-12:10: @8[1]: _4 = const B"> B<span class="annotation">⦉@5,7,8</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="13:15-13:24: @6[2]: _9 = _1 -13:15-13:28: @6[3]: _8 = Gt(move _9, const 2_u32) -13:15-13:28: @6[5]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@6⦊</span>countdown > 2<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="14:12-14:21: @11[5]: _14 = _1 -14:12-14:25: @11[6]: _13 = Lt(move _14, const 1_u32)"><span class="annotation">@9,11⦊</span>countdown < 1<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="14:29-14:38: @18[2]: _16 = _1 -14:29-14:42: @18[3]: _15 = Gt(move _16, const 5_u32)"><span class="annotation">@18⦊</span>countdown > 5<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="14:46-14:55: @14[2]: _18 = _1 -14:46-14:60: @14[3]: _17 = Ne(move _18, const 9_u32)"><span class="annotation">@14⦊</span>countdown != 9<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 -14:61-16:10: @22[1]: _10 = const ()"><span class="annotation">@20,22⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 -14:61-16:10: @22[1]: _10 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @22[0]: _1 = const 0_u32 -14:61-16:10: @22[1]: _10 = const ()"> }<span class="annotation">⦉@20,22</span></span></span><span><span class="code odd" style="--layer: 1" title="16:10-16:10: @21[0]: _10 = const ()"><span class="annotation">@21⦊</span>‸<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="17:9-17:23: @23[2]: _19 = CheckedSub(_1, const 5_u32) -17:9-17:23: @24[0]: _1 = move (_19.0: u32) -18:9-18:18: @24[1]: _4 = _1"><span class="annotation">@23,24⦊</span>countdown -= 5;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="17:9-17:23: @23[2]: _19 = CheckedSub(_1, const 5_u32) -17:9-17:23: @24[0]: _1 = move (_19.0: u32) -18:9-18:18: @24[1]: _4 = _1"> countdown<span class="annotation">⦉@23,24</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="10:9-10:10: @21[1]: FakeRead(ForLet, _4)"><span class="annotation">@21⦊</span>x<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="10:16-10:25: @3[5]: _6 = _1 +10:16-10:29: @3[6]: _5 = Gt(move _6, const 7_u32)"><span class="annotation">@3⦊</span>countdown > 7<span class="annotation">⦉@3</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _7 = CheckedSub(_1, const 4_u32) +11:9-11:23: @6[0]: _1 = move (_7.0: u32) +12:9-12:10: @6[1]: _4 = const B"><span class="annotation">@4,6⦊</span>countdown -= 4;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _7 = CheckedSub(_1, const 4_u32) +11:9-11:23: @6[0]: _1 = move (_7.0: u32) +12:9-12:10: @6[1]: _4 = const B"> B<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> } else if </span><span><span class="code even" style="--layer: 1" title="13:15-13:24: @5[2]: _9 = _1 +13:15-13:28: @5[3]: _8 = Gt(move _9, const 2_u32)"><span class="annotation">@5⦊</span>countdown > 2<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="14:12-14:21: @7[5]: _14 = _1 +14:12-14:25: @7[6]: _13 = Lt(move _14, const 1_u32)"><span class="annotation">@7⦊</span>countdown < 1<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="14:29-14:38: @15[2]: _16 = _1 +14:29-14:42: @15[3]: _15 = Gt(move _16, const 5_u32)"><span class="annotation">@15⦊</span>countdown > 5<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="14:46-14:55: @11[2]: _18 = _1 +14:46-14:60: @11[3]: _17 = Ne(move _18, const 9_u32)"><span class="annotation">@11⦊</span>countdown != 9<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:13-15:26: @17[0]: _1 = const 0_u32 +14:61-16:10: @17[1]: _10 = const ()"><span class="annotation">@17⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @17[0]: _1 = const 0_u32 +14:61-16:10: @17[1]: _10 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:13-15:26: @17[0]: _1 = const 0_u32 +14:61-16:10: @17[1]: _10 = const ()"> }<span class="annotation">⦉@17</span></span></span><span><span class="code odd" style="--layer: 1" title="16:10-16:10: @18[0]: _10 = const ()"><span class="annotation">@18⦊</span>‸<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="17:9-17:23: @19[2]: _19 = CheckedSub(_1, const 5_u32) +17:9-17:23: @20[0]: _1 = move (_19.0: u32) +18:9-18:18: @20[1]: _4 = _1"><span class="annotation">@19,20⦊</span>countdown -= 5;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="17:9-17:23: @19[2]: _19 = CheckedSub(_1, const 5_u32) +17:9-17:23: @20[0]: _1 = move (_19.0: u32) +18:9-18:18: @20[1]: _4 = _1"> countdown<span class="annotation">⦉@19,20</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:9-20:15: @10[0]: _0 = const ()"><span class="annotation">@10⦊</span>return<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:9-20:15: @8[0]: _0 = const ()"><span class="annotation">@8⦊</span>return<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> };</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:25-23:26: @25[3]: _21 = const 0_i32 -23:9-23:22: @25[4]: FakeRead(ForLet, _21) -24:8-24:12: @25[7]: _23 = const true -24:8-24:12: @25[8]: FakeRead(ForMatchedPlace, _23)"><span class="annotation">@25⦊</span>mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="23:25-23:26: @25[3]: _21 = const 0_i32 -23:9-23:22: @25[4]: FakeRead(ForLet, _21) -24:8-24:12: @25[7]: _23 = const true -24:8-24:12: @25[8]: FakeRead(ForMatchedPlace, _23)"> if true<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 -24:13-26:6: @28[1]: _22 = const ()"><span class="annotation">@26,28⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 -24:13-26:6: @28[1]: _22 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @28[0]: _21 = const 10_i32 -24:13-26:6: @28[1]: _22 = const ()"> }<span class="annotation">⦉@26,28</span></span></span><span><span class="code even" style="--layer: 1" title="26:6-26:6: @27[0]: _22 = const ()"><span class="annotation">@27⦊</span>‸<span class="annotation">⦉@27</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="23:25-23:26: @21[3]: _21 = const 0_i32 +23:9-23:22: @21[4]: FakeRead(ForLet, _21) +24:8-24:12: @21[7]: _23 = const true"><span class="annotation">@21⦊</span>mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="23:25-23:26: @21[3]: _21 = const 0_i32 +23:9-23:22: @21[4]: FakeRead(ForLet, _21) +24:8-24:12: @21[7]: _23 = const true"> if true<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @22[0]: _21 = const 10_i32 +24:13-26:6: @22[1]: _22 = const ()"><span class="annotation">@22⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @22[0]: _21 = const 10_i32 +24:13-26:6: @22[1]: _22 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="25:9-25:23: @22[0]: _21 = const 10_i32 +24:13-26:6: @22[1]: _22 = const ()"> }<span class="annotation">⦉@22</span></span></span><span><span class="code even" style="--layer: 1" title="26:6-26:6: @23[0]: _22 = const ()"><span class="annotation">@23⦊</span>‸<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="28:8-28:17: @29[5]: _26 = _21 -28:8-28:21: @29[6]: _25 = Gt(move _26, const 7_i32) -28:8-28:21: @29[8]: FakeRead(ForMatchedPlace, _25)"><span class="annotation">@29⦊</span>countdown > 7<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="29:9-29:23: @32[0]: _27 = CheckedSub(_21, const 4_i32) -29:9-29:23: @33[0]: _21 = move (_27.0: i32) -28:22-30:6: @33[1]: _24 = const ()"><span class="annotation">@30,32,33⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="29:9-29:23: @32[0]: _27 = CheckedSub(_21, const 4_i32) -29:9-29:23: @33[0]: _21 = move (_27.0: i32) -28:22-30:6: @33[1]: _24 = const ()"> countdown -= 4;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="29:9-29:23: @32[0]: _27 = CheckedSub(_21, const 4_i32) -29:9-29:23: @33[0]: _21 = move (_27.0: i32) -28:22-30:6: @33[1]: _24 = const ()"> }<span class="annotation">⦉@30,32,33</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="30:15-30:24: @31[2]: _29 = _21 -30:15-30:28: @31[3]: _28 = Gt(move _29, const 2_i32) -30:15-30:28: @31[5]: FakeRead(ForMatchedPlace, _28)"><span class="annotation">@31⦊</span>countdown > 2<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="31:12-31:21: @36[5]: _34 = _21 -31:12-31:25: @36[6]: _33 = Lt(move _34, const 1_i32)"><span class="annotation">@34,36⦊</span>countdown < 1<span class="annotation">⦉@34,36</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="31:29-31:38: @43[2]: _36 = _21 -31:29-31:42: @43[3]: _35 = Gt(move _36, const 5_i32)"><span class="annotation">@43⦊</span>countdown > 5<span class="annotation">⦉@43</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="31:46-31:55: @39[2]: _38 = _21 -31:46-31:60: @39[3]: _37 = Ne(move _38, const 9_i32)"><span class="annotation">@39⦊</span>countdown != 9<span class="annotation">⦉@39</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 -31:61-33:10: @47[1]: _30 = const ()"><span class="annotation">@45,47⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 -31:61-33:10: @47[1]: _30 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="32:13-32:26: @47[0]: _21 = const 0_i32 -31:61-33:10: @47[1]: _30 = const ()"> }<span class="annotation">⦉@45,47</span></span></span><span><span class="code even" style="--layer: 1" title="33:10-33:10: @46[0]: _30 = const ()"><span class="annotation">@46⦊</span>‸<span class="annotation">⦉@46</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:23: @48[2]: _39 = CheckedSub(_21, const 5_i32) -34:9-34:23: @49[0]: _21 = move (_39.0: i32)"><span class="annotation">@48,49⦊</span>countdown -= 5<span class="annotation">⦉@48,49</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="28:8-28:17: @24[5]: _26 = _21 +28:8-28:21: @24[6]: _25 = Gt(move _26, const 7_i32)"><span class="annotation">@24⦊</span>countdown > 7<span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="29:9-29:23: @25[0]: _27 = CheckedSub(_21, const 4_i32) +29:9-29:23: @27[0]: _21 = move (_27.0: i32) +28:22-30:6: @27[1]: _24 = const ()"><span class="annotation">@25,27⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="29:9-29:23: @25[0]: _27 = CheckedSub(_21, const 4_i32) +29:9-29:23: @27[0]: _21 = move (_27.0: i32) +28:22-30:6: @27[1]: _24 = const ()"> countdown -= 4;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="29:9-29:23: @25[0]: _27 = CheckedSub(_21, const 4_i32) +29:9-29:23: @27[0]: _21 = move (_27.0: i32) +28:22-30:6: @27[1]: _24 = const ()"> }<span class="annotation">⦉@25,27</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="30:15-30:24: @26[2]: _29 = _21 +30:15-30:28: @26[3]: _28 = Gt(move _29, const 2_i32)"><span class="annotation">@26⦊</span>countdown > 2<span class="annotation">⦉@26</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="31:12-31:21: @28[5]: _34 = _21 +31:12-31:25: @28[6]: _33 = Lt(move _34, const 1_i32)"><span class="annotation">@28⦊</span>countdown < 1<span class="annotation">⦉@28</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="31:29-31:38: @36[2]: _36 = _21 +31:29-31:42: @36[3]: _35 = Gt(move _36, const 5_i32)"><span class="annotation">@36⦊</span>countdown > 5<span class="annotation">⦉@36</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="31:46-31:55: @32[2]: _38 = _21 +31:46-31:60: @32[3]: _37 = Ne(move _38, const 9_i32)"><span class="annotation">@32⦊</span>countdown != 9<span class="annotation">⦉@32</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="32:13-32:26: @38[0]: _21 = const 0_i32 +31:61-33:10: @38[1]: _30 = const ()"><span class="annotation">@38⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="32:13-32:26: @38[0]: _21 = const 0_i32 +31:61-33:10: @38[1]: _30 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="32:13-32:26: @38[0]: _21 = const 0_i32 +31:61-33:10: @38[1]: _30 = const ()"> }<span class="annotation">⦉@38</span></span></span><span><span class="code even" style="--layer: 1" title="33:10-33:10: @39[0]: _30 = const ()"><span class="annotation">@39⦊</span>‸<span class="annotation">⦉@39</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:23: @40[2]: _39 = CheckedSub(_21, const 5_i32) +34:9-34:23: @41[0]: _21 = move (_39.0: i32)"><span class="annotation">@40,41⦊</span>countdown -= 5<span class="annotation">⦉@40,41</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:15: @35[0]: _0 = const ()"><span class="annotation">@35⦊</span>return<span class="annotation">⦉@35</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:15: @29[0]: _0 = const ()"><span class="annotation">@29⦊</span>return<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="39:8-39:12: @50[4]: _42 = const true -39:8-39:12: @50[5]: FakeRead(ForMatchedPlace, _42)"><span class="annotation">@50⦊</span>true<span class="annotation">⦉@50</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="40:29-40:30: @53[1]: _43 = const 0_i32 -40:13-40:26: @53[2]: FakeRead(ForLet, _43) -41:12-41:16: @53[5]: _45 = const true -41:12-41:16: @53[6]: FakeRead(ForMatchedPlace, _45)"><span class="annotation">@51,53⦊</span>mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="40:29-40:30: @53[1]: _43 = const 0_i32 -40:13-40:26: @53[2]: FakeRead(ForLet, _43) -41:12-41:16: @53[5]: _45 = const true -41:12-41:16: @53[6]: FakeRead(ForMatchedPlace, _45)"> if true<span class="annotation">⦉@51,53</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="42:13-42:27: @56[0]: _43 = const 10_i32 -41:17-43:10: @56[1]: _44 = const ()"><span class="annotation">@54,56⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="42:13-42:27: @56[0]: _43 = const 10_i32 -41:17-43:10: @56[1]: _44 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="42:13-42:27: @56[0]: _43 = const 10_i32 -41:17-43:10: @56[1]: _44 = const ()"> }<span class="annotation">⦉@54,56</span></span></span><span><span class="code even" style="--layer: 1" title="43:10-43:10: @55[0]: _44 = const ()"><span class="annotation">@55⦊</span>‸<span class="annotation">⦉@55</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="39:8-39:12: @42[4]: _42 = const true"><span class="annotation">@42⦊</span>true<span class="annotation">⦉@42</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="40:29-40:30: @43[1]: _43 = const 0_i32 +40:13-40:26: @43[2]: FakeRead(ForLet, _43) +41:12-41:16: @43[5]: _45 = const true"><span class="annotation">@43⦊</span>mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="40:29-40:30: @43[1]: _43 = const 0_i32 +40:13-40:26: @43[2]: FakeRead(ForLet, _43) +41:12-41:16: @43[5]: _45 = const true"> if true<span class="annotation">⦉@43</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="42:13-42:27: @45[0]: _43 = const 10_i32 +41:17-43:10: @45[1]: _44 = const ()"><span class="annotation">@45⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="42:13-42:27: @45[0]: _43 = const 10_i32 +41:17-43:10: @45[1]: _44 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="42:13-42:27: @45[0]: _43 = const 10_i32 +41:17-43:10: @45[1]: _44 = const ()"> }<span class="annotation">⦉@45</span></span></span><span><span class="code even" style="--layer: 1" title="43:10-43:10: @46[0]: _44 = const ()"><span class="annotation">@46⦊</span>‸<span class="annotation">⦉@46</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="45:12-45:21: @57[4]: _47 = _43 -45:12-45:25: @57[5]: _46 = Gt(move _47, const 7_i32) -45:12-45:25: @57[7]: FakeRead(ForMatchedPlace, _46)"><span class="annotation">@57⦊</span>countdown > 7<span class="annotation">⦉@57</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="46:13-46:27: @60[0]: _48 = CheckedSub(_43, const 4_i32) -46:13-46:27: @61[0]: _43 = move (_48.0: i32) -45:26-47:10: @61[1]: _41 = const ()"><span class="annotation">@58,60,61⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="46:13-46:27: @60[0]: _48 = CheckedSub(_43, const 4_i32) -46:13-46:27: @61[0]: _43 = move (_48.0: i32) -45:26-47:10: @61[1]: _41 = const ()"> countdown -= 4;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="46:13-46:27: @60[0]: _48 = CheckedSub(_43, const 4_i32) -46:13-46:27: @61[0]: _43 = move (_48.0: i32) -45:26-47:10: @61[1]: _41 = const ()"> }<span class="annotation">⦉@58,60,61</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="48:17-48:26: @59[2]: _50 = _43 -48:17-48:30: @59[3]: _49 = Gt(move _50, const 2_i32) -48:17-48:30: @59[5]: FakeRead(ForMatchedPlace, _49)"><span class="annotation">@59⦊</span>countdown > 2<span class="annotation">⦉@59</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="49:16-49:25: @64[5]: _55 = _43 -49:16-49:29: @64[6]: _54 = Lt(move _55, const 1_i32)"><span class="annotation">@62,64⦊</span>countdown < 1<span class="annotation">⦉@62,64</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="49:33-49:42: @71[2]: _57 = _43 -49:33-49:46: @71[3]: _56 = Gt(move _57, const 5_i32)"><span class="annotation">@71⦊</span>countdown > 5<span class="annotation">⦉@71</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="49:50-49:59: @67[2]: _59 = _43 -49:50-49:64: @67[3]: _58 = Ne(move _59, const 9_i32)"><span class="annotation">@67⦊</span>countdown != 9<span class="annotation">⦉@67</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="50:17-50:30: @75[0]: _43 = const 0_i32 -49:65-51:14: @75[1]: _51 = const ()"><span class="annotation">@73,75⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="50:17-50:30: @75[0]: _43 = const 0_i32 -49:65-51:14: @75[1]: _51 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="50:17-50:30: @75[0]: _43 = const 0_i32 -49:65-51:14: @75[1]: _51 = const ()"> }<span class="annotation">⦉@73,75</span></span></span><span><span class="code even" style="--layer: 1" title="51:14-51:14: @74[0]: _51 = const ()"><span class="annotation">@74⦊</span>‸<span class="annotation">⦉@74</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="52:13-52:27: @76[2]: _60 = CheckedSub(_43, const 5_i32) -52:13-52:27: @77[0]: _43 = move (_60.0: i32)"><span class="annotation">@76,77⦊</span>countdown -= 5<span class="annotation">⦉@76,77</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="45:12-45:21: @47[4]: _47 = _43 +45:12-45:25: @47[5]: _46 = Gt(move _47, const 7_i32)"><span class="annotation">@47⦊</span>countdown > 7<span class="annotation">⦉@47</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="46:13-46:27: @48[0]: _48 = CheckedSub(_43, const 4_i32) +46:13-46:27: @50[0]: _43 = move (_48.0: i32) +45:26-47:10: @50[1]: _41 = const ()"><span class="annotation">@48,50⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="46:13-46:27: @48[0]: _48 = CheckedSub(_43, const 4_i32) +46:13-46:27: @50[0]: _43 = move (_48.0: i32) +45:26-47:10: @50[1]: _41 = const ()"> countdown -= 4;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="46:13-46:27: @48[0]: _48 = CheckedSub(_43, const 4_i32) +46:13-46:27: @50[0]: _43 = move (_48.0: i32) +45:26-47:10: @50[1]: _41 = const ()"> }<span class="annotation">⦉@48,50</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="48:17-48:26: @49[2]: _50 = _43 +48:17-48:30: @49[3]: _49 = Gt(move _50, const 2_i32)"><span class="annotation">@49⦊</span>countdown > 2<span class="annotation">⦉@49</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="49:16-49:25: @51[5]: _55 = _43 +49:16-49:29: @51[6]: _54 = Lt(move _55, const 1_i32)"><span class="annotation">@51⦊</span>countdown < 1<span class="annotation">⦉@51</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="49:33-49:42: @59[2]: _57 = _43 +49:33-49:46: @59[3]: _56 = Gt(move _57, const 5_i32)"><span class="annotation">@59⦊</span>countdown > 5<span class="annotation">⦉@59</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="49:50-49:59: @55[2]: _59 = _43 +49:50-49:64: @55[3]: _58 = Ne(move _59, const 9_i32)"><span class="annotation">@55⦊</span>countdown != 9<span class="annotation">⦉@55</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="50:17-50:30: @61[0]: _43 = const 0_i32 +49:65-51:14: @61[1]: _51 = const ()"><span class="annotation">@61⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="50:17-50:30: @61[0]: _43 = const 0_i32 +49:65-51:14: @61[1]: _51 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="50:17-50:30: @61[0]: _43 = const 0_i32 +49:65-51:14: @61[1]: _51 = const ()"> }<span class="annotation">⦉@61</span></span></span><span><span class="code even" style="--layer: 1" title="51:14-51:14: @62[0]: _51 = const ()"><span class="annotation">@62⦊</span>‸<span class="annotation">⦉@62</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="52:13-52:27: @63[2]: _60 = CheckedSub(_43, const 5_i32) +52:13-52:27: @64[0]: _43 = move (_60.0: i32)"><span class="annotation">@63,64⦊</span>countdown -= 5<span class="annotation">⦉@63,64</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="54:13-54:19: @63[0]: _0 = const ()"><span class="annotation">@63⦊</span>return<span class="annotation">⦉@63</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="54:13-54:19: @52[0]: _0 = const ()"><span class="annotation">@52⦊</span>return<span class="annotation">⦉@52</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="56:6-56:6: @52[0]: _41 = const ()"><span class="annotation">@52⦊</span>‸<span class="annotation">⦉@52</span></span></span><span class="code" style="--layer: 0"> // Note: closing brace shows uncovered (vs. `0` for implicit else) because condition literal</span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="56:6-56:6: @44[0]: _41 = const ()"><span class="annotation">@44⦊</span>‸<span class="annotation">⦉@44</span></span></span><span class="code" style="--layer: 0"> // Note: closing brace shows uncovered (vs. `0` for implicit else) because condition literal</span></span> <span class="line"><span class="code" style="--layer: 0"> // `true` was const-evaluated. The compiler knows the `if` block will be executed.</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="59:25-59:26: @79[3]: _62 = const 0_i32 -59:9-59:22: @79[4]: FakeRead(ForLet, _62) -60:8-60:12: @79[7]: _64 = const true -60:8-60:12: @79[8]: FakeRead(ForMatchedPlace, _64)"><span class="annotation">@79⦊</span>mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="59:25-59:26: @79[3]: _62 = const 0_i32 -59:9-59:22: @79[4]: FakeRead(ForLet, _62) -60:8-60:12: @79[7]: _64 = const true -60:8-60:12: @79[8]: FakeRead(ForMatchedPlace, _64)"> if true<span class="annotation">⦉@79</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="61:9-61:22: @82[0]: _62 = const 1_i32 -60:13-62:6: @82[1]: _63 = const ()"><span class="annotation">@80,82⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="61:9-61:22: @82[0]: _62 = const 1_i32 -60:13-62:6: @82[1]: _63 = const ()"> countdown = 1;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="61:9-61:22: @82[0]: _62 = const 1_i32 -60:13-62:6: @82[1]: _63 = const ()"> }<span class="annotation">⦉@80,82</span></span></span><span><span class="code even" style="--layer: 1" title="62:6-62:6: @81[0]: _63 = const ()"><span class="annotation">@81⦊</span>‸<span class="annotation">⦉@81</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="59:25-59:26: @66[3]: _62 = const 0_i32 +59:9-59:22: @66[4]: FakeRead(ForLet, _62) +60:8-60:12: @66[7]: _64 = const true"><span class="annotation">@66⦊</span>mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="59:25-59:26: @66[3]: _62 = const 0_i32 +59:9-59:22: @66[4]: FakeRead(ForLet, _62) +60:8-60:12: @66[7]: _64 = const true"> if true<span class="annotation">⦉@66</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="61:9-61:22: @67[0]: _62 = const 1_i32 +60:13-62:6: @67[1]: _63 = const ()"><span class="annotation">@67⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="61:9-61:22: @67[0]: _62 = const 1_i32 +60:13-62:6: @67[1]: _63 = const ()"> countdown = 1;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="61:9-61:22: @67[0]: _62 = const 1_i32 +60:13-62:6: @67[1]: _63 = const ()"> }<span class="annotation">⦉@67</span></span></span><span><span class="code even" style="--layer: 1" title="62:6-62:6: @68[0]: _63 = const ()"><span class="annotation">@68⦊</span>‸<span class="annotation">⦉@68</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="64:9-64:10: @106[0]: FakeRead(ForLet, _65)"><span class="annotation">@106⦊</span>z<span class="annotation">⦉@106</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="64:16-64:25: @83[5]: _67 = _62 -64:16-64:29: @83[6]: _66 = Gt(move _67, const 7_i32) -64:16-64:29: @83[8]: FakeRead(ForMatchedPlace, _66)"><span class="annotation">@83⦊</span>countdown > 7<span class="annotation">⦉@83</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="65:9-65:23: @86[0]: _68 = CheckedSub(_62, const 4_i32) -65:9-65:23: @87[0]: _62 = move (_68.0: i32) -64:30-66:6: @87[1]: _65 = const ()"><span class="annotation">@84,86,87⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="65:9-65:23: @86[0]: _68 = CheckedSub(_62, const 4_i32) -65:9-65:23: @87[0]: _62 = move (_68.0: i32) -64:30-66:6: @87[1]: _65 = const ()"> countdown -= 4;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="65:9-65:23: @86[0]: _68 = CheckedSub(_62, const 4_i32) -65:9-65:23: @87[0]: _62 = move (_68.0: i32) -64:30-66:6: @87[1]: _65 = const ()"> }<span class="annotation">⦉@84,86,87</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="66:15-66:24: @85[2]: _70 = _62 -66:15-66:28: @85[3]: _69 = Gt(move _70, const 2_i32) -66:15-66:28: @85[5]: FakeRead(ForMatchedPlace, _69)"><span class="annotation">@85⦊</span>countdown > 2<span class="annotation">⦉@85</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="67:12-67:21: @90[5]: _75 = _62 -67:12-67:25: @90[6]: _74 = Lt(move _75, const 1_i32)"><span class="annotation">@88,90⦊</span>countdown < 1<span class="annotation">⦉@88,90</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="67:29-67:38: @97[2]: _77 = _62 -67:29-67:42: @97[3]: _76 = Gt(move _77, const 5_i32)"><span class="annotation">@97⦊</span>countdown > 5<span class="annotation">⦉@97</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="67:46-67:55: @93[2]: _79 = _62 -67:46-67:60: @93[3]: _78 = Ne(move _79, const 9_i32)"><span class="annotation">@93⦊</span>countdown != 9<span class="annotation">⦉@93</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="68:13-68:26: @101[0]: _62 = const 0_i32 -67:61-69:10: @101[1]: _71 = const ()"><span class="annotation">@99,101⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="68:13-68:26: @101[0]: _62 = const 0_i32 -67:61-69:10: @101[1]: _71 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="68:13-68:26: @101[0]: _62 = const 0_i32 -67:61-69:10: @101[1]: _71 = const ()"> }<span class="annotation">⦉@99,101</span></span></span><span><span class="code odd" style="--layer: 1" title="69:10-69:10: @100[0]: _71 = const ()"><span class="annotation">@100⦊</span>‸<span class="annotation">⦉@100</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="70:9-70:23: @102[2]: _80 = CheckedSub(_62, const 5_i32) -70:9-70:23: @103[0]: _62 = move (_80.0: i32)"><span class="annotation">@102,103⦊</span>countdown -= 5<span class="annotation">⦉@102,103</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="64:9-64:10: @89[1]: FakeRead(ForLet, _65)"><span class="annotation">@89⦊</span>z<span class="annotation">⦉@89</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code even" style="--layer: 1" title="64:16-64:25: @69[5]: _67 = _62 +64:16-64:29: @69[6]: _66 = Gt(move _67, const 7_i32)"><span class="annotation">@69⦊</span>countdown > 7<span class="annotation">⦉@69</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="65:9-65:23: @70[0]: _68 = CheckedSub(_62, const 4_i32) +65:9-65:23: @72[0]: _62 = move (_68.0: i32) +64:30-66:6: @72[1]: _65 = const ()"><span class="annotation">@70,72⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="65:9-65:23: @70[0]: _68 = CheckedSub(_62, const 4_i32) +65:9-65:23: @72[0]: _62 = move (_68.0: i32) +64:30-66:6: @72[1]: _65 = const ()"> countdown -= 4;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="65:9-65:23: @70[0]: _68 = CheckedSub(_62, const 4_i32) +65:9-65:23: @72[0]: _62 = move (_68.0: i32) +64:30-66:6: @72[1]: _65 = const ()"> }<span class="annotation">⦉@70,72</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="66:15-66:24: @71[2]: _70 = _62 +66:15-66:28: @71[3]: _69 = Gt(move _70, const 2_i32)"><span class="annotation">@71⦊</span>countdown > 2<span class="annotation">⦉@71</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="67:12-67:21: @73[5]: _75 = _62 +67:12-67:25: @73[6]: _74 = Lt(move _75, const 1_i32)"><span class="annotation">@73⦊</span>countdown < 1<span class="annotation">⦉@73</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="67:29-67:38: @81[2]: _77 = _62 +67:29-67:42: @81[3]: _76 = Gt(move _77, const 5_i32)"><span class="annotation">@81⦊</span>countdown > 5<span class="annotation">⦉@81</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="67:46-67:55: @77[2]: _79 = _62 +67:46-67:60: @77[3]: _78 = Ne(move _79, const 9_i32)"><span class="annotation">@77⦊</span>countdown != 9<span class="annotation">⦉@77</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="68:13-68:26: @83[0]: _62 = const 0_i32 +67:61-69:10: @83[1]: _71 = const ()"><span class="annotation">@83⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="68:13-68:26: @83[0]: _62 = const 0_i32 +67:61-69:10: @83[1]: _71 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="68:13-68:26: @83[0]: _62 = const 0_i32 +67:61-69:10: @83[1]: _71 = const ()"> }<span class="annotation">⦉@83</span></span></span><span><span class="code odd" style="--layer: 1" title="69:10-69:10: @84[0]: _71 = const ()"><span class="annotation">@84⦊</span>‸<span class="annotation">⦉@84</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="70:9-70:23: @85[2]: _80 = CheckedSub(_62, const 5_i32) +70:9-70:23: @86[0]: _62 = move (_80.0: i32)"><span class="annotation">@85,86⦊</span>countdown -= 5<span class="annotation">⦉@85,86</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="72:35-72:44: @89[1]: _82 = _62 -72:13-72:32: @89[2]: FakeRead(ForLet, _82) -73:18-73:27: @89[9]: _113 = const main::promoted[1] -73:18-73:27: @89[10]: _88 = &(*_113) -73:18-73:27: @89[11]: _87 = &(*_88) -73:18-73:27: @89[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) -73:9-73:29: @89[18]: _94 = () -73:9-73:29: @89[19]: FakeRead(ForMatchedPlace, _94) -73:9-73:29: @89[20]: _112 = const main::promoted[0] -73:9-73:29: @89[21]: _92 = &(*_112) -73:9-73:29: @89[22]: _91 = &(*_92) -73:9-73:29: @89[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -73:9-73:29: @89.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb104, unwind: bb132] -73:9-73:29: @104.Call: _84 = _print(move _85) -> [return: bb105, unwind: bb132] -73:9-73:29: @105[5]: _83 = const () -74:9-74:15: @105[7]: _0 = const ()"><span class="annotation">@89,104,105⦊</span>should_be_reachable = countdown;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="72:35-72:44: @89[1]: _82 = _62 -72:13-72:32: @89[2]: FakeRead(ForLet, _82) -73:18-73:27: @89[9]: _113 = const main::promoted[1] -73:18-73:27: @89[10]: _88 = &(*_113) -73:18-73:27: @89[11]: _87 = &(*_88) -73:18-73:27: @89[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) -73:9-73:29: @89[18]: _94 = () -73:9-73:29: @89[19]: FakeRead(ForMatchedPlace, _94) -73:9-73:29: @89[20]: _112 = const main::promoted[0] -73:9-73:29: @89[21]: _92 = &(*_112) -73:9-73:29: @89[22]: _91 = &(*_92) -73:9-73:29: @89[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -73:9-73:29: @89.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb104, unwind: bb132] -73:9-73:29: @104.Call: _84 = _print(move _85) -> [return: bb105, unwind: bb132] -73:9-73:29: @105[5]: _83 = const () -74:9-74:15: @105[7]: _0 = const ()"> println!("reached");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="72:35-72:44: @89[1]: _82 = _62 -72:13-72:32: @89[2]: FakeRead(ForLet, _82) -73:18-73:27: @89[9]: _113 = const main::promoted[1] -73:18-73:27: @89[10]: _88 = &(*_113) -73:18-73:27: @89[11]: _87 = &(*_88) -73:18-73:27: @89[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) -73:9-73:29: @89[18]: _94 = () -73:9-73:29: @89[19]: FakeRead(ForMatchedPlace, _94) -73:9-73:29: @89[20]: _112 = const main::promoted[0] -73:9-73:29: @89[21]: _92 = &(*_112) -73:9-73:29: @89[22]: _91 = &(*_92) -73:9-73:29: @89[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -73:9-73:29: @89.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb104, unwind: bb132] -73:9-73:29: @104.Call: _84 = _print(move _85) -> [return: bb105, unwind: bb132] -73:9-73:29: @105[5]: _83 = const () -74:9-74:15: @105[7]: _0 = const ()"> return<span class="annotation">⦉@89,104,105</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="72:35-72:44: @74[1]: _82 = _62 +72:13-72:32: @74[2]: FakeRead(ForLet, _82) +73:18-73:27: @74[9]: _113 = const main::promoted[1] +73:18-73:27: @74[10]: _88 = &(*_113) +73:18-73:27: @74[11]: _87 = &(*_88) +73:18-73:27: @74[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) +73:9-73:29: @74[18]: _94 = () +73:9-73:29: @74[19]: FakeRead(ForMatchedPlace, _94) +73:9-73:29: @74[20]: _112 = const main::promoted[0] +73:9-73:29: @74[21]: _92 = &(*_112) +73:9-73:29: @74[22]: _91 = &(*_92) +73:9-73:29: @74[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +73:9-73:29: @74.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb87, unwind: bb112] +73:9-73:29: @87.Call: _84 = _print(move _85) -> [return: bb88, unwind: bb112] +73:9-73:29: @88[5]: _83 = const () +74:9-74:15: @88[7]: _0 = const ()"><span class="annotation">@74,87,88⦊</span>should_be_reachable = countdown;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="72:35-72:44: @74[1]: _82 = _62 +72:13-72:32: @74[2]: FakeRead(ForLet, _82) +73:18-73:27: @74[9]: _113 = const main::promoted[1] +73:18-73:27: @74[10]: _88 = &(*_113) +73:18-73:27: @74[11]: _87 = &(*_88) +73:18-73:27: @74[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) +73:9-73:29: @74[18]: _94 = () +73:9-73:29: @74[19]: FakeRead(ForMatchedPlace, _94) +73:9-73:29: @74[20]: _112 = const main::promoted[0] +73:9-73:29: @74[21]: _92 = &(*_112) +73:9-73:29: @74[22]: _91 = &(*_92) +73:9-73:29: @74[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +73:9-73:29: @74.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb87, unwind: bb112] +73:9-73:29: @87.Call: _84 = _print(move _85) -> [return: bb88, unwind: bb112] +73:9-73:29: @88[5]: _83 = const () +74:9-74:15: @88[7]: _0 = const ()"> println!("reached");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="72:35-72:44: @74[1]: _82 = _62 +72:13-72:32: @74[2]: FakeRead(ForLet, _82) +73:18-73:27: @74[9]: _113 = const main::promoted[1] +73:18-73:27: @74[10]: _88 = &(*_113) +73:18-73:27: @74[11]: _87 = &(*_88) +73:18-73:27: @74[12]: _86 = move _87 as &[&str] (Pointer(Unsize)) +73:9-73:29: @74[18]: _94 = () +73:9-73:29: @74[19]: FakeRead(ForMatchedPlace, _94) +73:9-73:29: @74[20]: _112 = const main::promoted[0] +73:9-73:29: @74[21]: _92 = &(*_112) +73:9-73:29: @74[22]: _91 = &(*_92) +73:9-73:29: @74[23]: _90 = move _91 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +73:9-73:29: @74.Call: _85 = Arguments::new_v1(move _86, move _90) -> [return: bb87, unwind: bb112] +73:9-73:29: @87.Call: _84 = _print(move _85) -> [return: bb88, unwind: bb112] +73:9-73:29: @88[5]: _83 = const () +74:9-74:15: @88[7]: _0 = const ()"> return<span class="annotation">⦉@74,87,88</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> };</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="77:9-77:10: @127[0]: FakeRead(ForLet, _95)"><span class="annotation">@127⦊</span>w<span class="annotation">⦉@127</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code odd" style="--layer: 1" title="77:16-77:25: @106[5]: _97 = _62 -77:16-77:29: @106[6]: _96 = Gt(move _97, const 7_i32) -77:16-77:29: @106[8]: FakeRead(ForMatchedPlace, _96)"><span class="annotation">@106⦊</span>countdown > 7<span class="annotation">⦉@106</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="78:9-78:23: @109[0]: _98 = CheckedSub(_62, const 4_i32) -78:9-78:23: @110[0]: _62 = move (_98.0: i32) -77:30-79:6: @110[1]: _95 = const ()"><span class="annotation">@107,109,110⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="78:9-78:23: @109[0]: _98 = CheckedSub(_62, const 4_i32) -78:9-78:23: @110[0]: _62 = move (_98.0: i32) -77:30-79:6: @110[1]: _95 = const ()"> countdown -= 4;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="78:9-78:23: @109[0]: _98 = CheckedSub(_62, const 4_i32) -78:9-78:23: @110[0]: _62 = move (_98.0: i32) -77:30-79:6: @110[1]: _95 = const ()"> }<span class="annotation">⦉@107,109,110</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="79:15-79:24: @108[2]: _100 = _62 -79:15-79:28: @108[3]: _99 = Gt(move _100, const 2_i32) -79:15-79:28: @108[5]: FakeRead(ForMatchedPlace, _99)"><span class="annotation">@108⦊</span>countdown > 2<span class="annotation">⦉@108</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="80:12-80:21: @113[5]: _105 = _62 -80:12-80:25: @113[6]: _104 = Lt(move _105, const 1_i32)"><span class="annotation">@111,113⦊</span>countdown < 1<span class="annotation">⦉@111,113</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="80:29-80:38: @120[2]: _107 = _62 -80:29-80:42: @120[3]: _106 = Gt(move _107, const 5_i32)"><span class="annotation">@120⦊</span>countdown > 5<span class="annotation">⦉@120</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="80:46-80:55: @116[2]: _109 = _62 -80:46-80:60: @116[3]: _108 = Ne(move _109, const 9_i32)"><span class="annotation">@116⦊</span>countdown != 9<span class="annotation">⦉@116</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="81:13-81:26: @124[0]: _62 = const 0_i32 -80:61-82:10: @124[1]: _101 = const ()"><span class="annotation">@122,124⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="81:13-81:26: @124[0]: _62 = const 0_i32 -80:61-82:10: @124[1]: _101 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="81:13-81:26: @124[0]: _62 = const 0_i32 -80:61-82:10: @124[1]: _101 = const ()"> }<span class="annotation">⦉@122,124</span></span></span><span><span class="code even" style="--layer: 1" title="82:10-82:10: @123[0]: _101 = const ()"><span class="annotation">@123⦊</span>‸<span class="annotation">⦉@123</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="83:9-83:23: @125[2]: _110 = CheckedSub(_62, const 5_i32) -83:9-83:23: @126[0]: _62 = move (_110.0: i32)"><span class="annotation">@125,126⦊</span>countdown -= 5<span class="annotation">⦉@125,126</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="77:9-77:10: @107[1]: FakeRead(ForLet, _95)"><span class="annotation">@107⦊</span>w<span class="annotation">⦉@107</span></span></span><span class="code" style="--layer: 0"> = if </span><span><span class="code odd" style="--layer: 1" title="77:16-77:25: @89[5]: _97 = _62 +77:16-77:29: @89[6]: _96 = Gt(move _97, const 7_i32)"><span class="annotation">@89⦊</span>countdown > 7<span class="annotation">⦉@89</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="78:9-78:23: @90[0]: _98 = CheckedSub(_62, const 4_i32) +78:9-78:23: @92[0]: _62 = move (_98.0: i32) +77:30-79:6: @92[1]: _95 = const ()"><span class="annotation">@90,92⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="78:9-78:23: @90[0]: _98 = CheckedSub(_62, const 4_i32) +78:9-78:23: @92[0]: _62 = move (_98.0: i32) +77:30-79:6: @92[1]: _95 = const ()"> countdown -= 4;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="78:9-78:23: @90[0]: _98 = CheckedSub(_62, const 4_i32) +78:9-78:23: @92[0]: _62 = move (_98.0: i32) +77:30-79:6: @92[1]: _95 = const ()"> }<span class="annotation">⦉@90,92</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code odd" style="--layer: 1" title="79:15-79:24: @91[2]: _100 = _62 +79:15-79:28: @91[3]: _99 = Gt(move _100, const 2_i32)"><span class="annotation">@91⦊</span>countdown > 2<span class="annotation">⦉@91</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="80:12-80:21: @93[5]: _105 = _62 +80:12-80:25: @93[6]: _104 = Lt(move _105, const 1_i32)"><span class="annotation">@93⦊</span>countdown < 1<span class="annotation">⦉@93</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code odd" style="--layer: 1" title="80:29-80:38: @101[2]: _107 = _62 +80:29-80:42: @101[3]: _106 = Gt(move _107, const 5_i32)"><span class="annotation">@101⦊</span>countdown > 5<span class="annotation">⦉@101</span></span></span><span class="code" style="--layer: 0"> || </span><span><span class="code even" style="--layer: 1" title="80:46-80:55: @97[2]: _109 = _62 +80:46-80:60: @97[3]: _108 = Ne(move _109, const 9_i32)"><span class="annotation">@97⦊</span>countdown != 9<span class="annotation">⦉@97</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="81:13-81:26: @103[0]: _62 = const 0_i32 +80:61-82:10: @103[1]: _101 = const ()"><span class="annotation">@103⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="81:13-81:26: @103[0]: _62 = const 0_i32 +80:61-82:10: @103[1]: _101 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="81:13-81:26: @103[0]: _62 = const 0_i32 +80:61-82:10: @103[1]: _101 = const ()"> }<span class="annotation">⦉@103</span></span></span><span><span class="code even" style="--layer: 1" title="82:10-82:10: @104[0]: _101 = const ()"><span class="annotation">@104⦊</span>‸<span class="annotation">⦉@104</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="83:9-83:23: @105[2]: _110 = CheckedSub(_62, const 5_i32) +83:9-83:23: @106[0]: _62 = move (_110.0: i32)"><span class="annotation">@105,106⦊</span>countdown -= 5<span class="annotation">⦉@105,106</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="85:9-85:15: @112[0]: _0 = const ()"><span class="annotation">@112⦊</span>return<span class="annotation">⦉@112</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="85:9-85:15: @94[0]: _0 = const ()"><span class="annotation">@94⦊</span>return<span class="annotation">⦉@94</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> };</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="87:2-87:2: @131.Return: return"><span class="annotation">@131⦊</span>‸<span class="annotation">⦉@131</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="87:2-87:2: @111.Return: return"><span class="annotation">@111⦊</span>‸<span class="annotation">⦉@111</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.main.-------.InstrumentCoverage.0.html index 59d00600738f0..421fe27825c3f 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.main.-------.InstrumentCoverage.0.html @@ -69,83 +69,75 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 26"><span class="line"><span><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 26"><span class="line"><span><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +34:8-34:15: @3[5]: _6 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:19-31:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 31:19-31:35: @1[0]: _3 = &_4 -31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +31:19-31:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 31:19-31:46: @2[1]: _1 = Eq(move _2, const 1_usize) 31:9-31:16: @2[3]: FakeRead(ForLet, _1) 33:25-33:26: @3[2]: _5 = const 0_i32 33:9-33:22: @3[3]: FakeRead(ForLet, _5) -34:8-34:15: @3[5]: _6 = _1 -34:8-34:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-35:23: @6[0]: _5 = const 10_i32 -34:16-36:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-35:23: @6[0]: _5 = const 10_i32 -34:16-36:6: @6[1]: _0 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-35:23: @6[0]: _5 = const 10_i32 -34:16-36:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="36:6-36:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="37:2-37:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +34:8-34:15: @3[5]: _6 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-35:23: @4[0]: _5 = const 10_i32 +34:16-36:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-35:23: @4[0]: _5 = const 10_i32 +34:16-36:6: @4[1]: _0 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-35:23: @4[0]: _5 = const 10_i32 +34:16-36:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="36:6-36:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="37:2-37:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_fn.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_fn.-------.InstrumentCoverage.0.html index 1a535b937887b..ff3493c9f623b 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_fn.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_fn.-------.InstrumentCoverage.0.html @@ -69,83 +69,75 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 14"><span class="line"><span><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 14"><span class="line"><span><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>fn unused_fn() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"><span class="annotation">@0,1,2,3⦊</span>fn unused_fn() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +22:8-22:15: @3[5]: _6 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:19-19:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 19:19-19:35: @1[0]: _3 = &_4 -19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +19:19-19:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 19:19-19:46: @2[1]: _1 = Eq(move _2, const 1_usize) 19:9-19:16: @2[3]: FakeRead(ForLet, _1) 21:25-21:26: @3[2]: _5 = const 0_i32 21:9-21:22: @3[3]: FakeRead(ForLet, _5) -22:8-22:15: @3[5]: _6 = _1 -22:8-22:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-23:23: @6[0]: _5 = const 10_i32 -22:16-24:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-23:23: @6[0]: _5 = const 10_i32 -22:16-24:6: @6[1]: _0 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-23:23: @6[0]: _5 = const 10_i32 -22:16-24:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="24:6-24:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="25:2-25:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +22:8-22:15: @3[5]: _6 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-23:23: @4[0]: _5 = const 10_i32 +22:16-24:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-23:23: @4[0]: _5 = const 10_i32 +22:16-24:6: @4[1]: _0 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-23:23: @4[0]: _5 = const 10_i32 +22:16-24:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="24:6-24:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="25:2-25:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_pub_fn_not_in_library.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_pub_fn_not_in_library.-------.InstrumentCoverage.0.html index 6eff51ad89c73..829113e8a71d5 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_pub_fn_not_in_library.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.dead_code/dead_code.unused_pub_fn_not_in_library.-------.InstrumentCoverage.0.html @@ -69,83 +69,75 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>pub fn unused_pub_fn_not_in_library() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"><span class="annotation">@0,1,2,3⦊</span>pub fn unused_pub_fn_not_in_library() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +10:8-10:15: @3[5]: _6 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[5]: _6 = _1 -10:8-10:15: @3[6]: FakeRead(ForMatchedPlace, _6)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_i32 -10:16-12:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_i32 -10:16-12:6: @6[1]: _0 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_i32 -10:16-12:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="13:2-13:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +10:8-10:15: @3[5]: _6 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_i32 +10:16-12:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_i32 +10:16-12:6: @4[1]: _0 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_i32 +10:16-12:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="13:2-13:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest/doctest.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest/doctest.main.-------.InstrumentCoverage.0.html index 333476a2df573..3566912628a9e 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest/doctest.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest/doctest.main.-------.InstrumentCoverage.0.html @@ -70,58 +70,57 @@ </head> <body> <div class="code" style="counter-reset: line 72"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0⦊</span>fn main() <span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">{</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="74:8-74:12: @0[1]: _1 = const true -74:8-74:12: @0[2]: FakeRead(ForMatchedPlace, _1)"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="75:9-75:26: @5[0]: _2 = const ()"><span class="annotation">@5⦊</span></span></span><span class="code even" style="--layer: 2" title="75:9-75:26: @6[5]: _75 = const main::promoted[3] -75:9-75:26: @6[6]: _18 = &(*_75) -75:9-75:26: @6[7]: _17 = &(*_18) -75:9-75:26: @6[8]: _16 = move _17 as &[&str] (Pointer(Unsize)) -75:9-75:26: @6[17]: _26 = &(*_8) -75:9-75:26: @6[18]: _25 = &_26 -75:9-75:26: @6[21]: _28 = &(*_9) -75:9-75:26: @6[22]: _27 = &_28 -75:9-75:26: @6[23]: _24 = (move _25, move _27) -75:9-75:26: @6[26]: FakeRead(ForMatchedPlace, _24) -75:9-75:26: @6[28]: _29 = (_24.0: &&i32) -75:9-75:26: @6[30]: _30 = (_24.1: &&i32) -75:9-75:26: @6[33]: _32 = &(*_29) -75:9-75:26: @6[35]: _33 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -75:9-75:26: @6.Call: _31 = ArgumentV1::new::<&i32>(move _32, move _33) -> [return: bb7, unwind: bb17] -75:9-75:26: @7[4]: _35 = &(*_30) -75:9-75:26: @7[6]: _36 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -75:9-75:26: @7.Call: _34 = ArgumentV1::new::<&i32>(move _35, move _36) -> [return: bb8, unwind: bb17] -75:9-75:26: @8[2]: _23 = [move _31, move _34] -75:9-75:26: @8[7]: _22 = &_23 -75:9-75:26: @8[8]: _21 = &(*_22) -75:9-75:26: @8[9]: _20 = move _21 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -75:9-75:26: @8.Call: _15 = Arguments::new_v1(move _16, move _20) -> [return: bb9, unwind: bb17] -75:9-75:26: @9.Call: core::panicking::panic_fmt(move _15) -> bb17"><span class="annotation">@4,6,7,8,9⦊</span>assert_eq!(1, 1);<span class="annotation">⦉@4,6,7,8,9</span></span><span><span class="code odd" style="--layer: 1" title="75:9-75:26: @5[0]: _2 = const ()"><span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="74:8-74:12: @0[1]: _1 = const true"><span class="annotation">@0⦊</span>true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="75:9-75:26: @4[0]: _2 = const ()"><span class="annotation">@4⦊</span></span></span><span class="code even" style="--layer: 2" title="75:9-75:26: @3[5]: _75 = const main::promoted[3] +75:9-75:26: @3[6]: _18 = &(*_75) +75:9-75:26: @3[7]: _17 = &(*_18) +75:9-75:26: @3[8]: _16 = move _17 as &[&str] (Pointer(Unsize)) +75:9-75:26: @3[17]: _26 = &(*_8) +75:9-75:26: @3[18]: _25 = &_26 +75:9-75:26: @3[21]: _28 = &(*_9) +75:9-75:26: @3[22]: _27 = &_28 +75:9-75:26: @3[23]: _24 = (move _25, move _27) +75:9-75:26: @3[26]: FakeRead(ForMatchedPlace, _24) +75:9-75:26: @3[28]: _29 = (_24.0: &&i32) +75:9-75:26: @3[30]: _30 = (_24.1: &&i32) +75:9-75:26: @3[33]: _32 = &(*_29) +75:9-75:26: @3[35]: _33 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +75:9-75:26: @3.Call: _31 = ArgumentV1::new::<&i32>(move _32, move _33) -> [return: bb5, unwind: bb14] +75:9-75:26: @5[4]: _35 = &(*_30) +75:9-75:26: @5[6]: _36 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +75:9-75:26: @5.Call: _34 = ArgumentV1::new::<&i32>(move _35, move _36) -> [return: bb6, unwind: bb14] +75:9-75:26: @6[2]: _23 = [move _31, move _34] +75:9-75:26: @6[7]: _22 = &_23 +75:9-75:26: @6[8]: _21 = &(*_22) +75:9-75:26: @6[9]: _20 = move _21 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +75:9-75:26: @6.Call: _15 = Arguments::new_v1(move _16, move _20) -> [return: bb7, unwind: bb14] +75:9-75:26: @7.Call: core::panicking::panic_fmt(move _15) -> bb14"><span class="annotation">@3,5,6,7⦊</span>assert_eq!(1, 1);<span class="annotation">⦉@3,5,6,7</span></span><span><span class="code odd" style="--layer: 1" title="75:9-75:26: @4[0]: _2 = const ()"><span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="77:9-77:26: @11[0]: _37 = const ()"><span class="annotation">@11⦊</span></span></span><span class="code even" style="--layer: 2" title="77:9-77:26: @12[5]: _72 = const main::promoted[0] -77:9-77:26: @12[6]: _53 = &(*_72) -77:9-77:26: @12[7]: _52 = &(*_53) -77:9-77:26: @12[8]: _51 = move _52 as &[&str] (Pointer(Unsize)) -77:9-77:26: @12[17]: _61 = &(*_43) -77:9-77:26: @12[18]: _60 = &_61 -77:9-77:26: @12[21]: _63 = &(*_44) -77:9-77:26: @12[22]: _62 = &_63 -77:9-77:26: @12[23]: _59 = (move _60, move _62) -77:9-77:26: @12[26]: FakeRead(ForMatchedPlace, _59) -77:9-77:26: @12[28]: _64 = (_59.0: &&i32) -77:9-77:26: @12[30]: _65 = (_59.1: &&i32) -77:9-77:26: @12[33]: _67 = &(*_64) -77:9-77:26: @12[35]: _68 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -77:9-77:26: @12.Call: _66 = ArgumentV1::new::<&i32>(move _67, move _68) -> [return: bb13, unwind: bb17] -77:9-77:26: @13[4]: _70 = &(*_65) -77:9-77:26: @13[6]: _71 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -77:9-77:26: @13.Call: _69 = ArgumentV1::new::<&i32>(move _70, move _71) -> [return: bb14, unwind: bb17] -77:9-77:26: @14[2]: _58 = [move _66, move _69] -77:9-77:26: @14[7]: _57 = &_58 -77:9-77:26: @14[8]: _56 = &(*_57) -77:9-77:26: @14[9]: _55 = move _56 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -77:9-77:26: @14.Call: _50 = Arguments::new_v1(move _51, move _55) -> [return: bb15, unwind: bb17] -77:9-77:26: @15.Call: core::panicking::panic_fmt(move _50) -> bb17"><span class="annotation">@10,12,13,14,15⦊</span>assert_eq!(1, 2);<span class="annotation">⦉@10,12,13,14,15</span></span><span><span class="code even" style="--layer: 1" title="77:9-77:26: @11[0]: _37 = const ()"><span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="77:9-77:26: @9[0]: _37 = const ()"><span class="annotation">@9⦊</span></span></span><span class="code even" style="--layer: 2" title="77:9-77:26: @8[5]: _72 = const main::promoted[0] +77:9-77:26: @8[6]: _53 = &(*_72) +77:9-77:26: @8[7]: _52 = &(*_53) +77:9-77:26: @8[8]: _51 = move _52 as &[&str] (Pointer(Unsize)) +77:9-77:26: @8[17]: _61 = &(*_43) +77:9-77:26: @8[18]: _60 = &_61 +77:9-77:26: @8[21]: _63 = &(*_44) +77:9-77:26: @8[22]: _62 = &_63 +77:9-77:26: @8[23]: _59 = (move _60, move _62) +77:9-77:26: @8[26]: FakeRead(ForMatchedPlace, _59) +77:9-77:26: @8[28]: _64 = (_59.0: &&i32) +77:9-77:26: @8[30]: _65 = (_59.1: &&i32) +77:9-77:26: @8[33]: _67 = &(*_64) +77:9-77:26: @8[35]: _68 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +77:9-77:26: @8.Call: _66 = ArgumentV1::new::<&i32>(move _67, move _68) -> [return: bb10, unwind: bb14] +77:9-77:26: @10[4]: _70 = &(*_65) +77:9-77:26: @10[6]: _71 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +77:9-77:26: @10.Call: _69 = ArgumentV1::new::<&i32>(move _70, move _71) -> [return: bb11, unwind: bb14] +77:9-77:26: @11[2]: _58 = [move _66, move _69] +77:9-77:26: @11[7]: _57 = &_58 +77:9-77:26: @11[8]: _56 = &(*_57) +77:9-77:26: @11[9]: _55 = move _56 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +77:9-77:26: @11.Call: _50 = Arguments::new_v1(move _51, move _55) -> [return: bb12, unwind: bb14] +77:9-77:26: @12.Call: core::panicking::panic_fmt(move _50) -> bb14"><span class="annotation">@8,10,11,12⦊</span>assert_eq!(1, 2);<span class="annotation">⦉@8,10,11,12</span></span><span><span class="code even" style="--layer: 1" title="77:9-77:26: @9[0]: _37 = const ()"><span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="79:2-79:2: @16.Return: return"><span class="annotation">@16⦊</span>‸<span class="annotation">⦉@16</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="79:2-79:2: @13.Return: return"><span class="annotation">@13⦊</span>‸<span class="annotation">⦉@13</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest_crate/doctest_crate.fn_run_in_doctests.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest_crate/doctest_crate.fn_run_in_doctests.-------.InstrumentCoverage.0.html index ae119d9ca9f2e..02c25cc904c4a 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest_crate/doctest_crate.fn_run_in_doctests.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.doctest_crate/doctest_crate.fn_run_in_doctests.-------.InstrumentCoverage.0.html @@ -71,103 +71,103 @@ <body> <div class="code" style="counter-reset: line 1"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0⦊</span>pub fn fn_run_in_doctests(conditional: usize) <span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">{</span></span> <span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code even" style="--layer: 1" title="3:11-3:22: @0[0]: FakeRead(ForMatchedPlace, _1)"><span class="annotation">@0⦊</span>conditional<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> 1 => </span><span><span class="code odd" style="--layer: 1" title="4:14-4:30: @7[0]: _0 = const ()"><span class="annotation">@7⦊</span></span></span><span class="code even" style="--layer: 2" title="4:14-4:30: @8[5]: _138 = const fn_run_in_doctests::promoted[0] -4:14-4:30: @8[6]: _17 = &(*_138) -4:14-4:30: @8[7]: _16 = &(*_17) -4:14-4:30: @8[8]: _15 = move _16 as &[&str] (Pointer(Unsize)) -4:14-4:30: @8[17]: _25 = &(*_7) -4:14-4:30: @8[18]: _24 = &_25 -4:14-4:30: @8[21]: _27 = &(*_8) -4:14-4:30: @8[22]: _26 = &_27 -4:14-4:30: @8[23]: _23 = (move _24, move _26) -4:14-4:30: @8[26]: FakeRead(ForMatchedPlace, _23) -4:14-4:30: @8[28]: _28 = (_23.0: &&i32) -4:14-4:30: @8[30]: _29 = (_23.1: &&i32) -4:14-4:30: @8[33]: _31 = &(*_28) -4:14-4:30: @8[35]: _32 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -4:14-4:30: @8.Call: _30 = ArgumentV1::new::<&i32>(move _31, move _32) -> [return: bb9, unwind: bb33] -4:14-4:30: @9[4]: _34 = &(*_29) -4:14-4:30: @9[6]: _35 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -4:14-4:30: @9.Call: _33 = ArgumentV1::new::<&i32>(move _34, move _35) -> [return: bb10, unwind: bb33] -4:14-4:30: @10[2]: _22 = [move _30, move _33] -4:14-4:30: @10[7]: _21 = &_22 -4:14-4:30: @10[8]: _20 = &(*_21) -4:14-4:30: @10[9]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -4:14-4:30: @10.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb11, unwind: bb33] -4:14-4:30: @11.Call: core::panicking::panic_fmt(move _14) -> bb33"><span class="annotation">@6,8,9,10,11⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@6,8,9,10,11</span></span><span><span class="code odd" style="--layer: 1" title="4:14-4:30: @7[0]: _0 = const ()"><span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0">, // this is run,</span></span> -<span class="line"><span class="code" style="--layer: 0"> 2 => </span><span><span class="code even" style="--layer: 1" title="5:14-5:30: @14[0]: _0 = const ()"><span class="annotation">@14⦊</span></span></span><span class="code even" style="--layer: 2" title="5:14-5:30: @15[5]: _141 = const fn_run_in_doctests::promoted[3] -5:14-5:30: @15[6]: _51 = &(*_141) -5:14-5:30: @15[7]: _50 = &(*_51) -5:14-5:30: @15[8]: _49 = move _50 as &[&str] (Pointer(Unsize)) -5:14-5:30: @15[17]: _59 = &(*_41) -5:14-5:30: @15[18]: _58 = &_59 -5:14-5:30: @15[21]: _61 = &(*_42) -5:14-5:30: @15[22]: _60 = &_61 -5:14-5:30: @15[23]: _57 = (move _58, move _60) -5:14-5:30: @15[26]: FakeRead(ForMatchedPlace, _57) -5:14-5:30: @15[28]: _62 = (_57.0: &&i32) -5:14-5:30: @15[30]: _63 = (_57.1: &&i32) -5:14-5:30: @15[33]: _65 = &(*_62) -5:14-5:30: @15[35]: _66 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -5:14-5:30: @15.Call: _64 = ArgumentV1::new::<&i32>(move _65, move _66) -> [return: bb16, unwind: bb33] -5:14-5:30: @16[4]: _68 = &(*_63) -5:14-5:30: @16[6]: _69 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -5:14-5:30: @16.Call: _67 = ArgumentV1::new::<&i32>(move _68, move _69) -> [return: bb17, unwind: bb33] -5:14-5:30: @17[2]: _56 = [move _64, move _67] -5:14-5:30: @17[7]: _55 = &_56 -5:14-5:30: @17[8]: _54 = &(*_55) -5:14-5:30: @17[9]: _53 = move _54 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -5:14-5:30: @17.Call: _48 = Arguments::new_v1(move _49, move _53) -> [return: bb18, unwind: bb33] -5:14-5:30: @18.Call: core::panicking::panic_fmt(move _48) -> bb33"><span class="annotation">@13,15,16,17,18⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@13,15,16,17,18</span></span><span><span class="code even" style="--layer: 1" title="5:14-5:30: @14[0]: _0 = const ()"><span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0">, // this,</span></span> -<span class="line"><span class="code" style="--layer: 0"> 3 => </span><span><span class="code odd" style="--layer: 1" title="6:14-6:30: @21[0]: _0 = const ()"><span class="annotation">@21⦊</span></span></span><span class="code even" style="--layer: 2" title="6:14-6:30: @22[5]: _144 = const fn_run_in_doctests::promoted[6] -6:14-6:30: @22[6]: _85 = &(*_144) -6:14-6:30: @22[7]: _84 = &(*_85) -6:14-6:30: @22[8]: _83 = move _84 as &[&str] (Pointer(Unsize)) -6:14-6:30: @22[17]: _93 = &(*_75) -6:14-6:30: @22[18]: _92 = &_93 -6:14-6:30: @22[21]: _95 = &(*_76) -6:14-6:30: @22[22]: _94 = &_95 -6:14-6:30: @22[23]: _91 = (move _92, move _94) -6:14-6:30: @22[26]: FakeRead(ForMatchedPlace, _91) -6:14-6:30: @22[28]: _96 = (_91.0: &&i32) -6:14-6:30: @22[30]: _97 = (_91.1: &&i32) -6:14-6:30: @22[33]: _99 = &(*_96) -6:14-6:30: @22[35]: _100 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -6:14-6:30: @22.Call: _98 = ArgumentV1::new::<&i32>(move _99, move _100) -> [return: bb23, unwind: bb33] -6:14-6:30: @23[4]: _102 = &(*_97) -6:14-6:30: @23[6]: _103 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -6:14-6:30: @23.Call: _101 = ArgumentV1::new::<&i32>(move _102, move _103) -> [return: bb24, unwind: bb33] -6:14-6:30: @24[2]: _90 = [move _98, move _101] -6:14-6:30: @24[7]: _89 = &_90 -6:14-6:30: @24[8]: _88 = &(*_89) -6:14-6:30: @24[9]: _87 = move _88 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:14-6:30: @24.Call: _82 = Arguments::new_v1(move _83, move _87) -> [return: bb25, unwind: bb33] -6:14-6:30: @25.Call: core::panicking::panic_fmt(move _82) -> bb33"><span class="annotation">@20,22,23,24,25⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@20,22,23,24,25</span></span><span><span class="code odd" style="--layer: 1" title="6:14-6:30: @21[0]: _0 = const ()"><span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0">, // and this too</span></span> -<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code even" style="--layer: 1" title="7:14-7:30: @27[0]: _0 = const ()"><span class="annotation">@27⦊</span></span></span><span class="code even" style="--layer: 2" title="7:14-7:30: @28[5]: _147 = const fn_run_in_doctests::promoted[9] -7:14-7:30: @28[6]: _119 = &(*_147) -7:14-7:30: @28[7]: _118 = &(*_119) -7:14-7:30: @28[8]: _117 = move _118 as &[&str] (Pointer(Unsize)) -7:14-7:30: @28[17]: _127 = &(*_109) -7:14-7:30: @28[18]: _126 = &_127 -7:14-7:30: @28[21]: _129 = &(*_110) -7:14-7:30: @28[22]: _128 = &_129 -7:14-7:30: @28[23]: _125 = (move _126, move _128) -7:14-7:30: @28[26]: FakeRead(ForMatchedPlace, _125) -7:14-7:30: @28[28]: _130 = (_125.0: &&i32) -7:14-7:30: @28[30]: _131 = (_125.1: &&i32) -7:14-7:30: @28[33]: _133 = &(*_130) -7:14-7:30: @28[35]: _134 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -7:14-7:30: @28.Call: _132 = ArgumentV1::new::<&i32>(move _133, move _134) -> [return: bb29, unwind: bb33] -7:14-7:30: @29[4]: _136 = &(*_131) -7:14-7:30: @29[6]: _137 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -7:14-7:30: @29.Call: _135 = ArgumentV1::new::<&i32>(move _136, move _137) -> [return: bb30, unwind: bb33] -7:14-7:30: @30[2]: _124 = [move _132, move _135] -7:14-7:30: @30[7]: _123 = &_124 -7:14-7:30: @30[8]: _122 = &(*_123) -7:14-7:30: @30[9]: _121 = move _122 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -7:14-7:30: @30.Call: _116 = Arguments::new_v1(move _117, move _121) -> [return: bb31, unwind: bb33] -7:14-7:30: @31.Call: core::panicking::panic_fmt(move _116) -> bb33"><span class="annotation">@26,28,29,30,31⦊</span>assert_eq!(1, 2)<span class="annotation">⦉@26,28,29,30,31</span></span><span><span class="code even" style="--layer: 1" title="7:14-7:30: @27[0]: _0 = const ()"><span class="annotation">⦉@27</span></span></span><span class="code" style="--layer: 0">, // however this is not</span></span> +<span class="line"><span class="code" style="--layer: 0"> 1 => </span><span><span class="code odd" style="--layer: 1" title="4:14-4:30: @7[0]: _0 = const ()"><span class="annotation">@7⦊</span></span></span><span class="code even" style="--layer: 2" title="4:14-4:30: @6[5]: _138 = const fn_run_in_doctests::promoted[0] +4:14-4:30: @6[6]: _17 = &(*_138) +4:14-4:30: @6[7]: _16 = &(*_17) +4:14-4:30: @6[8]: _15 = move _16 as &[&str] (Pointer(Unsize)) +4:14-4:30: @6[17]: _25 = &(*_7) +4:14-4:30: @6[18]: _24 = &_25 +4:14-4:30: @6[21]: _27 = &(*_8) +4:14-4:30: @6[22]: _26 = &_27 +4:14-4:30: @6[23]: _23 = (move _24, move _26) +4:14-4:30: @6[26]: FakeRead(ForMatchedPlace, _23) +4:14-4:30: @6[28]: _28 = (_23.0: &&i32) +4:14-4:30: @6[30]: _29 = (_23.1: &&i32) +4:14-4:30: @6[33]: _31 = &(*_28) +4:14-4:30: @6[35]: _32 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +4:14-4:30: @6.Call: _30 = ArgumentV1::new::<&i32>(move _31, move _32) -> [return: bb8, unwind: bb29] +4:14-4:30: @8[4]: _34 = &(*_29) +4:14-4:30: @8[6]: _35 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +4:14-4:30: @8.Call: _33 = ArgumentV1::new::<&i32>(move _34, move _35) -> [return: bb9, unwind: bb29] +4:14-4:30: @9[2]: _22 = [move _30, move _33] +4:14-4:30: @9[7]: _21 = &_22 +4:14-4:30: @9[8]: _20 = &(*_21) +4:14-4:30: @9[9]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +4:14-4:30: @9.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb10, unwind: bb29] +4:14-4:30: @10.Call: core::panicking::panic_fmt(move _14) -> bb29"><span class="annotation">@6,8,9,10⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@6,8,9,10</span></span><span><span class="code odd" style="--layer: 1" title="4:14-4:30: @7[0]: _0 = const ()"><span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0">, // this is run,</span></span> +<span class="line"><span class="code" style="--layer: 0"> 2 => </span><span><span class="code even" style="--layer: 1" title="5:14-5:30: @13[0]: _0 = const ()"><span class="annotation">@13⦊</span></span></span><span class="code even" style="--layer: 2" title="5:14-5:30: @12[5]: _141 = const fn_run_in_doctests::promoted[3] +5:14-5:30: @12[6]: _51 = &(*_141) +5:14-5:30: @12[7]: _50 = &(*_51) +5:14-5:30: @12[8]: _49 = move _50 as &[&str] (Pointer(Unsize)) +5:14-5:30: @12[17]: _59 = &(*_41) +5:14-5:30: @12[18]: _58 = &_59 +5:14-5:30: @12[21]: _61 = &(*_42) +5:14-5:30: @12[22]: _60 = &_61 +5:14-5:30: @12[23]: _57 = (move _58, move _60) +5:14-5:30: @12[26]: FakeRead(ForMatchedPlace, _57) +5:14-5:30: @12[28]: _62 = (_57.0: &&i32) +5:14-5:30: @12[30]: _63 = (_57.1: &&i32) +5:14-5:30: @12[33]: _65 = &(*_62) +5:14-5:30: @12[35]: _66 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +5:14-5:30: @12.Call: _64 = ArgumentV1::new::<&i32>(move _65, move _66) -> [return: bb14, unwind: bb29] +5:14-5:30: @14[4]: _68 = &(*_63) +5:14-5:30: @14[6]: _69 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +5:14-5:30: @14.Call: _67 = ArgumentV1::new::<&i32>(move _68, move _69) -> [return: bb15, unwind: bb29] +5:14-5:30: @15[2]: _56 = [move _64, move _67] +5:14-5:30: @15[7]: _55 = &_56 +5:14-5:30: @15[8]: _54 = &(*_55) +5:14-5:30: @15[9]: _53 = move _54 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +5:14-5:30: @15.Call: _48 = Arguments::new_v1(move _49, move _53) -> [return: bb16, unwind: bb29] +5:14-5:30: @16.Call: core::panicking::panic_fmt(move _48) -> bb29"><span class="annotation">@12,14,15,16⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@12,14,15,16</span></span><span><span class="code even" style="--layer: 1" title="5:14-5:30: @13[0]: _0 = const ()"><span class="annotation">⦉@13</span></span></span><span class="code" style="--layer: 0">, // this,</span></span> +<span class="line"><span class="code" style="--layer: 0"> 3 => </span><span><span class="code odd" style="--layer: 1" title="6:14-6:30: @19[0]: _0 = const ()"><span class="annotation">@19⦊</span></span></span><span class="code even" style="--layer: 2" title="6:14-6:30: @18[5]: _144 = const fn_run_in_doctests::promoted[6] +6:14-6:30: @18[6]: _85 = &(*_144) +6:14-6:30: @18[7]: _84 = &(*_85) +6:14-6:30: @18[8]: _83 = move _84 as &[&str] (Pointer(Unsize)) +6:14-6:30: @18[17]: _93 = &(*_75) +6:14-6:30: @18[18]: _92 = &_93 +6:14-6:30: @18[21]: _95 = &(*_76) +6:14-6:30: @18[22]: _94 = &_95 +6:14-6:30: @18[23]: _91 = (move _92, move _94) +6:14-6:30: @18[26]: FakeRead(ForMatchedPlace, _91) +6:14-6:30: @18[28]: _96 = (_91.0: &&i32) +6:14-6:30: @18[30]: _97 = (_91.1: &&i32) +6:14-6:30: @18[33]: _99 = &(*_96) +6:14-6:30: @18[35]: _100 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +6:14-6:30: @18.Call: _98 = ArgumentV1::new::<&i32>(move _99, move _100) -> [return: bb20, unwind: bb29] +6:14-6:30: @20[4]: _102 = &(*_97) +6:14-6:30: @20[6]: _103 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +6:14-6:30: @20.Call: _101 = ArgumentV1::new::<&i32>(move _102, move _103) -> [return: bb21, unwind: bb29] +6:14-6:30: @21[2]: _90 = [move _98, move _101] +6:14-6:30: @21[7]: _89 = &_90 +6:14-6:30: @21[8]: _88 = &(*_89) +6:14-6:30: @21[9]: _87 = move _88 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:14-6:30: @21.Call: _82 = Arguments::new_v1(move _83, move _87) -> [return: bb22, unwind: bb29] +6:14-6:30: @22.Call: core::panicking::panic_fmt(move _82) -> bb29"><span class="annotation">@18,20,21,22⦊</span>assert_eq!(1, 1)<span class="annotation">⦉@18,20,21,22</span></span><span><span class="code odd" style="--layer: 1" title="6:14-6:30: @19[0]: _0 = const ()"><span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0">, // and this too</span></span> +<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code even" style="--layer: 1" title="7:14-7:30: @24[0]: _0 = const ()"><span class="annotation">@24⦊</span></span></span><span class="code even" style="--layer: 2" title="7:14-7:30: @23[5]: _147 = const fn_run_in_doctests::promoted[9] +7:14-7:30: @23[6]: _119 = &(*_147) +7:14-7:30: @23[7]: _118 = &(*_119) +7:14-7:30: @23[8]: _117 = move _118 as &[&str] (Pointer(Unsize)) +7:14-7:30: @23[17]: _127 = &(*_109) +7:14-7:30: @23[18]: _126 = &_127 +7:14-7:30: @23[21]: _129 = &(*_110) +7:14-7:30: @23[22]: _128 = &_129 +7:14-7:30: @23[23]: _125 = (move _126, move _128) +7:14-7:30: @23[26]: FakeRead(ForMatchedPlace, _125) +7:14-7:30: @23[28]: _130 = (_125.0: &&i32) +7:14-7:30: @23[30]: _131 = (_125.1: &&i32) +7:14-7:30: @23[33]: _133 = &(*_130) +7:14-7:30: @23[35]: _134 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +7:14-7:30: @23.Call: _132 = ArgumentV1::new::<&i32>(move _133, move _134) -> [return: bb25, unwind: bb29] +7:14-7:30: @25[4]: _136 = &(*_131) +7:14-7:30: @25[6]: _137 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +7:14-7:30: @25.Call: _135 = ArgumentV1::new::<&i32>(move _136, move _137) -> [return: bb26, unwind: bb29] +7:14-7:30: @26[2]: _124 = [move _132, move _135] +7:14-7:30: @26[7]: _123 = &_124 +7:14-7:30: @26[8]: _122 = &(*_123) +7:14-7:30: @26[9]: _121 = move _122 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +7:14-7:30: @26.Call: _116 = Arguments::new_v1(move _117, move _121) -> [return: bb27, unwind: bb29] +7:14-7:30: @27.Call: core::panicking::panic_fmt(move _116) -> bb29"><span class="annotation">@23,25,26,27⦊</span>assert_eq!(1, 2)<span class="annotation">⦉@23,25,26,27</span></span><span><span class="code even" style="--layer: 1" title="7:14-7:30: @24[0]: _0 = const ()"><span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0">, // however this is not</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="9:2-9:2: @32.Return: return"><span class="annotation">@32⦊</span>‸<span class="annotation">⦉@32</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="9:2-9:2: @28.Return: return"><span class="annotation">@28⦊</span>‸<span class="annotation">⦉@28</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html index fa3c4b3c31257..3b5d1e2cdac28 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.drop_trait/drop_trait.main.-------.InstrumentCoverage.0.html @@ -73,86 +73,80 @@ 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>fn main() -> Result<(),u8> {</span></span> +19:8-19:12: @0[8]: _4 = const true"><span class="annotation">@0⦊</span>fn main() -> Result<(),u8> {</span></span> <span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"> let _firecracker = Firework { strength: 1 };</span></span> +19:8-19:12: @0[8]: _4 = const true"> let _firecracker = Firework { strength: 1 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"></span></span> +19:8-19:12: @0[8]: _4 = const true"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"> let _tnt = Firework { strength: 100 };</span></span> +19:8-19:12: @0[8]: _4 = const true"> let _tnt = Firework { strength: 100 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"></span></span> +19:8-19:12: @0[8]: _4 = const true"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="15:24-15:48: @0[1]: _1 = Firework { strength: const 1_i32 } 15:9-15:21: @0[2]: FakeRead(ForLet, _1) 17:16-17:42: @0[4]: _2 = Firework { strength: const 100_i32 } 17:9-17:13: @0[5]: FakeRead(ForLet, _2) -19:8-19:12: @0[8]: _4 = const true -19:8-19:12: @0[9]: FakeRead(ForMatchedPlace, _4)"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] -20:18-20:41: @3[7]: _11 = &(*_21) -20:18-20:41: @3[8]: _10 = &(*_11) -20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) -20:9-20:43: @3[15]: _17 = () -20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) -20:9-20:43: @3[17]: _20 = const main::promoted[0] -20:9-20:43: @3[18]: _15 = &(*_20) -20:9-20:43: @3[19]: _14 = &(*_15) -20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] -20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] -20:9-20:43: @5[5]: _6 = const () -21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@1,3,4,5,9,10⦊</span>println!("Exiting with error...");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="20:18-20:41: @3[6]: _21 = const main::promoted[1] -20:18-20:41: @3[7]: _11 = &(*_21) -20:18-20:41: @3[8]: _10 = &(*_11) -20:18-20:41: @3[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) -20:9-20:43: @3[15]: _17 = () -20:9-20:43: @3[16]: FakeRead(ForMatchedPlace, _17) -20:9-20:43: @3[17]: _20 = const main::promoted[0] -20:9-20:43: @3[18]: _15 = &(*_20) -20:9-20:43: @3[19]: _14 = &(*_15) -20:9-20:43: @3[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:9-20:43: @3.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb4, unwind: bb12] -20:9-20:43: @4.Call: _7 = _print(move _8) -> [return: bb5, unwind: bb12] -20:9-20:43: @5[5]: _6 = const () -21:16-21:22: @5[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@1,3,4,5,9,10</span></span></span><span class="code" style="--layer: 0">;</span></span> +19:8-19:12: @0[8]: _4 = const true"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:18-20:41: @1[6]: _21 = const main::promoted[1] +20:18-20:41: @1[7]: _11 = &(*_21) +20:18-20:41: @1[8]: _10 = &(*_11) +20:18-20:41: @1[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @1[15]: _17 = () +20:9-20:43: @1[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @1[17]: _20 = const main::promoted[0] +20:9-20:43: @1[18]: _15 = &(*_20) +20:9-20:43: @1[19]: _14 = &(*_15) +20:9-20:43: @1[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @1.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb11] +20:9-20:43: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb11] +20:9-20:43: @4[5]: _6 = const () +21:16-21:22: @4[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@1,3,4,8,9⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="20:18-20:41: @1[6]: _21 = const main::promoted[1] +20:18-20:41: @1[7]: _11 = &(*_21) +20:18-20:41: @1[8]: _10 = &(*_11) +20:18-20:41: @1[9]: _9 = move _10 as &[&str] (Pointer(Unsize)) +20:9-20:43: @1[15]: _17 = () +20:9-20:43: @1[16]: FakeRead(ForMatchedPlace, _17) +20:9-20:43: @1[17]: _20 = const main::promoted[0] +20:9-20:43: @1[18]: _15 = &(*_20) +20:9-20:43: @1[19]: _14 = &(*_15) +20:9-20:43: @1[20]: _13 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:9-20:43: @1.Call: _8 = Arguments::new_v1(move _9, move _13) -> [return: bb3, unwind: bb11] +20:9-20:43: @3.Call: _7 = _print(move _8) -> [return: bb4, unwind: bb11] +20:9-20:43: @4[5]: _6 = const () +21:16-21:22: @4[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@1,3,4,8,9</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="22:6-22:6: @2[0]: _3 = const () 24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } -26:8-26:10: @6[2]: _19 = () -26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"><span class="annotation">@2,6,7,8⦊</span></span></span> +26:8-26:10: @5[2]: _19 = () +26:5-26:11: @5[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"><span class="annotation">@2,5,6,7⦊</span></span></span> <span class="line"><span class="code even" style="--layer: 1" title="22:6-22:6: @2[0]: _3 = const () 24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } -26:8-26:10: @6[2]: _19 = () -26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> +26:8-26:10: @5[2]: _19 = () +26:5-26:11: @5[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="22:6-22:6: @2[0]: _3 = const () 24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } -26:8-26:10: @6[2]: _19 = () -26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> let _ = Firework { strength: 1000 };</span></span> +26:8-26:10: @5[2]: _19 = () +26:5-26:11: @5[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> let _ = Firework { strength: 1000 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="22:6-22:6: @2[0]: _3 = const () 24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } -26:8-26:10: @6[2]: _19 = () -26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> +26:8-26:10: @5[2]: _19 = () +26:5-26:11: @5[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="22:6-22:6: @2[0]: _3 = const () 24:13-24:40: @2[4]: _18 = Firework { strength: const 1000_i32 } -26:8-26:10: @6[2]: _19 = () -26:5-26:11: @6[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> Ok(())<span class="annotation">⦉@2,6,7,8</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="27:2-27:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +26:8-26:10: @5[2]: _19 = () +26:5-26:11: @5[3]: _0 = std::result::Result::<(), u8>::Ok(move _19)"> Ok(())<span class="annotation">⦉@2,5,6,7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="27:2-27:2: @10.Return: return"><span class="annotation">@10⦊</span>‸<span class="annotation">⦉@10</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html index 52c5d4f47b1d3..0373b38e1b11f 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.generics/generics.main.-------.InstrumentCoverage.0.html @@ -72,175 +72,166 @@ <div class="code" style="counter-reset: line 21"><span class="line"><span><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>fn main() -> Result<(),u8> {</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"><span class="annotation">@0,1,2,3⦊</span>fn main() -> Result<(),u8> {</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> let mut firecracker = Firework { strength: 1 };</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> let mut firecracker = Firework { strength: 1 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> firecracker.set_strength(2);</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> firecracker.set_strength(2);</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"></span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> let mut tnt = Firework { strength: 100.1 };</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> let mut tnt = Firework { strength: 100.1 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> tnt.set_strength(200.1);</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> tnt.set_strength(200.1);</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> tnt.set_strength(300.3);</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> tnt.set_strength(300.3);</span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"></span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="23:27-23:51: @0[1]: _1 = Firework::<i32> { strength: const 1_i32 } 23:9-23:24: @0[2]: FakeRead(ForLet, _1) 24:5-24:16: @0[5]: _3 = &mut _1 -24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb16] +24:5-24:32: @0.Call: _2 = Firework::<i32>::set_strength(move _3, const 2_i32) -> [return: bb1, unwind: bb15] 26:19-26:47: @1[3]: _4 = Firework::<f64> { strength: const 100.09999999999999f64 } 26:9-26:16: @1[4]: FakeRead(ForLet, _4) 27:5-27:8: @1[7]: _6 = &mut _4 -27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb15] +27:5-27:28: @1.Call: _5 = Firework::<f64>::set_strength(move _6, const 200.09999999999999f64) -> [return: bb2, unwind: bb14] 28:5-28:8: @2[4]: _8 = &mut _4 -28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb15] -30:8-30:12: @3[4]: _10 = const true -30:8-30:12: @3[5]: FakeRead(ForMatchedPlace, _10)"> if true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] -31:18-31:41: @6[7]: _17 = &(*_27) -31:18-31:41: @6[8]: _16 = &(*_17) -31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) -31:9-31:43: @6[15]: _23 = () -31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) -31:9-31:43: @6[17]: _26 = const main::promoted[0] -31:9-31:43: @6[18]: _21 = &(*_26) -31:9-31:43: @6[19]: _20 = &(*_21) -31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] -31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] -31:9-31:43: @8[5]: _12 = const () -32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@4,6,7,8,12,13⦊</span>println!("Exiting with error...");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="31:18-31:41: @6[6]: _27 = const main::promoted[1] -31:18-31:41: @6[7]: _17 = &(*_27) -31:18-31:41: @6[8]: _16 = &(*_17) -31:18-31:41: @6[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) -31:9-31:43: @6[15]: _23 = () -31:9-31:43: @6[16]: FakeRead(ForMatchedPlace, _23) -31:9-31:43: @6[17]: _26 = const main::promoted[0] -31:9-31:43: @6[18]: _21 = &(*_26) -31:9-31:43: @6[19]: _20 = &(*_21) -31:9-31:43: @6[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -31:9-31:43: @6.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb7, unwind: bb15] -31:9-31:43: @7.Call: _13 = _print(move _14) -> [return: bb8, unwind: bb15] -31:9-31:43: @8[5]: _12 = const () -32:16-32:22: @8[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@4,6,7,8,12,13</span></span></span><span class="code" style="--layer: 0">;</span></span> +28:5-28:28: @2.Call: _7 = Firework::<f64>::set_strength(move _8, const 300.30000000000001f64) -> [return: bb3, unwind: bb14] +30:8-30:12: @3[4]: _10 = const true"> if true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="31:18-31:41: @4[6]: _27 = const main::promoted[1] +31:18-31:41: @4[7]: _17 = &(*_27) +31:18-31:41: @4[8]: _16 = &(*_17) +31:18-31:41: @4[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @4[15]: _23 = () +31:9-31:43: @4[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @4[17]: _26 = const main::promoted[0] +31:9-31:43: @4[18]: _21 = &(*_26) +31:9-31:43: @4[19]: _20 = &(*_21) +31:9-31:43: @4[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @4.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb6, unwind: bb14] +31:9-31:43: @6.Call: _13 = _print(move _14) -> [return: bb7, unwind: bb14] +31:9-31:43: @7[5]: _12 = const () +32:16-32:22: @7[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@4,6,7,11,12⦊</span>println!("Exiting with error...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="31:18-31:41: @4[6]: _27 = const main::promoted[1] +31:18-31:41: @4[7]: _17 = &(*_27) +31:18-31:41: @4[8]: _16 = &(*_17) +31:18-31:41: @4[9]: _15 = move _16 as &[&str] (Pointer(Unsize)) +31:9-31:43: @4[15]: _23 = () +31:9-31:43: @4[16]: FakeRead(ForMatchedPlace, _23) +31:9-31:43: @4[17]: _26 = const main::promoted[0] +31:9-31:43: @4[18]: _21 = &(*_26) +31:9-31:43: @4[19]: _20 = &(*_21) +31:9-31:43: @4[20]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +31:9-31:43: @4.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb6, unwind: bb14] +31:9-31:43: @6.Call: _13 = _print(move _14) -> [return: bb7, unwind: bb14] +31:9-31:43: @7[5]: _12 = const () +32:16-32:22: @7[7]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"> return Err(1)<span class="annotation">⦉@4,6,7,11,12</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"><span class="annotation">@5,9,10,11⦊</span> // The remaining lines below have no coverage because `if true` (with the constant literal</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"><span class="annotation">@5,8,9,10⦊</span> // The remaining lines below have no coverage because `if true` (with the constant literal</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // `true`) is guaranteed to execute the `then` block, which is also guaranteed to `return`.</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // `true`) is guaranteed to execute the `then` block, which is also guaranteed to `return`.</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // Thankfully, in the normal case, conditions are not guaranteed ahead of time, and as shown</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // Thankfully, in the normal case, conditions are not guaranteed ahead of time, and as shown</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // in other tests, the lines below would have coverage (which would show they had `0`</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // in other tests, the lines below would have coverage (which would show they had `0`</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // executions, assuming the condition still evaluated to `true`).</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> // executions, assuming the condition still evaluated to `true`).</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> let _ = Firework { strength: 1000 };</span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> let _ = Firework { strength: 1000 };</span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"></span></span> <span class="line"><span class="code even" style="--layer: 1" title="33:6-33:6: @5[0]: _9 = const () 39:13-39:40: @5[4]: _24 = Firework::<i32> { strength: const 1000_i32 } -41:8-41:10: @9[2]: _25 = () -41:5-41:11: @9[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> Ok(())<span class="annotation">⦉@5,9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="42:2-42:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +41:8-41:10: @8[2]: _25 = () +41:5-41:11: @8[3]: _0 = std::result::Result::<(), u8>::Ok(move _25)"> Ok(())<span class="annotation">⦉@5,8,9,10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="42:2-42:2: @13.Return: return"><span class="annotation">@13⦊</span>‸<span class="annotation">⦉@13</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html index 8eb6c1dcb877a..dd9ba4a190cd8 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if/if.main.-------.InstrumentCoverage.0.html @@ -69,189 +69,170 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> let</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> is_true</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> is_true</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> =</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> std::env::args().len()</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> std::env::args().len()</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> ==</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> ==</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> 1</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> 1</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> let</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> let</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> mut</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> mut</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> countdown</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> =</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> 0</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> 0</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> if</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +21:9-21:16: @3[5]: _6 = _1"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:9-10:25: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 10:9-10:25: @1[0]: _3 = &_4 -10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +10:9-10:31: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 10:9-12:10: @2[1]: _1 = Eq(move _2, const 1_usize) 8:5-8:12: @2[3]: FakeRead(ForLet, _1) 18:9-18:10: @3[2]: _5 = const 0_i32 15:9-16:14: @3[3]: FakeRead(ForLet, _5) -21:9-21:16: @3[5]: _6 = _1 -21:9-21:16: @3[6]: FakeRead(ForMatchedPlace, _6)"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"> countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"> =</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"> 10</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"> ;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @6[0]: _5 = const 10_i32 -22:5-27:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="27:6-27:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="28:2-28:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +21:9-21:16: @3[5]: _6 = _1"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:9-25:15: @4[0]: _5 = const 10_i32 +22:5-27:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="27:6-27:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="28:2-28:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html index 5b2cce4f648fc..b642be382cbc4 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.if_else/if_else.main.-------.InstrumentCoverage.0.html @@ -69,99 +69,90 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> if</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] +11:9-11:16: @3[6]: _7 = _1"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb11] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb10] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -11:9-11:16: @3[6]: _7 = _1 -11:9-11:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"> countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"> =</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"> 10</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"> ;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @6[0]: _5 = const 10_i32 -12:5-17:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span class="code" style="--layer: 0"></span></span> +11:9-11:16: @3[6]: _7 = _1"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="13:9-15:15: @4[0]: _5 = const 10_i32 +12:5-17:6: @4[1]: _6 = const ()"> }<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> else // Note coverage region difference without semicolon</span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="20:9-22:16: @5[0]: _5 = const 100_i32 @@ -173,33 +164,32 @@ <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:16: @7[3]: _8 = _1 -26:9-26:16: @7[4]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"><span class="annotation">@8,10⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"> countdown</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"> =</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"> 10</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @10[0]: _5 = const 10_i32 -27:5-32:6: @10[1]: _0 = const ()"> }<span class="annotation">⦉@8,10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:9-26:16: @6[3]: _8 = _1"><span class="annotation">@6⦊</span>is_true<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"><span class="annotation">@7⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"> 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="28:9-30:15: @7[0]: _5 = const 10_i32 +27:5-32:6: @7[1]: _0 = const ()"> }<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> else</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"><span class="annotation">@9⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"> countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"> =</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"> 100</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"> ;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @9[0]: _5 = const 100_i32 -34:5-39:6: @9[1]: _0 = const ()"> }<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="40:2-40:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"><span class="annotation">@8⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"> 100</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="35:9-37:16: @8[0]: _5 = const 100_i32 +34:5-39:6: @8[1]: _0 = const ()"> }<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="40:2-40:2: @9.Return: return"><span class="annotation">@9⦊</span>‸<span class="annotation">⦉@9</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html index 693b15f15b9ca..d21710b7240d3 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.inner_items/inner_items.main.-------.InstrumentCoverage.0.html @@ -73,47 +73,43 @@ <span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> <span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> <span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_u32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +10:8-10:15: @3[6]: _7 = _1"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_u32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +10:8-10:15: @3[6]: _7 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_u32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +10:8-10:15: @3[6]: _7 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_u32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 -10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 -10:16-12:6: @6[1]: _6 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @6[0]: _5 = const 10_u32 -10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +10:8-10:15: @3[6]: _7 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_u32 +10:16-12:6: @4[1]: _6 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_u32 +10:16-12:6: @4[1]: _6 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:23: @4[0]: _5 = const 10_u32 +10:16-12:6: @4[1]: _6 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> mod in_mod {</span></span> <span class="line"><span class="code" style="--layer: 0"> const IN_MOD_CONST: u32 = 1000;</span></span> @@ -149,46 +145,45 @@ <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> type InType = String;</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="48:8-48:15: @7[4]: _9 = _1 -48:8-48:15: @7[5]: FakeRead(ForMatchedPlace, _9)"><span class="annotation">@7⦊</span>is_true<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 -49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] -48:16-50:6: @11[2]: _8 = const ()"><span class="annotation">@8,10,11⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 -49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] -48:16-50:6: @11[2]: _8 = const ()"> in_func(countdown);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="49:17-49:26: @10[2]: _11 = _5 -49:9-49:27: @10.Call: _10 = in_func(move _11) -> [return: bb11, unwind: bb15] -48:16-50:6: @11[2]: _8 = const ()"> }<span class="annotation">⦉@8,10,11</span></span></span><span><span class="code odd" style="--layer: 1" title="50:6-50:6: @9[0]: _8 = const ()"><span class="annotation">@9⦊</span>‸<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="48:8-48:15: @6[4]: _9 = _1"><span class="annotation">@6⦊</span>is_true<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="49:17-49:26: @7[2]: _11 = _5 +49:9-49:27: @7.Call: _10 = in_func(move _11) -> [return: bb9, unwind: bb13] +48:16-50:6: @9[2]: _8 = const ()"><span class="annotation">@7,9⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="49:17-49:26: @7[2]: _11 = _5 +49:9-49:27: @7.Call: _10 = in_func(move _11) -> [return: bb9, unwind: bb13] +48:16-50:6: @9[2]: _8 = const ()"> in_func(countdown);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="49:17-49:26: @7[2]: _11 = _5 +49:9-49:27: @7.Call: _10 = in_func(move _11) -> [return: bb9, unwind: bb13] +48:16-50:6: @9[2]: _8 = const ()"> }<span class="annotation">⦉@7,9</span></span></span><span><span class="code odd" style="--layer: 1" title="50:6-50:6: @8[0]: _8 = const ()"><span class="annotation">@8⦊</span>‸<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return"><span class="annotation">@12,13⦊</span>mut val = InStruct {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return"> in_struct_field: 101,</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return"> };</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return"> val.default_trait_func();</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @12[3]: _12 = InStruct { in_struct_field: const 101_u32 } -52:9-52:16: @12[4]: FakeRead(ForLet, _12) -56:5-56:8: @12[7]: _14 = &mut _12 -56:5-56:29: @12.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb13, unwind: bb15] -57:2-57:2: @13.Return: return">}<span class="annotation">⦉@12,13</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return"><span class="annotation">@10,11⦊</span>mut val = InStruct {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return"> in_struct_field: 101,</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return"> };</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return"> val.default_trait_func();</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="52:19-54:6: @10[3]: _12 = InStruct { in_struct_field: const 101_u32 } +52:9-52:16: @10[4]: FakeRead(ForLet, _12) +56:5-56:8: @10[7]: _14 = &mut _12 +56:5-56:29: @10.Call: _13 = <InStruct as InTrait>::default_trait_func(move _14) -> [return: bb11, unwind: bb13] +57:2-57:2: @11.Return: return">}<span class="annotation">⦉@10,11</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html index f30f0ed9a8489..0cfe2119fbc8a 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.lazy_boolean/lazy_boolean.main.-------.InstrumentCoverage.0.html @@ -69,204 +69,191 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> let (mut a, mut b, mut c) = (0, 0, 0);</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +10:8-10:15: @3[12]: _10 = _1"> let (mut a, mut b, mut c) = (0, 0, 0);</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb36] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb35] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:33-9:42: @3[2]: _8 = (const 0_i32, const 0_i32, const 0_i32) 9:10-9:15: @3[4]: _5 = (_8.0: i32) 9:17-9:22: @3[6]: _6 = (_8.1: i32) 9:24-9:29: @3[8]: _7 = (_8.2: i32) -10:8-10:15: @3[12]: _10 = _1 -10:8-10:15: @3[13]: FakeRead(ForMatchedPlace, _10)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 -12:9-12:15: @6[1]: _6 = const 10_i32 -13:9-13:16: @6[2]: _7 = const 100_i32 -10:16-14:6: @6[3]: _9 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 -12:9-12:15: @6[1]: _6 = const 10_i32 -13:9-13:16: @6[2]: _7 = const 100_i32 -10:16-14:6: @6[3]: _9 = const ()"> a = 1;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 -12:9-12:15: @6[1]: _6 = const 10_i32 -13:9-13:16: @6[2]: _7 = const 100_i32 -10:16-14:6: @6[3]: _9 = const ()"> b = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 -12:9-12:15: @6[1]: _6 = const 10_i32 -13:9-13:16: @6[2]: _7 = const 100_i32 -10:16-14:6: @6[3]: _9 = const ()"> c = 100;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @6[0]: _5 = const 1_i32 -12:9-12:15: @6[1]: _6 = const 10_i32 -13:9-13:16: @6[2]: _7 = const 100_i32 -10:16-14:6: @6[3]: _9 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="14:6-14:6: @5[0]: _9 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +10:8-10:15: @3[12]: _10 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:14: @4[0]: _5 = const 1_i32 +12:9-12:15: @4[1]: _6 = const 10_i32 +13:9-13:16: @4[2]: _7 = const 100_i32 +10:16-14:6: @4[3]: _9 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @4[0]: _5 = const 1_i32 +12:9-12:15: @4[1]: _6 = const 10_i32 +13:9-13:16: @4[2]: _7 = const 100_i32 +10:16-14:6: @4[3]: _9 = const ()"> a = 1;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @4[0]: _5 = const 1_i32 +12:9-12:15: @4[1]: _6 = const 10_i32 +13:9-13:16: @4[2]: _7 = const 100_i32 +10:16-14:6: @4[3]: _9 = const ()"> b = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @4[0]: _5 = const 1_i32 +12:9-12:15: @4[1]: _6 = const 10_i32 +13:9-13:16: @4[2]: _7 = const 100_i32 +10:16-14:6: @4[3]: _9 = const ()"> c = 100;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:14: @4[0]: _5 = const 1_i32 +12:9-12:15: @4[1]: _6 = const 10_i32 +13:9-13:16: @4[2]: _7 = const 100_i32 +10:16-14:6: @4[3]: _9 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="14:6-14:6: @5[0]: _9 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> let</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="16:9-16:17: @11[2]: FakeRead(ForLet, _11)"><span class="annotation">@11⦊</span>somebool<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="16:9-16:17: @10[2]: FakeRead(ForLet, _11)"><span class="annotation">@10⦊</span>somebool<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> =</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:13-18:14: @7[5]: _13 = _5 -18:17-18:18: @7[7]: _14 = _6 -18:13-18:18: @7[8]: _12 = Lt(move _13, move _14)"><span class="annotation">@7⦊</span>a < b<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:13-18:14: @6[5]: _13 = _5 +18:17-18:18: @6[7]: _14 = _6 +18:13-18:18: @6[8]: _12 = Lt(move _13, move _14)"><span class="annotation">@6⦊</span>a < b<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ||</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:13-20:14: @10[2]: _16 = _6 -20:17-20:18: @10[4]: _17 = _7 -20:13-20:18: @10[5]: _15 = Lt(move _16, move _17)"><span class="annotation">@10⦊</span>b < c<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="20:13-20:14: @9[2]: _16 = _6 +20:17-20:18: @9[4]: _17 = _7 +20:13-20:18: @9[5]: _15 = Lt(move _16, move _17)"><span class="annotation">@9⦊</span>b < c<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> <span class="line"><span class="code" style="--layer: 0"> let</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:9-23:17: @15[2]: FakeRead(ForLet, _18)"><span class="annotation">@15⦊</span>somebool<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:9-23:17: @14[2]: FakeRead(ForLet, _18)"><span class="annotation">@14⦊</span>somebool<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> =</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:13-25:14: @11[6]: _20 = _6 -25:17-25:18: @11[8]: _21 = _5 -25:13-25:18: @11[9]: _19 = Lt(move _20, move _21)"><span class="annotation">@11⦊</span>b < a<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:13-25:14: @10[6]: _20 = _6 +25:17-25:18: @10[8]: _21 = _5 +25:13-25:18: @10[9]: _19 = Lt(move _20, move _21)"><span class="annotation">@10⦊</span>b < a<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ||</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:14: @14[2]: _23 = _6 -27:17-27:18: @14[4]: _24 = _7 -27:13-27:18: @14[5]: _22 = Lt(move _23, move _24)"><span class="annotation">@14⦊</span>b < c<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:14: @13[2]: _23 = _6 +27:17-27:18: @13[4]: _24 = _7 +27:13-27:18: @13[5]: _22 = Lt(move _23, move _24)"><span class="annotation">@13⦊</span>b < c<span class="annotation">⦉@13</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="29:9-29:17: @19[2]: FakeRead(ForLet, _25)"><span class="annotation">@19⦊</span>somebool<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code even" style="--layer: 1" title="29:20-29:21: @15[6]: _27 = _5 -29:24-29:25: @15[8]: _28 = _6 -29:20-29:25: @15[9]: _26 = Lt(move _27, move _28)"><span class="annotation">@15⦊</span>a < b<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"> && </span><span><span class="code odd" style="--layer: 1" title="29:29-29:30: @18[2]: _30 = _6 -29:33-29:34: @18[4]: _31 = _7 -29:29-29:34: @18[5]: _29 = Lt(move _30, move _31)"><span class="annotation">@18⦊</span>b < c<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0">;</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="30:9-30:17: @23[2]: FakeRead(ForLet, _32)"><span class="annotation">@23⦊</span>somebool<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code odd" style="--layer: 1" title="30:20-30:21: @19[6]: _34 = _6 -30:24-30:25: @19[8]: _35 = _5 -30:20-30:25: @19[9]: _33 = Lt(move _34, move _35)"><span class="annotation">@19⦊</span>b < a<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"> && </span><span><span class="code even" style="--layer: 1" title="30:29-30:30: @22[2]: _37 = _6 -30:33-30:34: @22[4]: _38 = _7 -30:29-30:34: @22[5]: _36 = Lt(move _37, move _38)"><span class="annotation">@22⦊</span>b < c<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="29:9-29:17: @18[2]: FakeRead(ForLet, _25)"><span class="annotation">@18⦊</span>somebool<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code even" style="--layer: 1" title="29:20-29:21: @14[6]: _27 = _5 +29:24-29:25: @14[8]: _28 = _6 +29:20-29:25: @14[9]: _26 = Lt(move _27, move _28)"><span class="annotation">@14⦊</span>a < b<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"> && </span><span><span class="code odd" style="--layer: 1" title="29:29-29:30: @17[2]: _30 = _6 +29:33-29:34: @17[4]: _31 = _7 +29:29-29:34: @17[5]: _29 = Lt(move _30, move _31)"><span class="annotation">@17⦊</span>b < c<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="30:9-30:17: @22[2]: FakeRead(ForLet, _32)"><span class="annotation">@22⦊</span>somebool<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"> = </span><span><span class="code odd" style="--layer: 1" title="30:20-30:21: @18[6]: _34 = _6 +30:24-30:25: @18[8]: _35 = _5 +30:20-30:25: @18[9]: _33 = Lt(move _34, move _35)"><span class="annotation">@18⦊</span>b < a<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"> && </span><span><span class="code even" style="--layer: 1" title="30:29-30:30: @21[2]: _37 = _6 +30:33-30:34: @21[4]: _38 = _7 +30:29-30:34: @21[5]: _36 = Lt(move _37, move _38)"><span class="annotation">@21⦊</span>b < c<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:16: @23[6]: _41 = _1 -33:9-34:16: @23[7]: _40 = Not(move _41) -33:9-34:16: @23[9]: FakeRead(ForMatchedPlace, _40)"><span class="annotation">@23⦊</span>!</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="34:9-34:16: @23[6]: _41 = _1 -33:9-34:16: @23[7]: _40 = Not(move _41) -33:9-34:16: @23[9]: FakeRead(ForMatchedPlace, _40)"> is_true<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:14: @26[0]: _5 = const 2_i32 -35:5-38:6: @26[1]: _39 = const ()"><span class="annotation">@24,26⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @26[0]: _5 = const 2_i32 -35:5-38:6: @26[1]: _39 = const ()"> a = 2</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @26[0]: _5 = const 2_i32 -35:5-38:6: @26[1]: _39 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @26[0]: _5 = const 2_i32 -35:5-38:6: @26[1]: _39 = const ()"> }<span class="annotation">⦉@24,26</span></span></span><span><span class="code odd" style="--layer: 1" title="38:6-38:6: @25[0]: _39 = const ()"><span class="annotation">@25⦊</span>‸<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="34:9-34:16: @22[6]: _41 = _1 +33:9-34:16: @22[7]: _40 = Not(move _41)"><span class="annotation">@22⦊</span>!</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="34:9-34:16: @22[6]: _41 = _1 +33:9-34:16: @22[7]: _40 = Not(move _41)"> is_true<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="36:9-36:14: @23[0]: _5 = const 2_i32 +35:5-38:6: @23[1]: _39 = const ()"><span class="annotation">@23⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @23[0]: _5 = const 2_i32 +35:5-38:6: @23[1]: _39 = const ()"> a = 2</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @23[0]: _5 = const 2_i32 +35:5-38:6: @23[1]: _39 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="36:9-36:14: @23[0]: _5 = const 2_i32 +35:5-38:6: @23[1]: _39 = const ()"> }<span class="annotation">⦉@23</span></span></span><span><span class="code odd" style="--layer: 1" title="38:6-38:6: @24[0]: _39 = const ()"><span class="annotation">@24⦊</span>‸<span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:9-41:16: @27[4]: _43 = _1 -41:9-41:16: @27[5]: FakeRead(ForMatchedPlace, _43)"><span class="annotation">@27⦊</span>is_true<span class="annotation">⦉@27</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="43:9-43:15: @30[0]: _6 = const 30_i32 -42:5-45:6: @30[1]: _42 = const ()"><span class="annotation">@28,30⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @30[0]: _6 = const 30_i32 -42:5-45:6: @30[1]: _42 = const ()"> b = 30</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @30[0]: _6 = const 30_i32 -42:5-45:6: @30[1]: _42 = const ()"> ;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @30[0]: _6 = const 30_i32 -42:5-45:6: @30[1]: _42 = const ()"> }<span class="annotation">⦉@28,30</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="41:9-41:16: @25[4]: _43 = _1"><span class="annotation">@25⦊</span>is_true<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="43:9-43:15: @26[0]: _6 = const 30_i32 +42:5-45:6: @26[1]: _42 = const ()"><span class="annotation">@26⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @26[0]: _6 = const 30_i32 +42:5-45:6: @26[1]: _42 = const ()"> b = 30</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @26[0]: _6 = const 30_i32 +42:5-45:6: @26[1]: _42 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="43:9-43:15: @26[0]: _6 = const 30_i32 +42:5-45:6: @26[1]: _42 = const ()"> }<span class="annotation">⦉@26</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> else</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="48:9-48:16: @29[0]: _7 = const 400_i32 -47:5-50:6: @29[1]: _42 = const ()"><span class="annotation">@29⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @29[0]: _7 = const 400_i32 -47:5-50:6: @29[1]: _42 = const ()"> c = 400</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @29[0]: _7 = const 400_i32 -47:5-50:6: @29[1]: _42 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @29[0]: _7 = const 400_i32 -47:5-50:6: @29[1]: _42 = const ()"> }<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="48:9-48:16: @27[0]: _7 = const 400_i32 +47:5-50:6: @27[1]: _42 = const ()"><span class="annotation">@27⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @27[0]: _7 = const 400_i32 +47:5-50:6: @27[1]: _42 = const ()"> c = 400</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @27[0]: _7 = const 400_i32 +47:5-50:6: @27[1]: _42 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="48:9-48:16: @27[0]: _7 = const 400_i32 +47:5-50:6: @27[1]: _42 = const ()"> }<span class="annotation">⦉@27</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="52:9-52:16: @31[5]: _46 = _1 -52:8-52:16: @31[6]: _45 = Not(move _46) -52:8-52:16: @31[8]: FakeRead(ForMatchedPlace, _45)"><span class="annotation">@31⦊</span>!is_true<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="53:9-53:14: @34[0]: _5 = const 2_i32 -52:17-54:6: @34[1]: _44 = const ()"><span class="annotation">@32,34⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="53:9-53:14: @34[0]: _5 = const 2_i32 -52:17-54:6: @34[1]: _44 = const ()"> a = 2;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="53:9-53:14: @34[0]: _5 = const 2_i32 -52:17-54:6: @34[1]: _44 = const ()"> }<span class="annotation">⦉@32,34</span></span></span><span><span class="code odd" style="--layer: 1" title="54:6-54:6: @33[0]: _44 = const ()"><span class="annotation">@33⦊</span>‸<span class="annotation">⦉@33</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="52:9-52:16: @28[5]: _46 = _1 +52:8-52:16: @28[6]: _45 = Not(move _46)"><span class="annotation">@28⦊</span>!is_true<span class="annotation">⦉@28</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="53:9-53:14: @29[0]: _5 = const 2_i32 +52:17-54:6: @29[1]: _44 = const ()"><span class="annotation">@29⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="53:9-53:14: @29[0]: _5 = const 2_i32 +52:17-54:6: @29[1]: _44 = const ()"> a = 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="53:9-53:14: @29[0]: _5 = const 2_i32 +52:17-54:6: @29[1]: _44 = const ()"> }<span class="annotation">⦉@29</span></span></span><span><span class="code odd" style="--layer: 1" title="54:6-54:6: @30[0]: _44 = const ()"><span class="annotation">@30⦊</span>‸<span class="annotation">⦉@30</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="56:8-56:15: @35[3]: _47 = _1 -56:8-56:15: @35[4]: FakeRead(ForMatchedPlace, _47)"><span class="annotation">@35⦊</span>is_true<span class="annotation">⦉@35</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="57:9-57:15: @38[0]: _6 = const 30_i32 -56:16-58:6: @38[1]: _0 = const ()"><span class="annotation">@36,38⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="57:9-57:15: @38[0]: _6 = const 30_i32 -56:16-58:6: @38[1]: _0 = const ()"> b = 30;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="57:9-57:15: @38[0]: _6 = const 30_i32 -56:16-58:6: @38[1]: _0 = const ()"> }<span class="annotation">⦉@36,38</span></span></span><span class="code" style="--layer: 0"> else </span><span><span class="code even" style="--layer: 1" title="59:9-59:16: @37[0]: _7 = const 400_i32 -58:12-60:6: @37[1]: _0 = const ()"><span class="annotation">@37⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="59:9-59:16: @37[0]: _7 = const 400_i32 -58:12-60:6: @37[1]: _0 = const ()"> c = 400;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="59:9-59:16: @37[0]: _7 = const 400_i32 -58:12-60:6: @37[1]: _0 = const ()"> }<span class="annotation">⦉@37</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="61:2-61:2: @39.Return: return"><span class="annotation">@39⦊</span>‸<span class="annotation">⦉@39</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="56:8-56:15: @31[3]: _47 = _1"><span class="annotation">@31⦊</span>is_true<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="57:9-57:15: @32[0]: _6 = const 30_i32 +56:16-58:6: @32[1]: _0 = const ()"><span class="annotation">@32⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="57:9-57:15: @32[0]: _6 = const 30_i32 +56:16-58:6: @32[1]: _0 = const ()"> b = 30;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="57:9-57:15: @32[0]: _6 = const 30_i32 +56:16-58:6: @32[1]: _0 = const ()"> }<span class="annotation">⦉@32</span></span></span><span class="code" style="--layer: 0"> else </span><span><span class="code even" style="--layer: 1" title="59:9-59:16: @33[0]: _7 = const 400_i32 +58:12-60:6: @33[1]: _0 = const ()"><span class="annotation">@33⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="59:9-59:16: @33[0]: _7 = const 400_i32 +58:12-60:6: @33[1]: _0 = const ()"> c = 400;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="59:9-59:16: @33[0]: _7 = const 400_i32 +58:12-60:6: @33[1]: _0 = const ()"> }<span class="annotation">⦉@33</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="61:2-61:2: @34.Return: return"><span class="annotation">@34⦊</span>‸<span class="annotation">⦉@34</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.loops_branches/loops_branches.{impl#0}-fmt.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.loops_branches/loops_branches.{impl#0}-fmt.-------.InstrumentCoverage.0.html index 312d2ee7e8f0e..b3f344f7fc0b8 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.loops_branches/loops_branches.{impl#0}-fmt.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.loops_branches/loops_branches.{impl#0}-fmt.-------.InstrumentCoverage.0.html @@ -69,35 +69,32 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 8"><span class="line"> <span><span class="code even" style="--layer: 1" title="10:12-10:16: @0[2]: _4 = const true -10:12-10:16: @0[3]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@0⦊</span>fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="10:12-10:16: @0[2]: _4 = const true -10:12-10:16: @0[3]: FakeRead(ForMatchedPlace, _4)"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="11:16-11:21: @3[2]: _6 = const false -11:16-11:21: @3[3]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@1,3⦊</span>false<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> while </span><span><span class="code even" style="--layer: 1" title="12:23-12:27: @7[1]: _8 = const true -12:23-12:27: @7[2]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@6,7⦊</span>true<span class="annotation">⦉@6,7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:28-13:18: @10[0]: _7 = const ()"><span class="annotation">@8,10⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:28-13:18: @10[0]: _7 = const ()"> }<span class="annotation">⦉@8,10</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="14:14-14:14: @5[0]: _5 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:20-15:21: @11[6]: _13 = &mut (*_2) -15:23-15:30: @11[11]: _32 = const <DebugTest as Debug>::fmt::promoted[1] -15:23-15:30: @11[12]: _17 = &(*_32) -15:23-15:30: @11[13]: _16 = &(*_17) -15:23-15:30: @11[14]: _15 = move _16 as &[&str] (Pointer(Unsize)) -15:13-15:31: @11[20]: _23 = () -15:13-15:31: @11[21]: FakeRead(ForMatchedPlace, _23) -15:13-15:31: @11[22]: _31 = const <DebugTest as Debug>::fmt::promoted[0] -15:13-15:31: @11[23]: _21 = &(*_31) -15:13-15:31: @11[24]: _20 = &(*_21) -15:13-15:31: @11[25]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -15:13-15:31: @11.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb12, unwind: bb23] -15:13-15:31: @12.Call: _12 = Formatter::write_fmt(move _13, move _14) -> [return: bb13, unwind: bb23]"><span class="annotation">@11,12,13,14⦊</span>write!(f, "error")<span class="annotation">⦉@11,12,13,14</span></span></span><span><span class="code even" style="--layer: 1" title="15:31-15:32: @18[1]: _25 = ((_11 as Err).0: std::fmt::Error) -15:31-15:32: @18[4]: _28 = _25 -15:31-15:32: @18.Call: _27 = <std::fmt::Error as From<std::fmt::Error>>::from(move _28) -> [return: bb19, unwind: bb23]"><span class="annotation">@16,18,19,20⦊</span>?<span class="annotation">⦉@16,18,19,20</span></span></span><span class="code" style="--layer: 0">;</span></span> +<div class="code" style="counter-reset: line 8"><span class="line"> <span><span class="code even" style="--layer: 1" title="10:12-10:16: @0[2]: _4 = const true"><span class="annotation">@0⦊</span>fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="10:12-10:16: @0[2]: _4 = const true"> if true<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="11:16-11:21: @1[2]: _6 = const false"><span class="annotation">@1⦊</span>false<span class="annotation">⦉@1</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> while </span><span><span class="code even" style="--layer: 1" title="12:23-12:27: @5[1]: _8 = const true +12:23-12:27: @5[2]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@4,5⦊</span>true<span class="annotation">⦉@4,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:28-13:18: @8[0]: _7 = const ()"><span class="annotation">@6,8⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:28-13:18: @8[0]: _7 = const ()"> }<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="14:14-14:14: @3[0]: _5 = const ()"><span class="annotation">@3⦊</span>‸<span class="annotation">⦉@3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:20-15:21: @9[6]: _13 = &mut (*_2) +15:23-15:30: @9[11]: _32 = const <DebugTest as Debug>::fmt::promoted[1] +15:23-15:30: @9[12]: _17 = &(*_32) +15:23-15:30: @9[13]: _16 = &(*_17) +15:23-15:30: @9[14]: _15 = move _16 as &[&str] (Pointer(Unsize)) +15:13-15:31: @9[20]: _23 = () +15:13-15:31: @9[21]: FakeRead(ForMatchedPlace, _23) +15:13-15:31: @9[22]: _31 = const <DebugTest as Debug>::fmt::promoted[0] +15:13-15:31: @9[23]: _21 = &(*_31) +15:13-15:31: @9[24]: _20 = &(*_21) +15:13-15:31: @9[25]: _19 = move _20 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +15:13-15:31: @9.Call: _14 = Arguments::new_v1(move _15, move _19) -> [return: bb10, unwind: bb21] +15:13-15:31: @10.Call: _12 = Formatter::write_fmt(move _13, move _14) -> [return: bb11, unwind: bb21]"><span class="annotation">@9,10,11,12⦊</span>write!(f, "error")<span class="annotation">⦉@9,10,11,12</span></span></span><span><span class="code even" style="--layer: 1" title="15:31-15:32: @16[1]: _25 = ((_11 as Err).0: std::fmt::Error) +15:31-15:32: @16[4]: _28 = _25 +15:31-15:32: @16.Call: _27 = <std::fmt::Error as From<std::fmt::Error>>::from(move _28) -> [return: bb17, unwind: bb21]"><span class="annotation">@14,16,17,18⦊</span>?<span class="annotation">⦉@14,16,17,18</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> } else </span><span><span class="code odd" style="--layer: 1" title="16:16-17:10: @2[0]: _3 = const ()"><span class="annotation">@2⦊</span>{</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="16:16-17:10: @2[0]: _3 = const ()"> }<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:12-18:14: @21[3]: _30 = () -18:9-18:15: @21[4]: _0 = std::result::Result::<(), std::fmt::Error>::Ok(move _30)"><span class="annotation">@21⦊</span>Ok(())<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="19:6-19:6: @22.Return: return"><span class="annotation">@22⦊</span>‸<span class="annotation">⦉@22</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="18:12-18:14: @19[3]: _30 = () +18:9-18:15: @19[4]: _0 = std::result::Result::<(), std::fmt::Error>::Ok(move _30)"><span class="annotation">@19⦊</span>Ok(())<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="19:6-19:6: @20.Return: return"><span class="annotation">@20⦊</span>‸<span class="annotation">⦉@20</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.match_or_pattern/match_or_pattern.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.match_or_pattern/match_or_pattern.main.-------.InstrumentCoverage.0.html index 133a85c83945e..c7992614b5b6f 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.match_or_pattern/match_or_pattern.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.match_or_pattern/match_or_pattern.main.-------.InstrumentCoverage.0.html @@ -69,9 +69,9 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -80,11 +80,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -93,11 +92,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -106,11 +104,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -119,11 +116,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -132,11 +128,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -145,11 +140,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -158,11 +152,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> let mut a: u8 = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> let mut a: u8 = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -171,11 +164,10 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> let mut b: u8 = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb41] +11:8-11:15: @3[11]: _8 = _1"> let mut b: u8 = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb37] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb40] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb36] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:21-9:22: @3[2]: _5 = const 0_u8 @@ -184,88 +176,84 @@ 10:21-10:22: @3[6]: _6 = const 0_u8 10:9-10:14: @3[7]: FakeRead(ForLet, _6) 10:16-10:18: @3[8]: AscribeUserType(_6, o, UserTypeProjection { base: UserType(3), projs: [] }) -11:8-11:15: @3[11]: _8 = _1 -11:8-11:15: @3[12]: FakeRead(ForMatchedPlace, _8)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:14: @6[0]: _5 = const 2_u8 -13:9-13:14: @6[1]: _6 = const 0_u8 -11:16-14:6: @6[2]: _7 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @6[0]: _5 = const 2_u8 -13:9-13:14: @6[1]: _6 = const 0_u8 -11:16-14:6: @6[2]: _7 = const ()"> a = 2;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @6[0]: _5 = const 2_u8 -13:9-13:14: @6[1]: _6 = const 0_u8 -11:16-14:6: @6[2]: _7 = const ()"> b = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @6[0]: _5 = const 2_u8 -13:9-13:14: @6[1]: _6 = const 0_u8 -11:16-14:6: @6[2]: _7 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="14:6-14:6: @5[0]: _7 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="15:12-15:13: @7[5]: _11 = _5 -15:15-15:16: @7[7]: _12 = _6 -15:11-15:17: @7[8]: _10 = (move _11, move _12) -15:11-15:17: @7[11]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@7⦊</span>(a, b)<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> {</span></span> +11:8-11:15: @3[11]: _8 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:14: @4[0]: _5 = const 2_u8 +13:9-13:14: @4[1]: _6 = const 0_u8 +11:16-14:6: @4[2]: _7 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @4[0]: _5 = const 2_u8 +13:9-13:14: @4[1]: _6 = const 0_u8 +11:16-14:6: @4[2]: _7 = const ()"> a = 2;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @4[0]: _5 = const 2_u8 +13:9-13:14: @4[1]: _6 = const 0_u8 +11:16-14:6: @4[2]: _7 = const ()"> b = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:14: @4[0]: _5 = const 2_u8 +13:9-13:14: @4[1]: _6 = const 0_u8 +11:16-14:6: @4[2]: _7 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="14:6-14:6: @5[0]: _7 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="15:12-15:13: @6[5]: _11 = _5 +15:15-15:16: @6[7]: _12 = _6 +15:11-15:17: @6[8]: _10 = (move _11, move _12) +15:11-15:17: @6[11]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@6⦊</span>(a, b)<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> // Or patterns generate MIR `SwitchInt` with multiple targets to the same `BasicBlock`.</span></span> <span class="line"><span class="code" style="--layer: 0"> // This test confirms a fix for Issue #79569.</span></span> -<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="18:27-18:29: @11[0]: _9 = const ()"><span class="annotation">@10,11⦊</span>{}<span class="annotation">⦉@10,11</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="19:14-19:16: @8[0]: _9 = const ()"><span class="annotation">@8⦊</span>{}<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="18:27-18:29: @10[0]: _9 = const ()"><span class="annotation">@9,10⦊</span>{}<span class="annotation">⦉@9,10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="19:14-19:16: @7[0]: _9 = const ()"><span class="annotation">@7⦊</span>{}<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="21:8-21:15: @12[4]: _14 = _1 -21:8-21:15: @12[5]: FakeRead(ForMatchedPlace, _14)"><span class="annotation">@12⦊</span>is_true<span class="annotation">⦉@12</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:9-22:14: @15[0]: _5 = const 0_u8 -23:9-23:14: @15[1]: _6 = const 0_u8 -21:16-24:6: @15[2]: _13 = const ()"><span class="annotation">@13,15⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @15[0]: _5 = const 0_u8 -23:9-23:14: @15[1]: _6 = const 0_u8 -21:16-24:6: @15[2]: _13 = const ()"> a = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @15[0]: _5 = const 0_u8 -23:9-23:14: @15[1]: _6 = const 0_u8 -21:16-24:6: @15[2]: _13 = const ()"> b = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @15[0]: _5 = const 0_u8 -23:9-23:14: @15[1]: _6 = const 0_u8 -21:16-24:6: @15[2]: _13 = const ()"> }<span class="annotation">⦉@13,15</span></span></span><span><span class="code even" style="--layer: 1" title="24:6-24:6: @14[0]: _13 = const ()"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="25:12-25:13: @16[5]: _17 = _5 -25:15-25:16: @16[7]: _18 = _6 -25:11-25:17: @16[8]: _16 = (move _17, move _18) -25:11-25:17: @16[11]: FakeRead(ForMatchedPlace, _16)"><span class="annotation">@16⦊</span>(a, b)<span class="annotation">⦉@16</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="26:27-26:29: @20[0]: _15 = const ()"><span class="annotation">@19,20⦊</span>{}<span class="annotation">⦉@19,20</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="27:14-27:16: @17[0]: _15 = const ()"><span class="annotation">@17⦊</span>{}<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="21:8-21:15: @11[4]: _14 = _1"><span class="annotation">@11⦊</span>is_true<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:9-22:14: @12[0]: _5 = const 0_u8 +23:9-23:14: @12[1]: _6 = const 0_u8 +21:16-24:6: @12[2]: _13 = const ()"><span class="annotation">@12⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @12[0]: _5 = const 0_u8 +23:9-23:14: @12[1]: _6 = const 0_u8 +21:16-24:6: @12[2]: _13 = const ()"> a = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @12[0]: _5 = const 0_u8 +23:9-23:14: @12[1]: _6 = const 0_u8 +21:16-24:6: @12[2]: _13 = const ()"> b = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:9-22:14: @12[0]: _5 = const 0_u8 +23:9-23:14: @12[1]: _6 = const 0_u8 +21:16-24:6: @12[2]: _13 = const ()"> }<span class="annotation">⦉@12</span></span></span><span><span class="code even" style="--layer: 1" title="24:6-24:6: @13[0]: _13 = const ()"><span class="annotation">@13⦊</span>‸<span class="annotation">⦉@13</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="25:12-25:13: @14[5]: _17 = _5 +25:15-25:16: @14[7]: _18 = _6 +25:11-25:17: @14[8]: _16 = (move _17, move _18) +25:11-25:17: @14[11]: FakeRead(ForMatchedPlace, _16)"><span class="annotation">@14⦊</span>(a, b)<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="26:27-26:29: @18[0]: _15 = const ()"><span class="annotation">@17,18⦊</span>{}<span class="annotation">⦉@17,18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="27:14-27:16: @15[0]: _15 = const ()"><span class="annotation">@15⦊</span>{}<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="29:8-29:15: @21[4]: _20 = _1 -29:8-29:15: @21[5]: FakeRead(ForMatchedPlace, _20)"><span class="annotation">@21⦊</span>is_true<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="30:9-30:14: @24[0]: _5 = const 2_u8 -31:9-31:14: @24[1]: _6 = const 2_u8 -29:16-32:6: @24[2]: _19 = const ()"><span class="annotation">@22,24⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @24[0]: _5 = const 2_u8 -31:9-31:14: @24[1]: _6 = const 2_u8 -29:16-32:6: @24[2]: _19 = const ()"> a = 2;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @24[0]: _5 = const 2_u8 -31:9-31:14: @24[1]: _6 = const 2_u8 -29:16-32:6: @24[2]: _19 = const ()"> b = 2;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @24[0]: _5 = const 2_u8 -31:9-31:14: @24[1]: _6 = const 2_u8 -29:16-32:6: @24[2]: _19 = const ()"> }<span class="annotation">⦉@22,24</span></span></span><span><span class="code even" style="--layer: 1" title="32:6-32:6: @23[0]: _19 = const ()"><span class="annotation">@23⦊</span>‸<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="33:12-33:13: @25[5]: _23 = _5 -33:15-33:16: @25[7]: _24 = _6 -33:11-33:17: @25[8]: _22 = (move _23, move _24) -33:11-33:17: @25[11]: FakeRead(ForMatchedPlace, _22)"><span class="annotation">@25⦊</span>(a, b)<span class="annotation">⦉@25</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="34:27-34:29: @29[0]: _21 = const ()"><span class="annotation">@28,29⦊</span>{}<span class="annotation">⦉@28,29</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="35:14-35:16: @26[0]: _21 = const ()"><span class="annotation">@26⦊</span>{}<span class="annotation">⦉@26</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="29:8-29:15: @19[4]: _20 = _1"><span class="annotation">@19⦊</span>is_true<span class="annotation">⦉@19</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="30:9-30:14: @20[0]: _5 = const 2_u8 +31:9-31:14: @20[1]: _6 = const 2_u8 +29:16-32:6: @20[2]: _19 = const ()"><span class="annotation">@20⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @20[0]: _5 = const 2_u8 +31:9-31:14: @20[1]: _6 = const 2_u8 +29:16-32:6: @20[2]: _19 = const ()"> a = 2;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @20[0]: _5 = const 2_u8 +31:9-31:14: @20[1]: _6 = const 2_u8 +29:16-32:6: @20[2]: _19 = const ()"> b = 2;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="30:9-30:14: @20[0]: _5 = const 2_u8 +31:9-31:14: @20[1]: _6 = const 2_u8 +29:16-32:6: @20[2]: _19 = const ()"> }<span class="annotation">⦉@20</span></span></span><span><span class="code even" style="--layer: 1" title="32:6-32:6: @21[0]: _19 = const ()"><span class="annotation">@21⦊</span>‸<span class="annotation">⦉@21</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="33:12-33:13: @22[5]: _23 = _5 +33:15-33:16: @22[7]: _24 = _6 +33:11-33:17: @22[8]: _22 = (move _23, move _24) +33:11-33:17: @22[11]: FakeRead(ForMatchedPlace, _22)"><span class="annotation">@22⦊</span>(a, b)<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="34:27-34:29: @26[0]: _21 = const ()"><span class="annotation">@25,26⦊</span>{}<span class="annotation">⦉@25,26</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="35:14-35:16: @23[0]: _21 = const ()"><span class="annotation">@23⦊</span>{}<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="37:8-37:15: @30[4]: _26 = _1 -37:8-37:15: @30[5]: FakeRead(ForMatchedPlace, _26)"><span class="annotation">@30⦊</span>is_true<span class="annotation">⦉@30</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="38:9-38:14: @33[0]: _5 = const 0_u8 -39:9-39:14: @33[1]: _6 = const 2_u8 -37:16-40:6: @33[2]: _25 = const ()"><span class="annotation">@31,33⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @33[0]: _5 = const 0_u8 -39:9-39:14: @33[1]: _6 = const 2_u8 -37:16-40:6: @33[2]: _25 = const ()"> a = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @33[0]: _5 = const 0_u8 -39:9-39:14: @33[1]: _6 = const 2_u8 -37:16-40:6: @33[2]: _25 = const ()"> b = 2;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @33[0]: _5 = const 0_u8 -39:9-39:14: @33[1]: _6 = const 2_u8 -37:16-40:6: @33[2]: _25 = const ()"> }<span class="annotation">⦉@31,33</span></span></span><span><span class="code even" style="--layer: 1" title="40:6-40:6: @32[0]: _25 = const ()"><span class="annotation">@32⦊</span>‸<span class="annotation">⦉@32</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="41:12-41:13: @34[4]: _28 = _5 -41:15-41:16: @34[6]: _29 = _6 -41:11-41:17: @34[7]: _27 = (move _28, move _29) -41:11-41:17: @34[10]: FakeRead(ForMatchedPlace, _27)"><span class="annotation">@34⦊</span>(a, b)<span class="annotation">⦉@34</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="42:27-42:29: @38[0]: _0 = const ()"><span class="annotation">@37,38⦊</span>{}<span class="annotation">⦉@37,38</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="43:14-43:16: @35[0]: _0 = const ()"><span class="annotation">@35⦊</span>{}<span class="annotation">⦉@35</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="37:8-37:15: @27[4]: _26 = _1"><span class="annotation">@27⦊</span>is_true<span class="annotation">⦉@27</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="38:9-38:14: @28[0]: _5 = const 0_u8 +39:9-39:14: @28[1]: _6 = const 2_u8 +37:16-40:6: @28[2]: _25 = const ()"><span class="annotation">@28⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @28[0]: _5 = const 0_u8 +39:9-39:14: @28[1]: _6 = const 2_u8 +37:16-40:6: @28[2]: _25 = const ()"> a = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @28[0]: _5 = const 0_u8 +39:9-39:14: @28[1]: _6 = const 2_u8 +37:16-40:6: @28[2]: _25 = const ()"> b = 2;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="38:9-38:14: @28[0]: _5 = const 0_u8 +39:9-39:14: @28[1]: _6 = const 2_u8 +37:16-40:6: @28[2]: _25 = const ()"> }<span class="annotation">⦉@28</span></span></span><span><span class="code even" style="--layer: 1" title="40:6-40:6: @29[0]: _25 = const ()"><span class="annotation">@29⦊</span>‸<span class="annotation">⦉@29</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> match </span><span><span class="code odd" style="--layer: 1" title="41:12-41:13: @30[4]: _28 = _5 +41:15-41:16: @30[6]: _29 = _6 +41:11-41:17: @30[7]: _27 = (move _28, move _29) +41:11-41:17: @30[10]: FakeRead(ForMatchedPlace, _27)"><span class="annotation">@30⦊</span>(a, b)<span class="annotation">⦉@30</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> (0 | 1, 2 | 3) => </span><span><span class="code even" style="--layer: 1" title="42:27-42:29: @34[0]: _0 = const ()"><span class="annotation">@33,34⦊</span>{}<span class="annotation">⦉@33,34</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> _ => </span><span><span class="code odd" style="--layer: 1" title="43:14-43:16: @31[0]: _0 = const ()"><span class="annotation">@31⦊</span>{}<span class="annotation">⦉@31</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="45:2-45:2: @39.Return: return"><span class="annotation">@39⦊</span>‸<span class="annotation">⦉@39</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="45:2-45:2: @35.Return: return"><span class="annotation">@35⦊</span>‸<span class="annotation">⦉@35</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.nested_loops/nested_loops.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.nested_loops/nested_loops.main.-------.InstrumentCoverage.0.html index cb60276aa1228..4dcf6c741dc73 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.nested_loops/nested_loops.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.nested_loops/nested_loops.main.-------.InstrumentCoverage.0.html @@ -69,23 +69,23 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 0"><span class="line"><span><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb35] +<div class="code" style="counter-reset: line 0"><span class="line"><span><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb32] 2:19-2:35: @1[0]: _3 = &_4 -2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb34] +2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb31] 2:19-2:46: @2[1]: _1 = Eq(move _2, const 1_usize) 2:9-2:16: @2[3]: FakeRead(ForLet, _1) 3:25-3:27: @3[2]: _5 = const 10_i32 3:9-3:22: @3[3]: FakeRead(ForLet, _5)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb35] +<span class="line"><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb32] 2:19-2:35: @1[0]: _3 = &_4 -2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb34] +2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb31] 2:19-2:46: @2[1]: _1 = Eq(move _2, const 1_usize) 2:9-2:16: @2[3]: FakeRead(ForLet, _1) 3:25-3:27: @3[2]: _5 = const 10_i32 3:9-3:22: @3[3]: FakeRead(ForLet, _5)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb35] +<span class="line"><span class="code even" style="--layer: 1" title="2:19-2:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb32] 2:19-2:35: @1[0]: _3 = &_4 -2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb34] +2:19-2:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb31] 2:19-2:46: @2[1]: _1 = Eq(move _2, const 1_usize) 2:9-2:16: @2[3]: FakeRead(ForLet, _1) 3:25-3:27: @3[2]: _5 = const 10_i32 @@ -107,67 +107,60 @@ 8:13-8:14: @16[4]: _15 = move _22 8:13-8:14: @16[5]: _16 = const ()"><span class="annotation">@14,16⦊</span>_<span class="annotation">⦉@14,16</span></span></span><span class="code" style="--layer: 0"> in </span><span><span class="code even" style="--layer: 1" title="8:18-8:23: @11[5]: _19 = &mut _14 8:18-8:23: @11[6]: _18 = &mut (*_19) -8:18-8:23: @11.Call: _17 = <std::ops::Range<i32> as Iterator>::next(move _18) -> [return: bb12, unwind: bb35] +8:18-8:23: @11.Call: _17 = <std::ops::Range<i32> as Iterator>::next(move _18) -> [return: bb12, unwind: bb32] 8:18-8:23: @12[1]: FakeRead(ForMatchedPlace, _17)"><span class="annotation">@10,11,12⦊</span>0..50<span class="annotation">⦉@10,11,12</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code odd" style="--layer: 1" title="9:16-9:17: @16[15]: _27 = _9 -9:16-9:22: @16[16]: _26 = Lt(move _27, const 30_i32) -9:16-9:22: @16[18]: FakeRead(ForMatchedPlace, _26)"><span class="annotation">@14,16⦊</span>a < 30<span class="annotation">⦉@14,16</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="10:17-10:22: @19[0]: _11 = const ()"><span class="annotation">@17,19⦊</span>break<span class="annotation">⦉@17,19</span></span></span><span class="code" style="--layer: 0">;</span></span> +9:16-9:22: @16[16]: _26 = Lt(move _27, const 30_i32)"><span class="annotation">@14,16⦊</span>a < 30<span class="annotation">⦉@14,16</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="10:17-10:22: @17[0]: _11 = const ()"><span class="annotation">@17⦊</span>break<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="11:14-11:14: @18[0]: _25 = const () 12:13-12:19: @18[3]: _29 = CheckedSub(_9, const 5_i32) -12:13-12:19: @20[0]: _9 = move (_29.0: i32) -13:13-13:19: @20[1]: _30 = CheckedSub(_10, const 5_i32) -13:13-13:19: @21[0]: _10 = move (_30.0: i32) -14:16-14:17: @21[3]: _32 = _10 -14:16-14:22: @21[4]: _31 = Lt(move _32, const 90_i32) -14:16-14:22: @21[6]: FakeRead(ForMatchedPlace, _31)"><span class="annotation">@18,20,21⦊</span></span></span> +12:13-12:19: @19[0]: _9 = move (_29.0: i32) +13:13-13:19: @19[1]: _30 = CheckedSub(_10, const 5_i32) +13:13-13:19: @20[0]: _10 = move (_30.0: i32) +14:16-14:17: @20[3]: _32 = _10 +14:16-14:22: @20[4]: _31 = Lt(move _32, const 90_i32)"><span class="annotation">@18,19,20⦊</span></span></span> <span class="line"><span class="code odd" style="--layer: 1" title="11:14-11:14: @18[0]: _25 = const () 12:13-12:19: @18[3]: _29 = CheckedSub(_9, const 5_i32) -12:13-12:19: @20[0]: _9 = move (_29.0: i32) -13:13-13:19: @20[1]: _30 = CheckedSub(_10, const 5_i32) -13:13-13:19: @21[0]: _10 = move (_30.0: i32) -14:16-14:17: @21[3]: _32 = _10 -14:16-14:22: @21[4]: _31 = Lt(move _32, const 90_i32) -14:16-14:22: @21[6]: FakeRead(ForMatchedPlace, _31)"> a -= 5;</span></span> +12:13-12:19: @19[0]: _9 = move (_29.0: i32) +13:13-13:19: @19[1]: _30 = CheckedSub(_10, const 5_i32) +13:13-13:19: @20[0]: _10 = move (_30.0: i32) +14:16-14:17: @20[3]: _32 = _10 +14:16-14:22: @20[4]: _31 = Lt(move _32, const 90_i32)"> a -= 5;</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="11:14-11:14: @18[0]: _25 = const () 12:13-12:19: @18[3]: _29 = CheckedSub(_9, const 5_i32) -12:13-12:19: @20[0]: _9 = move (_29.0: i32) -13:13-13:19: @20[1]: _30 = CheckedSub(_10, const 5_i32) -13:13-13:19: @21[0]: _10 = move (_30.0: i32) -14:16-14:17: @21[3]: _32 = _10 -14:16-14:22: @21[4]: _31 = Lt(move _32, const 90_i32) -14:16-14:22: @21[6]: FakeRead(ForMatchedPlace, _31)"> b -= 5;</span></span> +12:13-12:19: @19[0]: _9 = move (_29.0: i32) +13:13-13:19: @19[1]: _30 = CheckedSub(_10, const 5_i32) +13:13-13:19: @20[0]: _10 = move (_30.0: i32) +14:16-14:17: @20[3]: _32 = _10 +14:16-14:22: @20[4]: _31 = Lt(move _32, const 90_i32)"> b -= 5;</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="11:14-11:14: @18[0]: _25 = const () 12:13-12:19: @18[3]: _29 = CheckedSub(_9, const 5_i32) -12:13-12:19: @20[0]: _9 = move (_29.0: i32) -13:13-13:19: @20[1]: _30 = CheckedSub(_10, const 5_i32) -13:13-13:19: @21[0]: _10 = move (_30.0: i32) -14:16-14:17: @21[3]: _32 = _10 -14:16-14:22: @21[4]: _31 = Lt(move _32, const 90_i32) -14:16-14:22: @21[6]: FakeRead(ForMatchedPlace, _31)"> if b < 90<span class="annotation">⦉@18,20,21</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:17-15:24: @24[0]: _33 = CheckedSub(_9, const 10_i32) -15:17-15:24: @25[0]: _9 = move (_33.0: i32) -16:20-16:27: @25[2]: _34 = _1 -16:20-16:27: @25[3]: FakeRead(ForMatchedPlace, _34)"><span class="annotation">@22,24,25⦊</span>a -= 10;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="15:17-15:24: @24[0]: _33 = CheckedSub(_9, const 10_i32) -15:17-15:24: @25[0]: _9 = move (_33.0: i32) -16:20-16:27: @25[2]: _34 = _1 -16:20-16:27: @25[3]: FakeRead(ForMatchedPlace, _34)"> if is_true<span class="annotation">⦉@22,24,25</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:21-17:33: @28[0]: _0 = const ()"><span class="annotation">@26,28⦊</span>break 'outer<span class="annotation">⦉@26,28</span></span></span><span class="code" style="--layer: 0">;</span></span> -<span class="line"><span class="code" style="--layer: 0"> } else </span><span><span class="code even" style="--layer: 1" title="19:21-19:27: @27[0]: _36 = CheckedSub(_9, const 2_i32) -19:21-19:27: @29[0]: _9 = move (_36.0: i32) -18:24-20:18: @29[1]: _24 = const ()"><span class="annotation">@27,29⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:21-19:27: @27[0]: _36 = CheckedSub(_9, const 2_i32) -19:21-19:27: @29[0]: _9 = move (_36.0: i32) -18:24-20:18: @29[1]: _24 = const ()"> a -= 2;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="19:21-19:27: @27[0]: _36 = CheckedSub(_9, const 2_i32) -19:21-19:27: @29[0]: _9 = move (_36.0: i32) -18:24-20:18: @29[1]: _24 = const ()"> }<span class="annotation">⦉@27,29</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="21:14-21:14: @23[0]: _24 = const ()"><span class="annotation">@23⦊</span>‸<span class="annotation">⦉@23</span></span></span><span class="code" style="--layer: 0"></span></span> +12:13-12:19: @19[0]: _9 = move (_29.0: i32) +13:13-13:19: @19[1]: _30 = CheckedSub(_10, const 5_i32) +13:13-13:19: @20[0]: _10 = move (_30.0: i32) +14:16-14:17: @20[3]: _32 = _10 +14:16-14:22: @20[4]: _31 = Lt(move _32, const 90_i32)"> if b < 90<span class="annotation">⦉@18,19,20</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="15:17-15:24: @21[0]: _33 = CheckedSub(_9, const 10_i32) +15:17-15:24: @23[0]: _9 = move (_33.0: i32) +16:20-16:27: @23[2]: _34 = _1"><span class="annotation">@21,23⦊</span>a -= 10;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="15:17-15:24: @21[0]: _33 = CheckedSub(_9, const 10_i32) +15:17-15:24: @23[0]: _9 = move (_33.0: i32) +16:20-16:27: @23[2]: _34 = _1"> if is_true<span class="annotation">⦉@21,23</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:21-17:33: @24[0]: _0 = const ()"><span class="annotation">@24⦊</span>break 'outer<span class="annotation">⦉@24</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> } else </span><span><span class="code even" style="--layer: 1" title="19:21-19:27: @25[0]: _36 = CheckedSub(_9, const 2_i32) +19:21-19:27: @26[0]: _9 = move (_36.0: i32) +18:24-20:18: @26[1]: _24 = const ()"><span class="annotation">@25,26⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:21-19:27: @25[0]: _36 = CheckedSub(_9, const 2_i32) +19:21-19:27: @26[0]: _9 = move (_36.0: i32) +18:24-20:18: @26[1]: _24 = const ()"> a -= 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="19:21-19:27: @25[0]: _36 = CheckedSub(_9, const 2_i32) +19:21-19:27: @26[0]: _9 = move (_36.0: i32) +18:24-20:18: @26[1]: _24 = const ()"> }<span class="annotation">⦉@25,26</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="21:14-21:14: @22[0]: _24 = const ()"><span class="annotation">@22⦊</span>‸<span class="annotation">⦉@22</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:9-23:23: @31[4]: _37 = CheckedSub(_5, const 1_i32) -23:9-23:23: @32[0]: _5 = move (_37.0: i32)"><span class="annotation">@31,32⦊</span>countdown -= 1<span class="annotation">⦉@31,32</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:9-23:23: @28[4]: _37 = CheckedSub(_5, const 1_i32) +23:9-23:23: @29[0]: _5 = move (_37.0: i32)"><span class="annotation">@28,29⦊</span>countdown -= 1<span class="annotation">⦉@28,29</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="25:2-25:2: @33.Return: return"><span class="annotation">@33⦊</span>‸<span class="annotation">⦉@33</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="25:2-25:2: @30.Return: return"><span class="annotation">@30⦊</span>‸<span class="annotation">⦉@30</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.main.-------.InstrumentCoverage.0.html index 6739634f65b30..ca3515689d337 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.main.-------.InstrumentCoverage.0.html @@ -77,178 +77,176 @@ 17:11-17:24: @2[3]: _4 = Gt(move _5, const 0_i32) 17:11-17:24: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>countdown > 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="18:12-18:21: @5[3]: _8 = _1 -18:12-18:26: @5[4]: _7 = Eq(move _8, const 1_i32) -18:12-18:26: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="19:26-19:44: @8.Call: _9 = might_overflow(const 10_u32) -> [return: bb9, unwind: bb23] -19:17-19:23: @9[0]: FakeRead(ForLet, _9) -20:22-20:34: @9[7]: _51 = const main::promoted[1] -20:22-20:34: @9[8]: _15 = &(*_51) -20:22-20:34: @9[9]: _14 = &(*_15) -20:22-20:34: @9[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) -20:36-20:42: @9[18]: _22 = &_9 -20:13-20:44: @9[19]: _21 = (move _22,) -20:13-20:44: @9[21]: FakeRead(ForMatchedPlace, _21) -20:13-20:44: @9[23]: _23 = (_21.0: &u32) -20:13-20:44: @9[26]: _25 = &(*_23) -20:13-20:44: @9[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -20:13-20:44: @9.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb10, unwind: bb23] -20:13-20:44: @10[2]: _20 = [move _24] -20:13-20:44: @10[5]: _19 = &_20 -20:13-20:44: @10[6]: _18 = &(*_19) -20:13-20:44: @10[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:13-20:44: @10.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb11, unwind: bb23] -20:13-20:44: @11.Call: _11 = _print(move _12) -> [return: bb12, unwind: bb23] -20:13-20:44: @12[6]: _10 = const () -18:27-21:10: @12[8]: _6 = const ()"><span class="annotation">@6,8,9,10,11,12⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @8.Call: _9 = might_overflow(const 10_u32) -> [return: bb9, unwind: bb23] -19:17-19:23: @9[0]: FakeRead(ForLet, _9) -20:22-20:34: @9[7]: _51 = const main::promoted[1] -20:22-20:34: @9[8]: _15 = &(*_51) -20:22-20:34: @9[9]: _14 = &(*_15) -20:22-20:34: @9[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) -20:36-20:42: @9[18]: _22 = &_9 -20:13-20:44: @9[19]: _21 = (move _22,) -20:13-20:44: @9[21]: FakeRead(ForMatchedPlace, _21) -20:13-20:44: @9[23]: _23 = (_21.0: &u32) -20:13-20:44: @9[26]: _25 = &(*_23) -20:13-20:44: @9[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -20:13-20:44: @9.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb10, unwind: bb23] -20:13-20:44: @10[2]: _20 = [move _24] -20:13-20:44: @10[5]: _19 = &_20 -20:13-20:44: @10[6]: _18 = &(*_19) -20:13-20:44: @10[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:13-20:44: @10.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb11, unwind: bb23] -20:13-20:44: @11.Call: _11 = _print(move _12) -> [return: bb12, unwind: bb23] -20:13-20:44: @12[6]: _10 = const () -18:27-21:10: @12[8]: _6 = const ()"> let result = might_overflow(10);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @8.Call: _9 = might_overflow(const 10_u32) -> [return: bb9, unwind: bb23] -19:17-19:23: @9[0]: FakeRead(ForLet, _9) -20:22-20:34: @9[7]: _51 = const main::promoted[1] -20:22-20:34: @9[8]: _15 = &(*_51) -20:22-20:34: @9[9]: _14 = &(*_15) -20:22-20:34: @9[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) -20:36-20:42: @9[18]: _22 = &_9 -20:13-20:44: @9[19]: _21 = (move _22,) -20:13-20:44: @9[21]: FakeRead(ForMatchedPlace, _21) -20:13-20:44: @9[23]: _23 = (_21.0: &u32) -20:13-20:44: @9[26]: _25 = &(*_23) -20:13-20:44: @9[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -20:13-20:44: @9.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb10, unwind: bb23] -20:13-20:44: @10[2]: _20 = [move _24] -20:13-20:44: @10[5]: _19 = &_20 -20:13-20:44: @10[6]: _18 = &(*_19) -20:13-20:44: @10[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:13-20:44: @10.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb11, unwind: bb23] -20:13-20:44: @11.Call: _11 = _print(move _12) -> [return: bb12, unwind: bb23] -20:13-20:44: @12[6]: _10 = const () -18:27-21:10: @12[8]: _6 = const ()"> println!("Result: {}", result);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @8.Call: _9 = might_overflow(const 10_u32) -> [return: bb9, unwind: bb23] -19:17-19:23: @9[0]: FakeRead(ForLet, _9) -20:22-20:34: @9[7]: _51 = const main::promoted[1] -20:22-20:34: @9[8]: _15 = &(*_51) -20:22-20:34: @9[9]: _14 = &(*_15) -20:22-20:34: @9[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) -20:36-20:42: @9[18]: _22 = &_9 -20:13-20:44: @9[19]: _21 = (move _22,) -20:13-20:44: @9[21]: FakeRead(ForMatchedPlace, _21) -20:13-20:44: @9[23]: _23 = (_21.0: &u32) -20:13-20:44: @9[26]: _25 = &(*_23) -20:13-20:44: @9[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -20:13-20:44: @9.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb10, unwind: bb23] -20:13-20:44: @10[2]: _20 = [move _24] -20:13-20:44: @10[5]: _19 = &_20 -20:13-20:44: @10[6]: _18 = &(*_19) -20:13-20:44: @10[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -20:13-20:44: @10.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb11, unwind: bb23] -20:13-20:44: @11.Call: _11 = _print(move _12) -> [return: bb12, unwind: bb23] -20:13-20:44: @12[6]: _10 = const () -18:27-21:10: @12[8]: _6 = const ()"> }<span class="annotation">⦉@6,8,9,10,11,12</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="21:19-21:28: @7[2]: _28 = _1 -21:19-21:32: @7[3]: _27 = Lt(move _28, const 5_i32) -21:19-21:32: @7[5]: FakeRead(ForMatchedPlace, _27)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:26-22:43: @15.Call: _29 = might_overflow(const 1_u32) -> [return: bb16, unwind: bb23] -22:17-22:23: @16[0]: FakeRead(ForLet, _29) -23:22-23:34: @16[7]: _50 = const main::promoted[0] -23:22-23:34: @16[8]: _35 = &(*_50) -23:22-23:34: @16[9]: _34 = &(*_35) -23:22-23:34: @16[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) -23:36-23:42: @16[18]: _42 = &_29 -23:13-23:44: @16[19]: _41 = (move _42,) -23:13-23:44: @16[21]: FakeRead(ForMatchedPlace, _41) -23:13-23:44: @16[23]: _43 = (_41.0: &u32) -23:13-23:44: @16[26]: _45 = &(*_43) -23:13-23:44: @16[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -23:13-23:44: @16.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb17, unwind: bb23] -23:13-23:44: @17[2]: _40 = [move _44] -23:13-23:44: @17[5]: _39 = &_40 -23:13-23:44: @17[6]: _38 = &(*_39) -23:13-23:44: @17[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -23:13-23:44: @17.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb18, unwind: bb23] -23:13-23:44: @18.Call: _31 = _print(move _32) -> [return: bb19, unwind: bb23] -23:13-23:44: @19[6]: _30 = const () -21:33-24:10: @19[8]: _6 = const ()"><span class="annotation">@13,15,16,17,18,19⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @15.Call: _29 = might_overflow(const 1_u32) -> [return: bb16, unwind: bb23] -22:17-22:23: @16[0]: FakeRead(ForLet, _29) -23:22-23:34: @16[7]: _50 = const main::promoted[0] -23:22-23:34: @16[8]: _35 = &(*_50) -23:22-23:34: @16[9]: _34 = &(*_35) -23:22-23:34: @16[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) -23:36-23:42: @16[18]: _42 = &_29 -23:13-23:44: @16[19]: _41 = (move _42,) -23:13-23:44: @16[21]: FakeRead(ForMatchedPlace, _41) -23:13-23:44: @16[23]: _43 = (_41.0: &u32) -23:13-23:44: @16[26]: _45 = &(*_43) -23:13-23:44: @16[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -23:13-23:44: @16.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb17, unwind: bb23] -23:13-23:44: @17[2]: _40 = [move _44] -23:13-23:44: @17[5]: _39 = &_40 -23:13-23:44: @17[6]: _38 = &(*_39) -23:13-23:44: @17[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -23:13-23:44: @17.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb18, unwind: bb23] -23:13-23:44: @18.Call: _31 = _print(move _32) -> [return: bb19, unwind: bb23] -23:13-23:44: @19[6]: _30 = const () -21:33-24:10: @19[8]: _6 = const ()"> let result = might_overflow(1);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @15.Call: _29 = might_overflow(const 1_u32) -> [return: bb16, unwind: bb23] -22:17-22:23: @16[0]: FakeRead(ForLet, _29) -23:22-23:34: @16[7]: _50 = const main::promoted[0] -23:22-23:34: @16[8]: _35 = &(*_50) -23:22-23:34: @16[9]: _34 = &(*_35) -23:22-23:34: @16[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) -23:36-23:42: @16[18]: _42 = &_29 -23:13-23:44: @16[19]: _41 = (move _42,) -23:13-23:44: @16[21]: FakeRead(ForMatchedPlace, _41) -23:13-23:44: @16[23]: _43 = (_41.0: &u32) -23:13-23:44: @16[26]: _45 = &(*_43) -23:13-23:44: @16[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -23:13-23:44: @16.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb17, unwind: bb23] -23:13-23:44: @17[2]: _40 = [move _44] -23:13-23:44: @17[5]: _39 = &_40 -23:13-23:44: @17[6]: _38 = &(*_39) -23:13-23:44: @17[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -23:13-23:44: @17.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb18, unwind: bb23] -23:13-23:44: @18.Call: _31 = _print(move _32) -> [return: bb19, unwind: bb23] -23:13-23:44: @19[6]: _30 = const () -21:33-24:10: @19[8]: _6 = const ()"> println!("Result: {}", result);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @15.Call: _29 = might_overflow(const 1_u32) -> [return: bb16, unwind: bb23] -22:17-22:23: @16[0]: FakeRead(ForLet, _29) -23:22-23:34: @16[7]: _50 = const main::promoted[0] -23:22-23:34: @16[8]: _35 = &(*_50) -23:22-23:34: @16[9]: _34 = &(*_35) -23:22-23:34: @16[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) -23:36-23:42: @16[18]: _42 = &_29 -23:13-23:44: @16[19]: _41 = (move _42,) -23:13-23:44: @16[21]: FakeRead(ForMatchedPlace, _41) -23:13-23:44: @16[23]: _43 = (_41.0: &u32) -23:13-23:44: @16[26]: _45 = &(*_43) -23:13-23:44: @16[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -23:13-23:44: @16.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb17, unwind: bb23] -23:13-23:44: @17[2]: _40 = [move _44] -23:13-23:44: @17[5]: _39 = &_40 -23:13-23:44: @17[6]: _38 = &(*_39) -23:13-23:44: @17[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -23:13-23:44: @17.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb18, unwind: bb23] -23:13-23:44: @18.Call: _31 = _print(move _32) -> [return: bb19, unwind: bb23] -23:13-23:44: @19[6]: _30 = const () -21:33-24:10: @19[8]: _6 = const ()"> }<span class="annotation">⦉@13,15,16,17,18,19</span></span></span><span><span class="code even" style="--layer: 1" title="24:10-24:10: @14[0]: _6 = const ()"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @21[2]: _47 = CheckedSub(_1, const 1_i32) -25:9-25:23: @22[0]: _1 = move (_47.0: i32)"><span class="annotation">@21,22⦊</span>countdown -= 1<span class="annotation">⦉@21,22</span></span></span><span class="code" style="--layer: 0">;</span></span> +18:12-18:26: @5[4]: _7 = Eq(move _8, const 1_i32)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="19:26-19:44: @6.Call: _9 = might_overflow(const 10_u32) -> [return: bb8, unwind: bb21] +19:17-19:23: @8[0]: FakeRead(ForLet, _9) +20:22-20:34: @8[7]: _51 = const main::promoted[1] +20:22-20:34: @8[8]: _15 = &(*_51) +20:22-20:34: @8[9]: _14 = &(*_15) +20:22-20:34: @8[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) +20:36-20:42: @8[18]: _22 = &_9 +20:13-20:44: @8[19]: _21 = (move _22,) +20:13-20:44: @8[21]: FakeRead(ForMatchedPlace, _21) +20:13-20:44: @8[23]: _23 = (_21.0: &u32) +20:13-20:44: @8[26]: _25 = &(*_23) +20:13-20:44: @8[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +20:13-20:44: @8.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb9, unwind: bb21] +20:13-20:44: @9[2]: _20 = [move _24] +20:13-20:44: @9[5]: _19 = &_20 +20:13-20:44: @9[6]: _18 = &(*_19) +20:13-20:44: @9[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:13-20:44: @9.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb10, unwind: bb21] +20:13-20:44: @10.Call: _11 = _print(move _12) -> [return: bb11, unwind: bb21] +20:13-20:44: @11[6]: _10 = const () +18:27-21:10: @11[8]: _6 = const ()"><span class="annotation">@6,8,9,10,11⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @6.Call: _9 = might_overflow(const 10_u32) -> [return: bb8, unwind: bb21] +19:17-19:23: @8[0]: FakeRead(ForLet, _9) +20:22-20:34: @8[7]: _51 = const main::promoted[1] +20:22-20:34: @8[8]: _15 = &(*_51) +20:22-20:34: @8[9]: _14 = &(*_15) +20:22-20:34: @8[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) +20:36-20:42: @8[18]: _22 = &_9 +20:13-20:44: @8[19]: _21 = (move _22,) +20:13-20:44: @8[21]: FakeRead(ForMatchedPlace, _21) +20:13-20:44: @8[23]: _23 = (_21.0: &u32) +20:13-20:44: @8[26]: _25 = &(*_23) +20:13-20:44: @8[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +20:13-20:44: @8.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb9, unwind: bb21] +20:13-20:44: @9[2]: _20 = [move _24] +20:13-20:44: @9[5]: _19 = &_20 +20:13-20:44: @9[6]: _18 = &(*_19) +20:13-20:44: @9[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:13-20:44: @9.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb10, unwind: bb21] +20:13-20:44: @10.Call: _11 = _print(move _12) -> [return: bb11, unwind: bb21] +20:13-20:44: @11[6]: _10 = const () +18:27-21:10: @11[8]: _6 = const ()"> let result = might_overflow(10);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @6.Call: _9 = might_overflow(const 10_u32) -> [return: bb8, unwind: bb21] +19:17-19:23: @8[0]: FakeRead(ForLet, _9) +20:22-20:34: @8[7]: _51 = const main::promoted[1] +20:22-20:34: @8[8]: _15 = &(*_51) +20:22-20:34: @8[9]: _14 = &(*_15) +20:22-20:34: @8[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) +20:36-20:42: @8[18]: _22 = &_9 +20:13-20:44: @8[19]: _21 = (move _22,) +20:13-20:44: @8[21]: FakeRead(ForMatchedPlace, _21) +20:13-20:44: @8[23]: _23 = (_21.0: &u32) +20:13-20:44: @8[26]: _25 = &(*_23) +20:13-20:44: @8[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +20:13-20:44: @8.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb9, unwind: bb21] +20:13-20:44: @9[2]: _20 = [move _24] +20:13-20:44: @9[5]: _19 = &_20 +20:13-20:44: @9[6]: _18 = &(*_19) +20:13-20:44: @9[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:13-20:44: @9.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb10, unwind: bb21] +20:13-20:44: @10.Call: _11 = _print(move _12) -> [return: bb11, unwind: bb21] +20:13-20:44: @11[6]: _10 = const () +18:27-21:10: @11[8]: _6 = const ()"> println!("Result: {}", result);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:26-19:44: @6.Call: _9 = might_overflow(const 10_u32) -> [return: bb8, unwind: bb21] +19:17-19:23: @8[0]: FakeRead(ForLet, _9) +20:22-20:34: @8[7]: _51 = const main::promoted[1] +20:22-20:34: @8[8]: _15 = &(*_51) +20:22-20:34: @8[9]: _14 = &(*_15) +20:22-20:34: @8[10]: _13 = move _14 as &[&str] (Pointer(Unsize)) +20:36-20:42: @8[18]: _22 = &_9 +20:13-20:44: @8[19]: _21 = (move _22,) +20:13-20:44: @8[21]: FakeRead(ForMatchedPlace, _21) +20:13-20:44: @8[23]: _23 = (_21.0: &u32) +20:13-20:44: @8[26]: _25 = &(*_23) +20:13-20:44: @8[28]: _26 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +20:13-20:44: @8.Call: _24 = ArgumentV1::new::<u32>(move _25, move _26) -> [return: bb9, unwind: bb21] +20:13-20:44: @9[2]: _20 = [move _24] +20:13-20:44: @9[5]: _19 = &_20 +20:13-20:44: @9[6]: _18 = &(*_19) +20:13-20:44: @9[7]: _17 = move _18 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +20:13-20:44: @9.Call: _12 = Arguments::new_v1(move _13, move _17) -> [return: bb10, unwind: bb21] +20:13-20:44: @10.Call: _11 = _print(move _12) -> [return: bb11, unwind: bb21] +20:13-20:44: @11[6]: _10 = const () +18:27-21:10: @11[8]: _6 = const ()"> }<span class="annotation">⦉@6,8,9,10,11</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="21:19-21:28: @7[2]: _28 = _1 +21:19-21:32: @7[3]: _27 = Lt(move _28, const 5_i32)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:26-22:43: @12.Call: _29 = might_overflow(const 1_u32) -> [return: bb14, unwind: bb21] +22:17-22:23: @14[0]: FakeRead(ForLet, _29) +23:22-23:34: @14[7]: _50 = const main::promoted[0] +23:22-23:34: @14[8]: _35 = &(*_50) +23:22-23:34: @14[9]: _34 = &(*_35) +23:22-23:34: @14[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) +23:36-23:42: @14[18]: _42 = &_29 +23:13-23:44: @14[19]: _41 = (move _42,) +23:13-23:44: @14[21]: FakeRead(ForMatchedPlace, _41) +23:13-23:44: @14[23]: _43 = (_41.0: &u32) +23:13-23:44: @14[26]: _45 = &(*_43) +23:13-23:44: @14[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +23:13-23:44: @14.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb15, unwind: bb21] +23:13-23:44: @15[2]: _40 = [move _44] +23:13-23:44: @15[5]: _39 = &_40 +23:13-23:44: @15[6]: _38 = &(*_39) +23:13-23:44: @15[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +23:13-23:44: @15.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb16, unwind: bb21] +23:13-23:44: @16.Call: _31 = _print(move _32) -> [return: bb17, unwind: bb21] +23:13-23:44: @17[6]: _30 = const () +21:33-24:10: @17[8]: _6 = const ()"><span class="annotation">@12,14,15,16,17⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @12.Call: _29 = might_overflow(const 1_u32) -> [return: bb14, unwind: bb21] +22:17-22:23: @14[0]: FakeRead(ForLet, _29) +23:22-23:34: @14[7]: _50 = const main::promoted[0] +23:22-23:34: @14[8]: _35 = &(*_50) +23:22-23:34: @14[9]: _34 = &(*_35) +23:22-23:34: @14[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) +23:36-23:42: @14[18]: _42 = &_29 +23:13-23:44: @14[19]: _41 = (move _42,) +23:13-23:44: @14[21]: FakeRead(ForMatchedPlace, _41) +23:13-23:44: @14[23]: _43 = (_41.0: &u32) +23:13-23:44: @14[26]: _45 = &(*_43) +23:13-23:44: @14[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +23:13-23:44: @14.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb15, unwind: bb21] +23:13-23:44: @15[2]: _40 = [move _44] +23:13-23:44: @15[5]: _39 = &_40 +23:13-23:44: @15[6]: _38 = &(*_39) +23:13-23:44: @15[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +23:13-23:44: @15.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb16, unwind: bb21] +23:13-23:44: @16.Call: _31 = _print(move _32) -> [return: bb17, unwind: bb21] +23:13-23:44: @17[6]: _30 = const () +21:33-24:10: @17[8]: _6 = const ()"> let result = might_overflow(1);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @12.Call: _29 = might_overflow(const 1_u32) -> [return: bb14, unwind: bb21] +22:17-22:23: @14[0]: FakeRead(ForLet, _29) +23:22-23:34: @14[7]: _50 = const main::promoted[0] +23:22-23:34: @14[8]: _35 = &(*_50) +23:22-23:34: @14[9]: _34 = &(*_35) +23:22-23:34: @14[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) +23:36-23:42: @14[18]: _42 = &_29 +23:13-23:44: @14[19]: _41 = (move _42,) +23:13-23:44: @14[21]: FakeRead(ForMatchedPlace, _41) +23:13-23:44: @14[23]: _43 = (_41.0: &u32) +23:13-23:44: @14[26]: _45 = &(*_43) +23:13-23:44: @14[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +23:13-23:44: @14.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb15, unwind: bb21] +23:13-23:44: @15[2]: _40 = [move _44] +23:13-23:44: @15[5]: _39 = &_40 +23:13-23:44: @15[6]: _38 = &(*_39) +23:13-23:44: @15[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +23:13-23:44: @15.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb16, unwind: bb21] +23:13-23:44: @16.Call: _31 = _print(move _32) -> [return: bb17, unwind: bb21] +23:13-23:44: @17[6]: _30 = const () +21:33-24:10: @17[8]: _6 = const ()"> println!("Result: {}", result);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="22:26-22:43: @12.Call: _29 = might_overflow(const 1_u32) -> [return: bb14, unwind: bb21] +22:17-22:23: @14[0]: FakeRead(ForLet, _29) +23:22-23:34: @14[7]: _50 = const main::promoted[0] +23:22-23:34: @14[8]: _35 = &(*_50) +23:22-23:34: @14[9]: _34 = &(*_35) +23:22-23:34: @14[10]: _33 = move _34 as &[&str] (Pointer(Unsize)) +23:36-23:42: @14[18]: _42 = &_29 +23:13-23:44: @14[19]: _41 = (move _42,) +23:13-23:44: @14[21]: FakeRead(ForMatchedPlace, _41) +23:13-23:44: @14[23]: _43 = (_41.0: &u32) +23:13-23:44: @14[26]: _45 = &(*_43) +23:13-23:44: @14[28]: _46 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +23:13-23:44: @14.Call: _44 = ArgumentV1::new::<u32>(move _45, move _46) -> [return: bb15, unwind: bb21] +23:13-23:44: @15[2]: _40 = [move _44] +23:13-23:44: @15[5]: _39 = &_40 +23:13-23:44: @15[6]: _38 = &(*_39) +23:13-23:44: @15[7]: _37 = move _38 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +23:13-23:44: @15.Call: _32 = Arguments::new_v1(move _33, move _37) -> [return: bb16, unwind: bb21] +23:13-23:44: @16.Call: _31 = _print(move _32) -> [return: bb17, unwind: bb21] +23:13-23:44: @17[6]: _30 = const () +21:33-24:10: @17[8]: _6 = const ()"> }<span class="annotation">⦉@12,14,15,16,17</span></span></span><span><span class="code even" style="--layer: 1" title="24:10-24:10: @13[0]: _6 = const ()"><span class="annotation">@13⦊</span>‸<span class="annotation">⦉@13</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="25:9-25:23: @19[2]: _47 = CheckedSub(_1, const 1_i32) +25:9-25:23: @20[0]: _1 = move (_47.0: i32)"><span class="annotation">@19,20⦊</span>countdown -= 1<span class="annotation">⦉@19,20</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:8-27:10: @4[4]: _49 = () 27:5-27:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _49) diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.might_overflow.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.might_overflow.-------.InstrumentCoverage.0.html index c72ad42635620..f86cc4b2d2a06 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.might_overflow.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.overflow/overflow.might_overflow.-------.InstrumentCoverage.0.html @@ -70,327 +70,325 @@ </head> <body> <div class="code" style="counter-reset: line 3"><span class="line"><span><span class="code even" style="--layer: 1" title="5:8-5:14: @0[3]: _4 = _1 -5:8-5:18: @0[4]: _3 = Gt(move _4, const 5_u32) -5:8-5:18: @0[6]: FakeRead(ForMatchedPlace, _3)"><span class="annotation">@0⦊</span>fn might_overflow(to_add: u32) -> u32 {</span></span> +5:8-5:18: @0[4]: _3 = Gt(move _4, const 5_u32)"><span class="annotation">@0⦊</span>fn might_overflow(to_add: u32) -> u32 {</span></span> <span class="line"><span class="code even" style="--layer: 1" title="5:8-5:14: @0[3]: _4 = _1 -5:8-5:18: @0[4]: _3 = Gt(move _4, const 5_u32) -5:8-5:18: @0[6]: FakeRead(ForMatchedPlace, _3)"> if to_add > 5<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:18-6:47: @3[6]: _61 = const might_overflow::promoted[4] -6:18-6:47: @3[7]: _10 = &(*_61) -6:18-6:47: @3[8]: _9 = &(*_10) -6:18-6:47: @3[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) -6:9-6:49: @3[15]: _16 = () -6:9-6:49: @3[16]: FakeRead(ForMatchedPlace, _16) -6:9-6:49: @3[17]: _60 = const might_overflow::promoted[3] -6:9-6:49: @3[18]: _14 = &(*_60) -6:9-6:49: @3[19]: _13 = &(*_14) -6:9-6:49: @3[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:9-6:49: @3.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb4, unwind: bb15] -6:9-6:49: @4.Call: _6 = _print(move _7) -> [return: bb5, unwind: bb15] -6:9-6:49: @5[5]: _5 = const () -5:19-7:6: @5[7]: _2 = const ()"><span class="annotation">@1,3,4,5⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:47: @3[6]: _61 = const might_overflow::promoted[4] -6:18-6:47: @3[7]: _10 = &(*_61) -6:18-6:47: @3[8]: _9 = &(*_10) -6:18-6:47: @3[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) -6:9-6:49: @3[15]: _16 = () -6:9-6:49: @3[16]: FakeRead(ForMatchedPlace, _16) -6:9-6:49: @3[17]: _60 = const might_overflow::promoted[3] -6:9-6:49: @3[18]: _14 = &(*_60) -6:9-6:49: @3[19]: _13 = &(*_14) -6:9-6:49: @3[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:9-6:49: @3.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb4, unwind: bb15] -6:9-6:49: @4.Call: _6 = _print(move _7) -> [return: bb5, unwind: bb15] -6:9-6:49: @5[5]: _5 = const () -5:19-7:6: @5[7]: _2 = const ()"> println!("this will probably overflow");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:47: @3[6]: _61 = const might_overflow::promoted[4] -6:18-6:47: @3[7]: _10 = &(*_61) -6:18-6:47: @3[8]: _9 = &(*_10) -6:18-6:47: @3[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) -6:9-6:49: @3[15]: _16 = () -6:9-6:49: @3[16]: FakeRead(ForMatchedPlace, _16) -6:9-6:49: @3[17]: _60 = const might_overflow::promoted[3] -6:9-6:49: @3[18]: _14 = &(*_60) -6:9-6:49: @3[19]: _13 = &(*_14) -6:9-6:49: @3[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:9-6:49: @3.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb4, unwind: bb15] -6:9-6:49: @4.Call: _6 = _print(move _7) -> [return: bb5, unwind: bb15] -6:9-6:49: @5[5]: _5 = const () -5:19-7:6: @5[7]: _2 = const ()"> }<span class="annotation">⦉@1,3,4,5</span></span></span><span><span class="code even" style="--layer: 1" title="7:6-7:6: @2[0]: _2 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return"><span class="annotation">@6,7,8,9,10,11,12,13,14⦊</span>add_to = u32::MAX - 5;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return"> println!("does {} + {} overflow?", add_to, to_add);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return"> let result = to_add + add_to;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return"> println!("continuing after overflow check");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return"> result</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @6[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) -8:18-8:30: @7[0]: _17 = move (_18.0: u32) -8:9-8:15: @7[1]: FakeRead(ForLet, _17) -9:14-9:38: @7[8]: _59 = const might_overflow::promoted[2] -9:14-9:38: @7[9]: _24 = &(*_59) -9:14-9:38: @7[10]: _23 = &(*_24) -9:14-9:38: @7[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) -9:40-9:46: @7[19]: _31 = &_17 -9:48-9:54: @7[21]: _32 = &_1 -9:5-9:56: @7[22]: _30 = (move _31, move _32) -9:5-9:56: @7[25]: FakeRead(ForMatchedPlace, _30) -9:5-9:56: @7[27]: _33 = (_30.0: &u32) -9:5-9:56: @7[29]: _34 = (_30.1: &u32) -9:5-9:56: @7[32]: _36 = &(*_33) -9:5-9:56: @7[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @7.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb8, unwind: bb15] -9:5-9:56: @8[4]: _39 = &(*_34) -9:5-9:56: @8[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) -9:5-9:56: @8.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb9, unwind: bb15] -9:5-9:56: @9[2]: _29 = [move _35, move _38] -9:5-9:56: @9[7]: _28 = &_29 -9:5-9:56: @9[8]: _27 = &(*_28) -9:5-9:56: @9[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:5-9:56: @9.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb10, unwind: bb15] -9:5-9:56: @10.Call: _20 = _print(move _21) -> [return: bb11, unwind: bb15] -9:5-9:56: @11[6]: _19 = const () -10:18-10:24: @11[10]: _42 = _1 -10:27-10:33: @11[12]: _43 = _17 -10:18-10:33: @11[13]: _44 = CheckedAdd(_42, _43) -10:18-10:33: @12[0]: _41 = move (_44.0: u32) -10:9-10:15: @12[3]: FakeRead(ForLet, _41) -11:14-11:47: @12[10]: _58 = const might_overflow::promoted[1] -11:14-11:47: @12[11]: _50 = &(*_58) -11:14-11:47: @12[12]: _49 = &(*_50) -11:14-11:47: @12[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) -11:5-11:49: @12[19]: _56 = () -11:5-11:49: @12[20]: FakeRead(ForMatchedPlace, _56) -11:5-11:49: @12[21]: _57 = const might_overflow::promoted[0] -11:5-11:49: @12[22]: _54 = &(*_57) -11:5-11:49: @12[23]: _53 = &(*_54) -11:5-11:49: @12[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -11:5-11:49: @12.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb13, unwind: bb15] -11:5-11:49: @13.Call: _46 = _print(move _47) -> [return: bb14, unwind: bb15] -11:5-11:49: @14[5]: _45 = const () -12:5-12:11: @14[7]: _0 = _41 -13:2-13:2: @14.Return: return">}<span class="annotation">⦉@6,7,8,9,10,11,12,13,14</span></span></span></span></div> +5:8-5:18: @0[4]: _3 = Gt(move _4, const 5_u32)"> if to_add > 5<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:18-6:47: @1[6]: _61 = const might_overflow::promoted[4] +6:18-6:47: @1[7]: _10 = &(*_61) +6:18-6:47: @1[8]: _9 = &(*_10) +6:18-6:47: @1[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) +6:9-6:49: @1[15]: _16 = () +6:9-6:49: @1[16]: FakeRead(ForMatchedPlace, _16) +6:9-6:49: @1[17]: _60 = const might_overflow::promoted[3] +6:9-6:49: @1[18]: _14 = &(*_60) +6:9-6:49: @1[19]: _13 = &(*_14) +6:9-6:49: @1[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:9-6:49: @1.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb3, unwind: bb14] +6:9-6:49: @3.Call: _6 = _print(move _7) -> [return: bb4, unwind: bb14] +6:9-6:49: @4[5]: _5 = const () +5:19-7:6: @4[7]: _2 = const ()"><span class="annotation">@1,3,4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:47: @1[6]: _61 = const might_overflow::promoted[4] +6:18-6:47: @1[7]: _10 = &(*_61) +6:18-6:47: @1[8]: _9 = &(*_10) +6:18-6:47: @1[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) +6:9-6:49: @1[15]: _16 = () +6:9-6:49: @1[16]: FakeRead(ForMatchedPlace, _16) +6:9-6:49: @1[17]: _60 = const might_overflow::promoted[3] +6:9-6:49: @1[18]: _14 = &(*_60) +6:9-6:49: @1[19]: _13 = &(*_14) +6:9-6:49: @1[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:9-6:49: @1.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb3, unwind: bb14] +6:9-6:49: @3.Call: _6 = _print(move _7) -> [return: bb4, unwind: bb14] +6:9-6:49: @4[5]: _5 = const () +5:19-7:6: @4[7]: _2 = const ()"> println!("this will probably overflow");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:47: @1[6]: _61 = const might_overflow::promoted[4] +6:18-6:47: @1[7]: _10 = &(*_61) +6:18-6:47: @1[8]: _9 = &(*_10) +6:18-6:47: @1[9]: _8 = move _9 as &[&str] (Pointer(Unsize)) +6:9-6:49: @1[15]: _16 = () +6:9-6:49: @1[16]: FakeRead(ForMatchedPlace, _16) +6:9-6:49: @1[17]: _60 = const might_overflow::promoted[3] +6:9-6:49: @1[18]: _14 = &(*_60) +6:9-6:49: @1[19]: _13 = &(*_14) +6:9-6:49: @1[20]: _12 = move _13 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:9-6:49: @1.Call: _7 = Arguments::new_v1(move _8, move _12) -> [return: bb3, unwind: bb14] +6:9-6:49: @3.Call: _6 = _print(move _7) -> [return: bb4, unwind: bb14] +6:9-6:49: @4[5]: _5 = const () +5:19-7:6: @4[7]: _2 = const ()"> }<span class="annotation">⦉@1,3,4</span></span></span><span><span class="code even" style="--layer: 1" title="7:6-7:6: @2[0]: _2 = const ()"><span class="annotation">@2⦊</span>‸<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return"><span class="annotation">@5,6,7,8,9,10,11,12,13⦊</span>add_to = u32::MAX - 5;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return"> println!("does {} + {} overflow?", add_to, to_add);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return"> let result = to_add + add_to;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return"> println!("continuing after overflow check");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return"> result</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="8:18-8:30: @5[3]: _18 = CheckedSub(const core::num::<impl u32>::MAX, const 5_u32) +8:18-8:30: @6[0]: _17 = move (_18.0: u32) +8:9-8:15: @6[1]: FakeRead(ForLet, _17) +9:14-9:38: @6[8]: _59 = const might_overflow::promoted[2] +9:14-9:38: @6[9]: _24 = &(*_59) +9:14-9:38: @6[10]: _23 = &(*_24) +9:14-9:38: @6[11]: _22 = move _23 as &[&str] (Pointer(Unsize)) +9:40-9:46: @6[19]: _31 = &_17 +9:48-9:54: @6[21]: _32 = &_1 +9:5-9:56: @6[22]: _30 = (move _31, move _32) +9:5-9:56: @6[25]: FakeRead(ForMatchedPlace, _30) +9:5-9:56: @6[27]: _33 = (_30.0: &u32) +9:5-9:56: @6[29]: _34 = (_30.1: &u32) +9:5-9:56: @6[32]: _36 = &(*_33) +9:5-9:56: @6[34]: _37 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @6.Call: _35 = ArgumentV1::new::<u32>(move _36, move _37) -> [return: bb7, unwind: bb14] +9:5-9:56: @7[4]: _39 = &(*_34) +9:5-9:56: @7[6]: _40 = <u32 as std::fmt::Display>::fmt as for<'r, 's, 't0> fn(&'r u32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)) +9:5-9:56: @7.Call: _38 = ArgumentV1::new::<u32>(move _39, move _40) -> [return: bb8, unwind: bb14] +9:5-9:56: @8[2]: _29 = [move _35, move _38] +9:5-9:56: @8[7]: _28 = &_29 +9:5-9:56: @8[8]: _27 = &(*_28) +9:5-9:56: @8[9]: _26 = move _27 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +9:5-9:56: @8.Call: _21 = Arguments::new_v1(move _22, move _26) -> [return: bb9, unwind: bb14] +9:5-9:56: @9.Call: _20 = _print(move _21) -> [return: bb10, unwind: bb14] +9:5-9:56: @10[6]: _19 = const () +10:18-10:24: @10[10]: _42 = _1 +10:27-10:33: @10[12]: _43 = _17 +10:18-10:33: @10[13]: _44 = CheckedAdd(_42, _43) +10:18-10:33: @11[0]: _41 = move (_44.0: u32) +10:9-10:15: @11[3]: FakeRead(ForLet, _41) +11:14-11:47: @11[10]: _58 = const might_overflow::promoted[1] +11:14-11:47: @11[11]: _50 = &(*_58) +11:14-11:47: @11[12]: _49 = &(*_50) +11:14-11:47: @11[13]: _48 = move _49 as &[&str] (Pointer(Unsize)) +11:5-11:49: @11[19]: _56 = () +11:5-11:49: @11[20]: FakeRead(ForMatchedPlace, _56) +11:5-11:49: @11[21]: _57 = const might_overflow::promoted[0] +11:5-11:49: @11[22]: _54 = &(*_57) +11:5-11:49: @11[23]: _53 = &(*_54) +11:5-11:49: @11[24]: _52 = move _53 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +11:5-11:49: @11.Call: _47 = Arguments::new_v1(move _48, move _52) -> [return: bb12, unwind: bb14] +11:5-11:49: @12.Call: _46 = _print(move _47) -> [return: bb13, unwind: bb14] +11:5-11:49: @13[5]: _45 = const () +12:5-12:11: @13[7]: _0 = _41 +13:2-13:2: @13.Return: return">}<span class="annotation">⦉@5,6,7,8,9,10,11,12,13</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.main.-------.InstrumentCoverage.0.html index bd6aac4103eb6..5b097f118e3a8 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.main.-------.InstrumentCoverage.0.html @@ -77,22 +77,20 @@ 15:11-15:24: @2[3]: _4 = Gt(move _5, const 0_i32) 15:11-15:24: @2[5]: FakeRead(ForMatchedPlace, _4)"><span class="annotation">@1,2⦊</span>countdown > 0<span class="annotation">⦉@1,2</span></span></span><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="16:12-16:21: @5[3]: _8 = _1 -16:12-16:26: @5[4]: _7 = Eq(move _8, const 1_i32) -16:12-16:26: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:13-17:30: @8.Call: _9 = might_panic(const true) -> [return: bb9, unwind: bb17] -16:27-18:10: @9[1]: _6 = const ()"><span class="annotation">@6,8,9⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="17:13-17:30: @8.Call: _9 = might_panic(const true) -> [return: bb9, unwind: bb17] -16:27-18:10: @9[1]: _6 = const ()"> might_panic(true);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="17:13-17:30: @8.Call: _9 = might_panic(const true) -> [return: bb9, unwind: bb17] -16:27-18:10: @9[1]: _6 = const ()"> }<span class="annotation">⦉@6,8,9</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="18:19-18:28: @7[2]: _11 = _1 -18:19-18:32: @7[3]: _10 = Lt(move _11, const 5_i32) -18:19-18:32: @7[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="19:13-19:31: @12.Call: _12 = might_panic(const false) -> [return: bb13, unwind: bb17] -18:33-20:10: @13[1]: _6 = const ()"><span class="annotation">@10,12,13⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="19:13-19:31: @12.Call: _12 = might_panic(const false) -> [return: bb13, unwind: bb17] -18:33-20:10: @13[1]: _6 = const ()"> might_panic(false);</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="19:13-19:31: @12.Call: _12 = might_panic(const false) -> [return: bb13, unwind: bb17] -18:33-20:10: @13[1]: _6 = const ()"> }<span class="annotation">⦉@10,12,13</span></span></span><span><span class="code even" style="--layer: 1" title="20:10-20:10: @11[0]: _6 = const ()"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:9-21:23: @15[2]: _13 = CheckedSub(_1, const 1_i32) -21:9-21:23: @16[0]: _1 = move (_13.0: i32)"><span class="annotation">@15,16⦊</span>countdown -= 1<span class="annotation">⦉@15,16</span></span></span><span class="code" style="--layer: 0">;</span></span> +16:12-16:26: @5[4]: _7 = Eq(move _8, const 1_i32)"><span class="annotation">@3,5⦊</span>countdown == 1<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="17:13-17:30: @6.Call: _9 = might_panic(const true) -> [return: bb8, unwind: bb15] +16:27-18:10: @8[1]: _6 = const ()"><span class="annotation">@6,8⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="17:13-17:30: @6.Call: _9 = might_panic(const true) -> [return: bb8, unwind: bb15] +16:27-18:10: @8[1]: _6 = const ()"> might_panic(true);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="17:13-17:30: @6.Call: _9 = might_panic(const true) -> [return: bb8, unwind: bb15] +16:27-18:10: @8[1]: _6 = const ()"> }<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"> else if </span><span><span class="code even" style="--layer: 1" title="18:19-18:28: @7[2]: _11 = _1 +18:19-18:32: @7[3]: _10 = Lt(move _11, const 5_i32)"><span class="annotation">@7⦊</span>countdown < 5<span class="annotation">⦉@7</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="19:13-19:31: @9.Call: _12 = might_panic(const false) -> [return: bb11, unwind: bb15] +18:33-20:10: @11[1]: _6 = const ()"><span class="annotation">@9,11⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:13-19:31: @9.Call: _12 = might_panic(const false) -> [return: bb11, unwind: bb15] +18:33-20:10: @11[1]: _6 = const ()"> might_panic(false);</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="19:13-19:31: @9.Call: _12 = might_panic(const false) -> [return: bb11, unwind: bb15] +18:33-20:10: @11[1]: _6 = const ()"> }<span class="annotation">⦉@9,11</span></span></span><span><span class="code even" style="--layer: 1" title="20:10-20:10: @10[0]: _6 = const ()"><span class="annotation">@10⦊</span>‸<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:9-21:23: @13[2]: _13 = CheckedSub(_1, const 1_i32) +21:9-21:23: @14[0]: _1 = move (_13.0: i32)"><span class="annotation">@13,14⦊</span>countdown -= 1<span class="annotation">⦉@13,14</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="23:8-23:10: @4[4]: _15 = () 23:5-23:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15) diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.might_panic.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.might_panic.-------.InstrumentCoverage.0.html index 290b7b8509908..86d9875b47cb5 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.might_panic.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.panic_unwind/panic_unwind.might_panic.-------.InstrumentCoverage.0.html @@ -70,36 +70,35 @@ </head> <body> <div class="code" style="counter-reset: line 3"><span class="line"><span><span class="code even" style="--layer: 1"><span class="annotation">@0⦊</span>fn might_panic(should_panic: bool) <span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0">{</span></span> -<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1 -5:8-5:20: @0[2]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>should_panic<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:18-6:32: @3[6]: _33 = const might_panic::promoted[3] -6:18-6:32: @3[7]: _9 = &(*_33) -6:18-6:32: @3[8]: _8 = &(*_9) -6:18-6:32: @3[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) -6:9-6:34: @3[15]: _15 = () -6:9-6:34: @3[16]: FakeRead(ForMatchedPlace, _15) -6:9-6:34: @3[17]: _32 = const might_panic::promoted[2] -6:9-6:34: @3[18]: _13 = &(*_32) -6:9-6:34: @3[19]: _12 = &(*_13) -6:9-6:34: @3[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:9-6:34: @3.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb4, unwind: bb8] -6:9-6:34: @4.Call: _5 = _print(move _6) -> [return: bb5, unwind: bb8] -6:9-6:34: @5[5]: _4 = const () -7:9-7:26: @5.Call: begin_panic::<&str>(const "panics") -> bb8"><span class="annotation">@1,3,4,5⦊</span>println!("panicking...");</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:32: @3[6]: _33 = const might_panic::promoted[3] -6:18-6:32: @3[7]: _9 = &(*_33) -6:18-6:32: @3[8]: _8 = &(*_9) -6:18-6:32: @3[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) -6:9-6:34: @3[15]: _15 = () -6:9-6:34: @3[16]: FakeRead(ForMatchedPlace, _15) -6:9-6:34: @3[17]: _32 = const might_panic::promoted[2] -6:9-6:34: @3[18]: _13 = &(*_32) -6:9-6:34: @3[19]: _12 = &(*_13) -6:9-6:34: @3[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -6:9-6:34: @3.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb4, unwind: bb8] -6:9-6:34: @4.Call: _5 = _print(move _6) -> [return: bb5, unwind: bb8] -6:9-6:34: @5[5]: _4 = const () -7:9-7:26: @5.Call: begin_panic::<&str>(const "panics") -> bb8"> panic!("panics");<span class="annotation">⦉@1,3,4,5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> if </span><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1"><span class="annotation">@0⦊</span>should_panic<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:18-6:32: @1[6]: _33 = const might_panic::promoted[3] +6:18-6:32: @1[7]: _9 = &(*_33) +6:18-6:32: @1[8]: _8 = &(*_9) +6:18-6:32: @1[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) +6:9-6:34: @1[15]: _15 = () +6:9-6:34: @1[16]: FakeRead(ForMatchedPlace, _15) +6:9-6:34: @1[17]: _32 = const might_panic::promoted[2] +6:9-6:34: @1[18]: _13 = &(*_32) +6:9-6:34: @1[19]: _12 = &(*_13) +6:9-6:34: @1[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:9-6:34: @1.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb3, unwind: bb7] +6:9-6:34: @3.Call: _5 = _print(move _6) -> [return: bb4, unwind: bb7] +6:9-6:34: @4[5]: _4 = const () +7:9-7:26: @4.Call: begin_panic::<&str>(const "panics") -> bb7"><span class="annotation">@1,3,4⦊</span>println!("panicking...");</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="6:18-6:32: @1[6]: _33 = const might_panic::promoted[3] +6:18-6:32: @1[7]: _9 = &(*_33) +6:18-6:32: @1[8]: _8 = &(*_9) +6:18-6:32: @1[9]: _7 = move _8 as &[&str] (Pointer(Unsize)) +6:9-6:34: @1[15]: _15 = () +6:9-6:34: @1[16]: FakeRead(ForMatchedPlace, _15) +6:9-6:34: @1[17]: _32 = const might_panic::promoted[2] +6:9-6:34: @1[18]: _13 = &(*_32) +6:9-6:34: @1[19]: _12 = &(*_13) +6:9-6:34: @1[20]: _11 = move _12 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) +6:9-6:34: @1.Call: _6 = Arguments::new_v1(move _7, move _11) -> [return: bb3, unwind: bb7] +6:9-6:34: @3.Call: _5 = _print(move _6) -> [return: bb4, unwind: bb7] +6:9-6:34: @4[5]: _4 = const () +7:9-7:26: @4.Call: begin_panic::<&str>(const "panics") -> bb7"> panic!("panics");<span class="annotation">⦉@1,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else </span><span><span class="code even" style="--layer: 1" title="9:18-9:31: @2[6]: _31 = const might_panic::promoted[1] 9:18-9:31: @2[7]: _23 = &(*_31) 9:18-9:31: @2[8]: _22 = &(*_23) @@ -110,11 +109,11 @@ 9:9-9:33: @2[18]: _27 = &(*_30) 9:9-9:33: @2[19]: _26 = &(*_27) 9:9-9:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -9:9-9:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -9:9-9:33: @7[5]: _18 = const () -8:12-10:6: @7[7]: _0 = const () -11:2-11:2: @7.Return: return"><span class="annotation">@2,6,7⦊</span>{</span></span> +9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +9:9-9:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +9:9-9:33: @6[5]: _18 = const () +8:12-10:6: @6[7]: _0 = const () +11:2-11:2: @6.Return: return"><span class="annotation">@2,5,6⦊</span>{</span></span> <span class="line"><span class="code even" style="--layer: 1" title="9:18-9:31: @2[6]: _31 = const might_panic::promoted[1] 9:18-9:31: @2[7]: _23 = &(*_31) 9:18-9:31: @2[8]: _22 = &(*_23) @@ -125,11 +124,11 @@ 9:9-9:33: @2[18]: _27 = &(*_30) 9:9-9:33: @2[19]: _26 = &(*_27) 9:9-9:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -9:9-9:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -9:9-9:33: @7[5]: _18 = const () -8:12-10:6: @7[7]: _0 = const () -11:2-11:2: @7.Return: return"> println!("Don't Panic");</span></span> +9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +9:9-9:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +9:9-9:33: @6[5]: _18 = const () +8:12-10:6: @6[7]: _0 = const () +11:2-11:2: @6.Return: return"> println!("Don't Panic");</span></span> <span class="line"><span class="code even" style="--layer: 1" title="9:18-9:31: @2[6]: _31 = const might_panic::promoted[1] 9:18-9:31: @2[7]: _23 = &(*_31) 9:18-9:31: @2[8]: _22 = &(*_23) @@ -140,11 +139,11 @@ 9:9-9:33: @2[18]: _27 = &(*_30) 9:9-9:33: @2[19]: _26 = &(*_27) 9:9-9:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -9:9-9:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -9:9-9:33: @7[5]: _18 = const () -8:12-10:6: @7[7]: _0 = const () -11:2-11:2: @7.Return: return"> }</span></span> +9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +9:9-9:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +9:9-9:33: @6[5]: _18 = const () +8:12-10:6: @6[7]: _0 = const () +11:2-11:2: @6.Return: return"> }</span></span> <span class="line"><span class="code even" style="--layer: 1" title="9:18-9:31: @2[6]: _31 = const might_panic::promoted[1] 9:18-9:31: @2[7]: _23 = &(*_31) 9:18-9:31: @2[8]: _22 = &(*_23) @@ -155,10 +154,10 @@ 9:9-9:33: @2[18]: _27 = &(*_30) 9:9-9:33: @2[19]: _26 = &(*_27) 9:9-9:33: @2[20]: _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)) -9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb6, unwind: bb8] -9:9-9:33: @6.Call: _19 = _print(move _20) -> [return: bb7, unwind: bb8] -9:9-9:33: @7[5]: _18 = const () -8:12-10:6: @7[7]: _0 = const () -11:2-11:2: @7.Return: return">}<span class="annotation">⦉@2,6,7</span></span></span></span></div> +9:9-9:33: @2.Call: _20 = Arguments::new_v1(move _21, move _25) -> [return: bb5, unwind: bb7] +9:9-9:33: @5.Call: _19 = _print(move _20) -> [return: bb6, unwind: bb7] +9:9-9:33: @6[5]: _18 = const () +8:12-10:6: @6[7]: _0 = const () +11:2-11:2: @6.Return: return">}<span class="annotation">⦉@2,5,6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html index 1233dfb5bab1f..f528b698d440f 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_loop/simple_loop.main.-------.InstrumentCoverage.0.html @@ -69,138 +69,125 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> if</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb15] +12:9-12:16: @3[6]: _7 = _1"> if</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb13] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb14] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb12] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 0_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -12:9-12:16: @3[6]: _7 = _1 -12:9-12:16: @3[7]: FakeRead(ForMatchedPlace, _7)"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"> countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"> =</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"> 10</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"> ;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @6[0]: _5 = const 10_i32 -13:5-18:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="18:6-18:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +12:9-12:16: @3[6]: _7 = _1"> is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"> =</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"> 10</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"> ;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:9-16:15: @4[0]: _5 = const 10_i32 +13:5-18:6: @4[1]: _6 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="18:6-18:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> loop</span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 -23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) -23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@8,9⦊</span>countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 -23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) -23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> ==</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="23:13-23:22: @9[3]: _11 = _5 -23:13-25:14: @9[4]: _10 = Eq(move _11, const 0_i32) -23:13-25:14: @9[6]: FakeRead(ForMatchedPlace, _10)"> 0<span class="annotation">⦉@8,9</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="23:13-23:22: @8[3]: _11 = _5 +23:13-25:14: @8[4]: _10 = Eq(move _11, const 0_i32)"><span class="annotation">@7,8⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:13-23:22: @8[3]: _11 = _5 +23:13-25:14: @8[4]: _10 = Eq(move _11, const 0_i32)"> ==</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="23:13-23:22: @8[3]: _11 = _5 +23:13-25:14: @8[4]: _10 = Eq(move _11, const 0_i32)"> 0<span class="annotation">⦉@7,8</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:18: @12[0]: _0 = const ()"><span class="annotation">@10,12⦊</span>break<span class="annotation">⦉@10,12</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:18: @9[0]: _0 = const ()"><span class="annotation">@9⦊</span>break<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> -<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="29:10-29:10: @11[0]: _9 = const () -30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32) -30:9-32:10: @13[0]: _5 = move (_13.0: i32)"><span class="annotation">@11,13⦊</span></span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @11[0]: _9 = const () -30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32) -30:9-32:10: @13[0]: _5 = move (_13.0: i32)"> countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @11[0]: _9 = const () -30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32) -30:9-32:10: @13[0]: _5 = move (_13.0: i32)"> -=</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @11[0]: _9 = const () -30:9-32:10: @11[3]: _13 = CheckedSub(_5, const 1_i32) -30:9-32:10: @13[0]: _5 = move (_13.0: i32)"> 1<span class="annotation">⦉@11,13</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code odd" style="--layer: 1" title="29:10-29:10: @10[0]: _9 = const () +30:9-32:10: @10[3]: _13 = CheckedSub(_5, const 1_i32) +30:9-32:10: @11[0]: _5 = move (_13.0: i32)"><span class="annotation">@10,11⦊</span></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @10[0]: _9 = const () +30:9-32:10: @10[3]: _13 = CheckedSub(_5, const 1_i32) +30:9-32:10: @11[0]: _5 = move (_13.0: i32)"> countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @10[0]: _9 = const () +30:9-32:10: @10[3]: _13 = CheckedSub(_5, const 1_i32) +30:9-32:10: @11[0]: _5 = move (_13.0: i32)"> -=</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="29:10-29:10: @10[0]: _9 = const () +30:9-32:10: @10[3]: _13 = CheckedSub(_5, const 1_i32) +30:9-32:10: @11[0]: _5 = move (_13.0: i32)"> 1<span class="annotation">⦉@10,11</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="35:2-35:2: @12.Return: return"><span class="annotation">@10,12⦊</span>‸<span class="annotation">⦉@10,12</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="35:2-35:2: @9.Return: return"><span class="annotation">@9⦊</span>‸<span class="annotation">⦉@9</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html index a8bae32490b0b..8e49e45b86e11 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.simple_match/simple_match.main.-------.InstrumentCoverage.0.html @@ -69,162 +69,154 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +<div class="code" style="counter-reset: line 2"><span class="line"><span><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"><span class="annotation">@0,1,2,3⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> // dependent conditions.</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"> // dependent conditions.</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"></span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"></span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb22] +10:8-10:15: @3[6]: _7 = _1"> let mut countdown = 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="7:19-7:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb21] 7:19-7:35: @1[0]: _3 = &_4 -7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb21] +7:19-7:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb20] 7:19-7:46: @2[1]: _1 = Eq(move _2, const 1_usize) 7:9-7:16: @2[3]: FakeRead(ForLet, _1) 9:25-9:26: @3[2]: _5 = const 1_i32 9:9-9:22: @3[3]: FakeRead(ForLet, _5) -10:8-10:15: @3[6]: _7 = _1 -10:8-10:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 -10:16-12:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 -10:16-12:6: @6[1]: _6 = const ()"> countdown = 0;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @6[0]: _5 = const 0_i32 -10:16-12:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +10:8-10:15: @3[6]: _7 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="11:9-11:22: @4[0]: _5 = const 0_i32 +10:16-12:6: @4[1]: _6 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @4[0]: _5 = const 0_i32 +10:16-12:6: @4[1]: _6 = const ()"> countdown = 0;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="11:9-11:22: @4[0]: _5 = const 0_i32 +10:16-12:6: @4[1]: _6 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="12:6-12:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> for</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:9-15:10: @15[1]: _18 = ((_14 as Some).0: i32) -15:9-15:10: @15[3]: _19 = _18 -15:9-15:10: @15[4]: _12 = move _19 -15:9-15:10: @15[5]: _13 = const ()"><span class="annotation">@13,15,17⦊</span>_<span class="annotation">⦉@13,15,17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="15:9-15:10: @14[1]: _18 = ((_14 as Some).0: i32) +15:9-15:10: @14[3]: _19 = _18 +15:9-15:10: @14[4]: _12 = move _19 +15:9-15:10: @14[5]: _13 = const ()"><span class="annotation">@12,14,16⦊</span>_<span class="annotation">⦉@12,14,16</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> in</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="17:9-17:13: @10[5]: _16 = &mut _10 -17:9-17:13: @10[6]: _15 = &mut (*_16) -17:9-17:13: @10.Call: _14 = <std::ops::Range<i32> as Iterator>::next(move _15) -> [return: bb11, unwind: bb22] -17:9-17:13: @11[1]: FakeRead(ForMatchedPlace, _14)"><span class="annotation">@9,10,11⦊</span>0..2<span class="annotation">⦉@9,10,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="17:9-17:13: @9[5]: _16 = &mut _10 +17:9-17:13: @9[6]: _15 = &mut (*_16) +17:9-17:13: @9.Call: _14 = <std::ops::Range<i32> as Iterator>::next(move _15) -> [return: bb10, unwind: bb21] +17:9-17:13: @10[1]: FakeRead(ForMatchedPlace, _14)"><span class="annotation">@8,9,10⦊</span>0..2<span class="annotation">⦉@8,9,10</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> let z</span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> <span class="line"><span class="code" style="--layer: 0"> match</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:13-22:22: @15[13]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@13,15,17⦊</span>countdown<span class="annotation">⦉@13,15,17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="22:13-22:22: @14[13]: FakeRead(ForMatchedPlace, _5)"><span class="annotation">@12,14,16⦊</span>countdown<span class="annotation">⦉@12,14,16</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="24:13-24:14: @18[3]: _23 = _5"><span class="annotation">@18⦊</span>x<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="24:13-24:14: @17[3]: _23 = _5"><span class="annotation">@17⦊</span>x<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:17-26:18: @17[4]: _26 = (*_24) -26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"><span class="annotation">@13,15,17⦊</span>x</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="26:17-26:18: @17[4]: _26 = (*_24) -26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> <</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="26:17-26:18: @17[4]: _26 = (*_24) -26:17-28:18: @17[5]: _25 = Lt(move _26, const 1_i32)"> 1<span class="annotation">⦉@13,15,17</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:17-26:18: @16[4]: _26 = (*_24) +26:17-28:18: @16[5]: _25 = Lt(move _26, const 1_i32)"><span class="annotation">@12,14,16⦊</span>x</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="26:17-26:18: @16[4]: _26 = (*_24) +26:17-28:18: @16[5]: _25 = Lt(move _26, const 1_i32)"> <</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="26:17-26:18: @16[4]: _26 = (*_24) +26:17-28:18: @16[5]: _25 = Lt(move _26, const 1_i32)"> 1<span class="annotation">⦉@12,14,16</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> =></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"><span class="annotation">@18⦊</span>{</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> z = countdown</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> let y = countdown</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> countdown = 10</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> ;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @18[5]: _27 = _5 -31:17-31:30: @18[6]: _22 = move _27 -33:25-33:34: @18[9]: _28 = _5 -33:21-33:22: @18[10]: FakeRead(ForLet, _28) -35:17-35:31: @18[11]: _5 = const 10_i32 -30:13-37:14: @18[12]: _21 = const ()"> }<span class="annotation">⦉@18</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"><span class="annotation">@17⦊</span>{</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> z = countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> let y = countdown</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> countdown = 10</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> ;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="31:21-31:30: @17[5]: _27 = _5 +31:17-31:30: @17[6]: _22 = move _27 +33:25-33:34: @17[9]: _28 = _5 +33:21-33:22: @17[10]: FakeRead(ForLet, _28) +35:17-35:31: @17[11]: _5 = const 10_i32 +30:13-37:14: @17[12]: _21 = const ()"> }<span class="annotation">⦉@17</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> _</span></span> <span class="line"><span class="code" style="--layer: 0"> =></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="40:13-40:15: @16[0]: _21 = const ()"><span class="annotation">@16⦊</span>{}<span class="annotation">⦉@16</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="40:13-40:15: @15[0]: _21 = const ()"><span class="annotation">@15⦊</span>{}<span class="annotation">⦉@15</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="43:2-43:2: @12.Return: return"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="43:2-43:2: @11.Return: return"><span class="annotation">@11⦊</span>‸<span class="annotation">⦉@11</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.tight_inf_loop/tight_inf_loop.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.tight_inf_loop/tight_inf_loop.main.-------.InstrumentCoverage.0.html index d0ee798ca1978..8cbd265c6a01c 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.tight_inf_loop/tight_inf_loop.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.tight_inf_loop/tight_inf_loop.main.-------.InstrumentCoverage.0.html @@ -69,12 +69,10 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 0"><span class="line"><span><span class="code even" style="--layer: 1" title="2:8-2:13: @0[1]: _1 = const false -2:8-2:13: @0[2]: FakeRead(ForMatchedPlace, _1)"><span class="annotation">@0⦊</span>fn main() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="2:8-2:13: @0[1]: _1 = const false -2:8-2:13: @0[2]: FakeRead(ForMatchedPlace, _1)"> if false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="3:9-3:16: @4.FalseUnwind: falseUnwind -> [real: bb5, cleanup: bb6] -3:14-3:16: @5[0]: _3 = const ()"><span class="annotation">@4,5⦊</span>loop {}<span class="annotation">⦉@4,5</span></span></span><span class="code" style="--layer: 0"></span></span> +<div class="code" style="counter-reset: line 0"><span class="line"><span><span class="code even" style="--layer: 1" title="2:8-2:13: @0[1]: _1 = const false"><span class="annotation">@0⦊</span>fn main() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="2:8-2:13: @0[1]: _1 = const false"> if false<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="3:9-3:16: @3.FalseUnwind: falseUnwind -> [real: bb4, cleanup: bb5] +3:14-3:16: @4[0]: _3 = const ()"><span class="annotation">@3,4⦊</span>loop {}<span class="annotation">⦉@3,4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="4:6-4:6: @2[0]: _0 = const () 5:2-5:2: @2.Return: return"><span class="annotation">@2⦊</span></span></span> <span class="line"><span class="code even" style="--layer: 1" title="4:6-4:6: @2[0]: _0 = const () diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html index 804d2f4388679..a8a3139334c96 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.call.-------.InstrumentCoverage.0.html @@ -69,16 +69,14 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 3"><span class="line"><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1 -5:8-5:20: @0[2]: FakeRead(ForMatchedPlace, _2)"><span class="annotation">@0⦊</span>fn call(return_error: bool) -> Result<(),()> {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1 -5:8-5:20: @0[2]: FakeRead(ForMatchedPlace, _2)"> if return_error<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:13-6:15: @3[1]: _3 = () -6:9-6:16: @3[2]: _0 = std::result::Result::<(), ()>::Err(move _3)"><span class="annotation">@1,3⦊</span>Err(())<span class="annotation">⦉@1,3</span></span></span><span class="code" style="--layer: 0"></span></span> +<div class="code" style="counter-reset: line 3"><span class="line"><span><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1"><span class="annotation">@0⦊</span>fn call(return_error: bool) -> Result<(),()> {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="5:8-5:20: @0[1]: _2 = _1"> if return_error<span class="annotation">⦉@0</span></span></span><span class="code" style="--layer: 0"> {</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="6:13-6:15: @1[1]: _3 = () +6:9-6:16: @1[2]: _0 = std::result::Result::<(), ()>::Err(move _3)"><span class="annotation">@1⦊</span>Err(())<span class="annotation">⦉@1</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> } else {</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="8:12-8:14: @2[1]: _4 = () 8:9-8:15: @2[2]: _0 = std::result::Result::<(), ()>::Ok(move _4)"><span class="annotation">@2⦊</span>Ok(())<span class="annotation">⦉@2</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="10:2-10:2: @4.Return: return"><span class="annotation">@4⦊</span>‸<span class="annotation">⦉@4</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="10:2-10:2: @3.Return: return"><span class="annotation">@3⦊</span>‸<span class="annotation">⦉@3</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html index 3091eab3e7149..41404759c3da7 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.try_error_result/try_error_result.main.-------.InstrumentCoverage.0.html @@ -84,51 +84,46 @@ <span class="line"><span class="code" style="--layer: 0"> in</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="19:9-19:14: @3[5]: _11 = &mut _5 19:9-19:14: @3[6]: _10 = &mut (*_11) -19:9-19:14: @3.Call: _9 = <std::ops::Range<i32> as Iterator>::next(move _10) -> [return: bb4, unwind: bb40] +19:9-19:14: @3.Call: _9 = <std::ops::Range<i32> as Iterator>::next(move _10) -> [return: bb4, unwind: bb39] 19:9-19:14: @4[1]: FakeRead(ForMatchedPlace, _9)"><span class="annotation">@2,3,4⦊</span>0..10<span class="annotation">⦉@2,3,4</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32) 21:9-22:17: @9[0]: _1 = move (_17.0: i32) 25:13-25:22: @9[3]: _19 = _1 -25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) -25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"><span class="annotation">@6,8,9⦊</span>countdown</span></span> +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32)"><span class="annotation">@6,8,9⦊</span>countdown</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32) 21:9-22:17: @9[0]: _1 = move (_17.0: i32) 25:13-25:22: @9[3]: _19 = _1 -25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) -25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"> -= 1</span></span> +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32)"> -= 1</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32) 21:9-22:17: @9[0]: _1 = move (_17.0: i32) 25:13-25:22: @9[3]: _19 = _1 -25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) -25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"> ;</span></span> +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32)"> ;</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32) 21:9-22:17: @9[0]: _1 = move (_17.0: i32) 25:13-25:22: @9[3]: _19 = _1 -25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) -25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"> if</span></span> +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32)"> if</span></span> <span class="line"><span class="code odd" style="--layer: 1" title="21:9-22:17: @8[12]: _17 = CheckedSub(_1, const 1_i32) 21:9-22:17: @9[0]: _1 = move (_17.0: i32) 25:13-25:22: @9[3]: _19 = _1 -25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32) -25:13-25:26: @9[6]: FakeRead(ForMatchedPlace, _18)"> countdown < 5<span class="annotation">⦉@6,8,9</span></span></span><span class="code" style="--layer: 0"></span></span> +25:13-25:26: @9[4]: _18 = Lt(move _19, const 5_i32)"> countdown < 5<span class="annotation">⦉@6,8,9</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:41: @12.Call: _22 = call(const true) -> [return: bb13, unwind: bb40]"><span class="annotation">@10,12,13,14⦊</span>call(/*return_error=*/ true)<span class="annotation">⦉@10,12,13,14</span></span></span><span><span class="code odd" style="--layer: 1" title="27:41-27:42: @18[1]: _24 = ((_21 as Err).0: ()) -27:41-27:42: @18[4]: _27 = _24 -27:41-27:42: @18.Call: _26 = <() as From<()>>::from(move _27) -> [return: bb19, unwind: bb40]"><span class="annotation">@16,18,19,20⦊</span>?<span class="annotation">⦉@16,18,19,20</span></span></span><span class="code" style="--layer: 0">;</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:13-28:42: @15.Call: _31 = call(const false) -> [return: bb21, unwind: bb40]"><span class="annotation">@15,21,22⦊</span>call(/*return_error=*/ false)<span class="annotation">⦉@15,21,22</span></span></span><span><span class="code odd" style="--layer: 1" title="28:42-28:43: @26[1]: _33 = ((_30 as Err).0: ()) -28:42-28:43: @26[4]: _36 = _33 -28:42-28:43: @26.Call: _35 = <() as From<()>>::from(move _36) -> [return: bb27, unwind: bb40]"><span class="annotation">@24,26,27,28⦊</span>?<span class="annotation">⦉@24,26,27,28</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="27:13-27:41: @10.Call: _22 = call(const true) -> [return: bb12, unwind: bb39]"><span class="annotation">@10,12,13⦊</span>call(/*return_error=*/ true)<span class="annotation">⦉@10,12,13</span></span></span><span><span class="code odd" style="--layer: 1" title="27:41-27:42: @17[1]: _24 = ((_21 as Err).0: ()) +27:41-27:42: @17[4]: _27 = _24 +27:41-27:42: @17.Call: _26 = <() as From<()>>::from(move _27) -> [return: bb18, unwind: bb39]"><span class="annotation">@15,17,18,19⦊</span>?<span class="annotation">⦉@15,17,18,19</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="28:13-28:42: @14.Call: _31 = call(const false) -> [return: bb20, unwind: bb39]"><span class="annotation">@14,20,21⦊</span>call(/*return_error=*/ false)<span class="annotation">⦉@14,20,21</span></span></span><span><span class="code odd" style="--layer: 1" title="28:42-28:43: @25[1]: _33 = ((_30 as Err).0: ()) +28:42-28:43: @25[4]: _36 = _33 +28:42-28:43: @25.Call: _35 = <() as From<()>>::from(move _36) -> [return: bb26, unwind: bb39]"><span class="annotation">@23,25,26,27⦊</span>?<span class="annotation">⦉@23,25,26,27</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> else</span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="32:13-32:42: @11.Call: _40 = call(const false) -> [return: bb29, unwind: bb40]"><span class="annotation">@11,29,30⦊</span>call(/*return_error=*/ false)<span class="annotation">⦉@11,29,30</span></span></span><span><span class="code odd" style="--layer: 1" title="32:42-32:43: @34[1]: _42 = ((_39 as Err).0: ()) -32:42-32:43: @34[4]: _45 = _42 -32:42-32:43: @34.Call: _44 = <() as From<()>>::from(move _45) -> [return: bb35, unwind: bb40]"><span class="annotation">@32,34,35,36⦊</span>?<span class="annotation">⦉@32,34,35,36</span></span></span><span class="code" style="--layer: 0">;</span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="32:13-32:42: @11.Call: _40 = call(const false) -> [return: bb28, unwind: bb39]"><span class="annotation">@11,28,29⦊</span>call(/*return_error=*/ false)<span class="annotation">⦉@11,28,29</span></span></span><span><span class="code odd" style="--layer: 1" title="32:42-32:43: @33[1]: _42 = ((_39 as Err).0: ()) +32:42-32:43: @33[4]: _45 = _42 +32:42-32:43: @33.Call: _44 = <() as From<()>>::from(move _45) -> [return: bb34, unwind: bb39]"><span class="annotation">@31,33,34,35⦊</span>?<span class="annotation">⦉@31,33,34,35</span></span></span><span class="code" style="--layer: 0">;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="35:8-35:10: @5[9]: _47 = () 35:5-35:11: @5[10]: _0 = std::result::Result::<(), ()>::Ok(move _47)"><span class="annotation">@5⦊</span>Ok(())<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="36:2-36:2: @39.Return: return"><span class="annotation">@39⦊</span>‸<span class="annotation">⦉@39</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="36:2-36:2: @38.Return: return"><span class="annotation">@38⦊</span>‸<span class="annotation">⦉@38</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_function.-------.InstrumentCoverage.0.html index 47fe96eebd19f..4af7b17986622 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_function.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_function.-------.InstrumentCoverage.0.html @@ -69,51 +69,47 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 36"><span class="line"><span><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 36"><span class="line"><span><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 38:19-38:35: @1[0]: _3 = &_4 -38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) 38:9-38:16: @2[3]: FakeRead(ForLet, _1) 39:25-39:26: @3[2]: _5 = const 2_i32 39:9-39:22: @3[3]: FakeRead(ForLet, _5) 40:9-40:16: @3[6]: _7 = _1 -40:8-40:16: @3[7]: _6 = Not(move _7) -40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>pub fn unused_function() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +40:8-40:16: @3[7]: _6 = Not(move _7)"><span class="annotation">@0,1,2,3⦊</span>pub fn unused_function() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 38:19-38:35: @1[0]: _3 = &_4 -38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) 38:9-38:16: @2[3]: FakeRead(ForLet, _1) 39:25-39:26: @3[2]: _5 = const 2_i32 39:9-39:22: @3[3]: FakeRead(ForLet, _5) 40:9-40:16: @3[6]: _7 = _1 -40:8-40:16: @3[7]: _6 = Not(move _7) -40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +40:8-40:16: @3[7]: _6 = Not(move _7)"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 38:19-38:35: @1[0]: _3 = &_4 -38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) 38:9-38:16: @2[3]: FakeRead(ForLet, _1) 39:25-39:26: @3[2]: _5 = const 2_i32 39:9-39:22: @3[3]: FakeRead(ForLet, _5) 40:9-40:16: @3[6]: _7 = _1 -40:8-40:16: @3[7]: _6 = Not(move _7) -40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 2;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +40:8-40:16: @3[7]: _6 = Not(move _7)"> let mut countdown = 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="38:19-38:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 38:19-38:35: @1[0]: _3 = &_4 -38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +38:19-38:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 38:19-38:46: @2[1]: _1 = Eq(move _2, const 1_usize) 38:9-38:16: @2[3]: FakeRead(ForLet, _1) 39:25-39:26: @3[2]: _5 = const 2_i32 39:9-39:22: @3[3]: FakeRead(ForLet, _5) 40:9-40:16: @3[6]: _7 = _1 -40:8-40:16: @3[7]: _6 = Not(move _7) -40:8-40:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 -40:17-42:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 -40:17-42:6: @6[1]: _0 = const ()"> countdown = 20;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @6[0]: _5 = const 20_i32 -40:17-42:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="42:6-42:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="43:2-43:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +40:8-40:16: @3[7]: _6 = Not(move _7)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="41:9-41:23: @4[0]: _5 = const 20_i32 +40:17-42:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @4[0]: _5 = const 20_i32 +40:17-42:6: @4[1]: _0 = const ()"> countdown = 20;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="41:9-41:23: @4[0]: _5 = const 20_i32 +40:17-42:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="42:6-42:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="43:2-43:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_private_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_private_function.-------.InstrumentCoverage.0.html index 361c57930229a..6424e03fc7113 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_private_function.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.unused_private_function.-------.InstrumentCoverage.0.html @@ -69,51 +69,47 @@ </style> </head> <body> -<div class="code" style="counter-reset: line 44"><span class="line"><span><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +<div class="code" style="counter-reset: line 44"><span class="line"><span><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 46:19-46:35: @1[0]: _3 = &_4 -46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 46:19-46:46: @2[1]: _1 = Eq(move _2, const 1_usize) 46:9-46:16: @2[3]: FakeRead(ForLet, _1) 47:25-47:26: @3[2]: _5 = const 2_i32 47:9-47:22: @3[3]: FakeRead(ForLet, _5) 48:9-48:16: @3[6]: _7 = _1 -48:8-48:16: @3[7]: _6 = Not(move _7) -48:8-48:16: @3[9]: FakeRead(ForMatchedPlace, _6)"><span class="annotation">@0,1,2,3⦊</span>fn unused_private_function() {</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +48:8-48:16: @3[7]: _6 = Not(move _7)"><span class="annotation">@0,1,2,3⦊</span>fn unused_private_function() {</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 46:19-46:35: @1[0]: _3 = &_4 -46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 46:19-46:46: @2[1]: _1 = Eq(move _2, const 1_usize) 46:9-46:16: @2[3]: FakeRead(ForLet, _1) 47:25-47:26: @3[2]: _5 = const 2_i32 47:9-47:22: @3[3]: FakeRead(ForLet, _5) 48:9-48:16: @3[6]: _7 = _1 -48:8-48:16: @3[7]: _6 = Not(move _7) -48:8-48:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +48:8-48:16: @3[7]: _6 = Not(move _7)"> let is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 46:19-46:35: @1[0]: _3 = &_4 -46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 46:19-46:46: @2[1]: _1 = Eq(move _2, const 1_usize) 46:9-46:16: @2[3]: FakeRead(ForLet, _1) 47:25-47:26: @3[2]: _5 = const 2_i32 47:9-47:22: @3[3]: FakeRead(ForLet, _5) 48:9-48:16: @3[6]: _7 = _1 -48:8-48:16: @3[7]: _6 = Not(move _7) -48:8-48:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> let mut countdown = 2;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] +48:8-48:16: @3[7]: _6 = Not(move _7)"> let mut countdown = 2;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="46:19-46:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb8] 46:19-46:35: @1[0]: _3 = &_4 -46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] +46:19-46:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb7] 46:19-46:46: @2[1]: _1 = Eq(move _2, const 1_usize) 46:9-46:16: @2[3]: FakeRead(ForLet, _1) 47:25-47:26: @3[2]: _5 = const 2_i32 47:9-47:22: @3[3]: FakeRead(ForLet, _5) 48:9-48:16: @3[6]: _7 = _1 -48:8-48:16: @3[7]: _6 = Not(move _7) -48:8-48:16: @3[9]: FakeRead(ForMatchedPlace, _6)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="49:9-49:23: @6[0]: _5 = const 20_i32 -48:17-50:6: @6[1]: _0 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="49:9-49:23: @6[0]: _5 = const 20_i32 -48:17-50:6: @6[1]: _0 = const ()"> countdown = 20;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="49:9-49:23: @6[0]: _5 = const 20_i32 -48:17-50:6: @6[1]: _0 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="50:6-50:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="51:2-51:2: @7.Return: return"><span class="annotation">@7⦊</span>‸<span class="annotation">⦉@7</span></span></span></span></div> +48:8-48:16: @3[7]: _6 = Not(move _7)"> if !is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="49:9-49:23: @4[0]: _5 = const 20_i32 +48:17-50:6: @4[1]: _0 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:9-49:23: @4[0]: _5 = const 20_i32 +48:17-50:6: @4[1]: _0 = const ()"> countdown = 20;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="49:9-49:23: @4[0]: _5 = const 20_i32 +48:17-50:6: @4[1]: _0 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="50:6-50:6: @5[0]: _0 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code odd" style="--layer: 1" title="51:2-51:2: @6.Return: return"><span class="annotation">@6⦊</span>‸<span class="annotation">⦉@6</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.used_function.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.used_function.-------.InstrumentCoverage.0.html index 2ffd9bfb82386..d35f191b64e85 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.used_function.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.used_crate/used_crate.used_function.-------.InstrumentCoverage.0.html @@ -73,41 +73,38 @@ <span class="line"><span class="code" style="--layer: 0"> // Initialize test constants in a way that cannot be determined at compile time, to ensure</span></span> <span class="line"><span class="code" style="--layer: 0"> // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from</span></span> <span class="line"><span class="code" style="--layer: 0"> // dependent conditions.</span></span> -<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +<span class="line"><span class="code" style="--layer: 0"> let </span><span><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] 9:19-9:35: @1[0]: _3 = &_4 -9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] 9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) 9:9-9:16: @2[3]: FakeRead(ForLet, _1) 10:25-10:26: @3[2]: _5 = const 0_i32 10:9-10:22: @3[3]: FakeRead(ForLet, _5) -11:8-11:15: @3[6]: _7 = _1 -11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +11:8-11:15: @3[6]: _7 = _1"><span class="annotation">@0,1,2,3⦊</span>is_true = std::env::args().len() == 1;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] 9:19-9:35: @1[0]: _3 = &_4 -9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] 9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) 9:9-9:16: @2[3]: FakeRead(ForLet, _1) 10:25-10:26: @3[2]: _5 = const 0_i32 10:9-10:22: @3[3]: FakeRead(ForLet, _5) -11:8-11:15: @3[6]: _7 = _1 -11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> let mut countdown = 0;</span></span> -<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb10] +11:8-11:15: @3[6]: _7 = _1"> let mut countdown = 0;</span></span> +<span class="line"><span class="code even" style="--layer: 1" title="9:19-9:35: @0.Call: _4 = args() -> [return: bb1, unwind: bb9] 9:19-9:35: @1[0]: _3 = &_4 -9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb9] +9:19-9:41: @1.Call: _2 = <Args as ExactSizeIterator>::len(move _3) -> [return: bb2, unwind: bb8] 9:19-9:46: @2[1]: _1 = Eq(move _2, const 1_usize) 9:9-9:16: @2[3]: FakeRead(ForLet, _1) 10:25-10:26: @3[2]: _5 = const 0_i32 10:9-10:22: @3[3]: FakeRead(ForLet, _5) -11:8-11:15: @3[6]: _7 = _1 -11:8-11:15: @3[7]: FakeRead(ForMatchedPlace, _7)"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 -11:16-13:6: @6[1]: _6 = const ()"><span class="annotation">@4,6⦊</span>{</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 -11:16-13:6: @6[1]: _6 = const ()"> countdown = 10;</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @6[0]: _5 = const 10_i32 -11:16-13:6: @6[1]: _6 = const ()"> }<span class="annotation">⦉@4,6</span></span></span><span><span class="code even" style="--layer: 1" title="13:6-13:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:5-14:25: @7.Call: _8 = use_this_lib_crate() -> [return: bb8, unwind: bb10] -15:2-15:2: @8.Return: return"><span class="annotation">@7,8⦊</span>use_this_lib_crate();</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="14:5-14:25: @7.Call: _8 = use_this_lib_crate() -> [return: bb8, unwind: bb10] -15:2-15:2: @8.Return: return">}<span class="annotation">⦉@7,8</span></span></span></span></div> +11:8-11:15: @3[6]: _7 = _1"> if is_true<span class="annotation">⦉@0,1,2,3</span></span></span><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="12:9-12:23: @4[0]: _5 = const 10_i32 +11:16-13:6: @4[1]: _6 = const ()"><span class="annotation">@4⦊</span>{</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @4[0]: _5 = const 10_i32 +11:16-13:6: @4[1]: _6 = const ()"> countdown = 10;</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="12:9-12:23: @4[0]: _5 = const 10_i32 +11:16-13:6: @4[1]: _6 = const ()"> }<span class="annotation">⦉@4</span></span></span><span><span class="code even" style="--layer: 1" title="13:6-13:6: @5[0]: _6 = const ()"><span class="annotation">@5⦊</span>‸<span class="annotation">⦉@5</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="14:5-14:25: @6.Call: _8 = use_this_lib_crate() -> [return: bb7, unwind: bb9] +15:2-15:2: @7.Return: return"><span class="annotation">@6,7⦊</span>use_this_lib_crate();</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="14:5-14:25: @6.Call: _8 = use_this_lib_crate() -> [return: bb7, unwind: bb9] +15:2-15:2: @7.Return: return">}<span class="annotation">⦉@6,7</span></span></span></span></div> </body> </html> diff --git a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.while_early_ret/while_early_ret.main.-------.InstrumentCoverage.0.html b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.while_early_ret/while_early_ret.main.-------.InstrumentCoverage.0.html index 4cab153e77f53..fcb5418e1d0cf 100644 --- a/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.while_early_ret/while_early_ret.main.-------.InstrumentCoverage.0.html +++ b/src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump.while_early_ret/while_early_ret.main.-------.InstrumentCoverage.0.html @@ -86,51 +86,45 @@ <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 -12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) -12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"><span class="annotation">@3,5⦊</span>countdown</span></span> +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32)"><span class="annotation">@3,5⦊</span>countdown</span></span> <span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 -12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) -12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> <</span></span> +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32)"> <</span></span> <span class="line"><span class="code even" style="--layer: 1" title="12:13-12:22: @5[3]: _8 = _1 -12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32) -12:13-14:14: @5[6]: FakeRead(ForMatchedPlace, _7)"> 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"></span></span> +12:13-14:14: @5[4]: _7 = Lt(move _8, const 5_i32)"> 5<span class="annotation">⦉@3,5</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> <span class="line"><span class="code" style="--layer: 0"> return</span></span> <span class="line"><span class="code" style="--layer: 0"> if</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 -18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) -18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"><span class="annotation">@6,8⦊</span>countdown</span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 -18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) -18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> ></span></span> -<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @8[2]: _11 = _1 -18:21-20:22: @8[3]: _10 = Gt(move _11, const 8_i32) -18:21-20:22: @8[5]: FakeRead(ForMatchedPlace, _10)"> 8<span class="annotation">⦉@6,8</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="18:21-18:30: @6[2]: _11 = _1 +18:21-20:22: @6[3]: _10 = Gt(move _11, const 8_i32)"><span class="annotation">@6⦊</span>countdown</span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @6[2]: _11 = _1 +18:21-20:22: @6[3]: _10 = Gt(move _11, const 8_i32)"> ></span></span> +<span class="line"><span class="code odd" style="--layer: 1" title="18:21-18:30: @6[2]: _11 = _1 +18:21-20:22: @6[3]: _10 = Gt(move _11, const 8_i32)"> 8<span class="annotation">⦉@6</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:24-22:26: @11[1]: _12 = () -22:21-22:27: @11[2]: _0 = std::result::Result::<(), u8>::Ok(move _12)"><span class="annotation">@9,11⦊</span>Ok(())<span class="annotation">⦉@9,11</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code even" style="--layer: 1" title="22:24-22:26: @8[1]: _12 = () +22:21-22:27: @8[2]: _0 = std::result::Result::<(), u8>::Ok(move _12)"><span class="annotation">@8⦊</span>Ok(())<span class="annotation">⦉@8</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> else</span></span> <span class="line"><span class="code" style="--layer: 0"> {</span></span> -<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:21-26:27: @10[0]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@10⦊</span>Err(1)<span class="annotation">⦉@10</span></span></span><span class="code" style="--layer: 0"></span></span> +<span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="26:21-26:27: @9[0]: _0 = std::result::Result::<(), u8>::Err(const 1_u8)"><span class="annotation">@9⦊</span>Err(1)<span class="annotation">⦉@9</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span><span><span class="code even" style="--layer: 1" title="29:10-29:10: @7[0]: _6 = const () 30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32) -30:9-32:10: @12[0]: _1 = move (_13.0: i32)"><span class="annotation">@7,12⦊</span></span></span> +30:9-32:10: @11[0]: _1 = move (_13.0: i32)"><span class="annotation">@7,11⦊</span></span></span> <span class="line"><span class="code even" style="--layer: 1" title="29:10-29:10: @7[0]: _6 = const () 30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32) -30:9-32:10: @12[0]: _1 = move (_13.0: i32)"> countdown</span></span> +30:9-32:10: @11[0]: _1 = move (_13.0: i32)"> countdown</span></span> <span class="line"><span class="code even" style="--layer: 1" title="29:10-29:10: @7[0]: _6 = const () 30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32) -30:9-32:10: @12[0]: _1 = move (_13.0: i32)"> -=</span></span> +30:9-32:10: @11[0]: _1 = move (_13.0: i32)"> -=</span></span> <span class="line"><span class="code even" style="--layer: 1" title="29:10-29:10: @7[0]: _6 = const () 30:9-32:10: @7[3]: _13 = CheckedSub(_1, const 1_i32) -30:9-32:10: @12[0]: _1 = move (_13.0: i32)"> 1<span class="annotation">⦉@7,12</span></span></span><span class="code" style="--layer: 0"></span></span> +30:9-32:10: @11[0]: _1 = move (_13.0: i32)"> 1<span class="annotation">⦉@7,11</span></span></span><span class="code" style="--layer: 0"></span></span> <span class="line"><span class="code" style="--layer: 0"> ;</span></span> <span class="line"><span class="code" style="--layer: 0"> }</span></span> <span class="line"><span class="code" style="--layer: 0"> </span><span><span class="code odd" style="--layer: 1" title="35:8-35:10: @4[4]: _15 = () 35:5-35:11: @4[5]: _0 = std::result::Result::<(), u8>::Ok(move _15)"><span class="annotation">@4⦊</span>Ok(())<span class="annotation">⦉@4</span></span></span><span class="code" style="--layer: 0"></span></span> -<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="36:2-36:2: @14.Return: return"><span class="annotation">@14⦊</span>‸<span class="annotation">⦉@14</span></span></span></span></div> +<span class="line"><span class="code" style="--layer: 0">}</span><span><span class="code even" style="--layer: 1" title="36:2-36:2: @12.Return: return"><span class="annotation">@12⦊</span>‸<span class="annotation">⦉@12</span></span></span></span></div> </body> </html> diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr index 7db4734780817..fc49cc6d68ea0 100644 --- a/src/test/ui/issues/issue-14091.stderr +++ b/src/test/ui/issues/issue-14091.stderr @@ -3,6 +3,8 @@ error[E0308]: mismatched types | LL | assert!(1,1); | ^^^^^^^^^^^^^ expected `bool`, found integer + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr index 13b6a7bbef321..c646912d3b679 100644 --- a/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr +++ b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr @@ -28,9 +28,6 @@ LL | let x; ... LL | x = 1; | ^^^^^ cannot assign twice to immutable variable -LL | } else { -LL | x = 2; - | ----- first assignment to `x` error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:32:13 @@ -38,6 +35,9 @@ error[E0384]: cannot assign twice to immutable variable `x` LL | let x; | - help: make this binding mutable: `mut x` ... +LL | x = 1; + | ----- first assignment to `x` +LL | } else { LL | x = 2; | ^^^^^ cannot assign twice to immutable variable diff --git a/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs b/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs index 62c73dbac48b4..aa431f0596cca 100644 --- a/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs +++ b/src/tools/clippy/clippy_lints/src/assertions_on_constants.rs @@ -1,8 +1,7 @@ use crate::consts::{constant, Constant}; use crate::utils::{is_direct_expn_of, is_expn_of, match_panic_call, snippet_opt, span_lint_and_help}; use if_chain::if_chain; -use rustc_ast::ast::LitKind; -use rustc_hir::{Expr, ExprKind, PatKind, UnOp}; +use rustc_hir::{Expr, ExprKind, UnOp}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_lint_pass, declare_tool_lint}; @@ -102,31 +101,22 @@ enum AssertKind { /// Check if the expression matches /// /// ```rust,ignore -/// match { let _t = !c; _t } { -/// true => { -/// { -/// ::std::rt::begin_panic(message, _) -/// } -/// } -/// _ => { } -/// }; +/// if !c { +/// { +/// ::std::rt::begin_panic(message, _) +/// } +/// } /// ``` /// /// where `message` is any expression and `c` is a constant bool. fn match_assert_with_message<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<AssertKind> { if_chain! { - if let ExprKind::Match(ref expr, ref arms, _) = expr.kind; - // matches { let _t = expr; _t } - if let ExprKind::DropTemps(ref expr) = expr.kind; - if let ExprKind::Unary(UnOp::UnNot, ref expr) = expr.kind; + if let ExprKind::If(ref cond, ref then, _) = expr.kind; + if let ExprKind::Unary(UnOp::UnNot, ref expr) = cond.kind; // bind the first argument of the `assert!` macro if let Some((Constant::Bool(is_true), _)) = constant(cx, cx.typeck_results(), expr); - // arm 1 pattern - if let PatKind::Lit(ref lit_expr) = arms[0].pat.kind; - if let ExprKind::Lit(ref lit) = lit_expr.kind; - if let LitKind::Bool(true) = lit.node; - // arm 1 block - if let ExprKind::Block(ref block, _) = arms[0].body.kind; + // block + if let ExprKind::Block(ref block, _) = then.kind; if block.stmts.is_empty(); if let Some(block_expr) = &block.expr; // inner block is optional. unwrap it if it exists, or use the expression as is otherwise. diff --git a/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs b/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs index 736730d4084f4..4efca10bcdf13 100644 --- a/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs +++ b/src/tools/clippy/clippy_lints/src/blocks_in_if_conditions.rs @@ -1,4 +1,4 @@ -use crate::utils::{differing_macro_contexts, higher, snippet_block_with_applicability, span_lint, span_lint_and_sugg}; +use crate::utils::{differing_macro_contexts, snippet_block_with_applicability, span_lint, span_lint_and_sugg}; use rustc_errors::Applicability; use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use rustc_hir::{BlockCheckMode, Expr, ExprKind}; @@ -75,7 +75,7 @@ impl<'tcx> LateLintPass<'tcx> for BlocksInIfConditions { if in_external_macro(cx.sess(), expr.span) { return; } - if let Some((cond, _, _)) = higher::if_block(&expr) { + if let ExprKind::If(cond, _, _) = &expr.kind { if let ExprKind::Block(block, _) = &cond.kind { if block.rules == BlockCheckMode::DefaultBlock { if block.stmts.is_empty() { diff --git a/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs b/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs index b1bc2ec29e16e..b3ebdf4ca30d8 100644 --- a/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs +++ b/src/tools/clippy/clippy_lints/src/cognitive_complexity.rs @@ -147,6 +147,9 @@ impl<'tcx> Visitor<'tcx> for CCHelper { fn visit_expr(&mut self, e: &'tcx Expr<'_>) { walk_expr(self, e); match e.kind { + ExprKind::If(_, _, _) => { + self.cc += 1; + }, ExprKind::Match(_, ref arms, _) => { if arms.len() > 1 { self.cc += 1; diff --git a/src/tools/clippy/clippy_lints/src/consts.rs b/src/tools/clippy/clippy_lints/src/consts.rs index 0035ded9356cf..166eadf86c177 100644 --- a/src/tools/clippy/clippy_lints/src/consts.rs +++ b/src/tools/clippy/clippy_lints/src/consts.rs @@ -1,6 +1,6 @@ #![allow(clippy::float_cmp)] -use crate::utils::{clip, higher, sext, unsext}; +use crate::utils::{clip, sext, unsext}; use if_chain::if_chain; use rustc_ast::ast::{FloatTy, LitFloatType, LitKind}; use rustc_data_structures::sync::Lrc; @@ -228,9 +228,6 @@ pub struct ConstEvalLateContext<'a, 'tcx> { impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> { /// Simple constant folding: Insert an expression, get a constant or none. pub fn expr(&mut self, e: &Expr<'_>) -> Option<Constant> { - if let Some((ref cond, ref then, otherwise)) = higher::if_block(&e) { - return self.ifthenelse(cond, then, otherwise); - } match e.kind { ExprKind::Path(ref qpath) => self.fetch_path(qpath, e.hir_id, self.typeck_results.expr_ty(e)), ExprKind::Block(ref block, _) => self.block(block), @@ -249,6 +246,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> { UnOp::UnNeg => self.constant_negate(&o, self.typeck_results.expr_ty(e)), UnOp::UnDeref => Some(if let Constant::Ref(r) = o { *r } else { o }), }), + ExprKind::If(ref cond, ref then, ref otherwise) => self.ifthenelse(cond, then, *otherwise), ExprKind::Binary(op, ref left, ref right) => self.binop(op, left, right), ExprKind::Call(ref callee, ref args) => { // We only handle a few const functions for now. diff --git a/src/tools/clippy/clippy_lints/src/copies.rs b/src/tools/clippy/clippy_lints/src/copies.rs index 46ce92ea6d782..6f48ffeb0e9c9 100644 --- a/src/tools/clippy/clippy_lints/src/copies.rs +++ b/src/tools/clippy/clippy_lints/src/copies.rs @@ -1,6 +1,6 @@ use crate::utils::{eq_expr_value, in_macro, search_same, SpanlessEq, SpanlessHash}; -use crate::utils::{get_parent_expr, higher, if_sequence, span_lint_and_note}; -use rustc_hir::{Block, Expr}; +use crate::utils::{get_parent_expr, if_sequence, span_lint_and_note}; +use rustc_hir::{Block, Expr, ExprKind}; use rustc_lint::{LateContext, LateLintPass}; use rustc_session::{declare_lint_pass, declare_tool_lint}; @@ -109,11 +109,12 @@ impl<'tcx> LateLintPass<'tcx> for CopyAndPaste { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { if !expr.span.from_expansion() { // skip ifs directly in else, it will be checked in the parent if - if let Some(expr) = get_parent_expr(cx, expr) { - if let Some((_, _, Some(ref else_expr))) = higher::if_block(&expr) { - if else_expr.hir_id == expr.hir_id { - return; - } + if let Some(&Expr { + kind: ExprKind::If(_, _, Some(ref else_expr)), + .. + }) = get_parent_expr(cx, expr) { + if else_expr.hir_id == expr.hir_id { + return; } } diff --git a/src/tools/clippy/clippy_lints/src/entry.rs b/src/tools/clippy/clippy_lints/src/entry.rs index 35a5d00f4aa5a..37948e06869c3 100644 --- a/src/tools/clippy/clippy_lints/src/entry.rs +++ b/src/tools/clippy/clippy_lints/src/entry.rs @@ -1,5 +1,5 @@ use crate::utils::SpanlessEq; -use crate::utils::{get_item_name, higher, is_type_diagnostic_item, match_type, paths, snippet, snippet_opt}; +use crate::utils::{get_item_name, is_type_diagnostic_item, match_type, paths, snippet, snippet_opt}; use crate::utils::{snippet_with_applicability, span_lint_and_then}; use if_chain::if_chain; use rustc_errors::Applicability; @@ -54,7 +54,7 @@ declare_lint_pass!(HashMapPass => [MAP_ENTRY]); impl<'tcx> LateLintPass<'tcx> for HashMapPass { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - if let Some((ref check, ref then_block, ref else_block)) = higher::if_block(&expr) { + if let ExprKind::If(ref check, ref then_block, ref else_block) = expr.kind { if let ExprKind::Unary(UnOp::UnNot, ref check) = check.kind { if let Some((ty, map, key)) = check_cond(cx, check) { // in case of `if !m.contains_key(&k) { m.insert(k, v); }` diff --git a/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs b/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs index 18fea8b34bfd4..ffef78aac8067 100644 --- a/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs +++ b/src/tools/clippy/clippy_lints/src/floating_point_arithmetic.rs @@ -2,7 +2,7 @@ use crate::consts::{ constant, constant_simple, Constant, Constant::{Int, F32, F64}, }; -use crate::utils::{eq_expr_value, get_parent_expr, higher, numeric_literal, span_lint_and_sugg, sugg}; +use crate::utils::{eq_expr_value, get_parent_expr, numeric_literal, span_lint_and_sugg, sugg}; use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment, UnOp}; @@ -556,11 +556,11 @@ fn are_negated<'a>(cx: &LateContext<'_>, expr1: &'a Expr<'a>, expr2: &'a Expr<'a fn check_custom_abs(cx: &LateContext<'_>, expr: &Expr<'_>) { if_chain! { - if let Some((cond, body, Some(else_body))) = higher::if_block(&expr); + if let ExprKind::If(cond, body, else_body) = expr.kind; if let ExprKind::Block(block, _) = body.kind; if block.stmts.is_empty(); if let Some(if_body_expr) = block.expr; - if let ExprKind::Block(else_block, _) = else_body.kind; + if let Some(ExprKind::Block(else_block, _)) = else_body.map(|el| &el.kind); if else_block.stmts.is_empty(); if let Some(else_body_expr) = else_block.expr; if let Some((if_expr_positive, body)) = are_negated(cx, if_body_expr, else_body_expr); diff --git a/src/tools/clippy/clippy_lints/src/implicit_return.rs b/src/tools/clippy/clippy_lints/src/implicit_return.rs index 03e95c9e27f6a..109d90ff772b5 100644 --- a/src/tools/clippy/clippy_lints/src/implicit_return.rs +++ b/src/tools/clippy/clippy_lints/src/implicit_return.rs @@ -81,6 +81,13 @@ fn expr_match(cx: &LateContext<'_>, expr: &Expr<'_>) { lint(cx, expr.span, break_expr.span, LINT_BREAK); } }, + ExprKind::If(.., if_expr, else_expr) => { + expr_match(cx, if_expr); + + if let Some(else_expr) = else_expr { + expr_match(cx, else_expr); + } + }, ExprKind::Match(.., arms, source) => { let check_all_arms = match source { MatchSource::IfLetDesugar { diff --git a/src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs b/src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs index 3a01acd8fdc97..16e162badb5ee 100644 --- a/src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs +++ b/src/tools/clippy/clippy_lints/src/implicit_saturating_sub.rs @@ -1,4 +1,4 @@ -use crate::utils::{higher, in_macro, match_qpath, span_lint_and_sugg, SpanlessEq}; +use crate::utils::{in_macro, match_qpath, span_lint_and_sugg, SpanlessEq}; use if_chain::if_chain; use rustc_ast::ast::LitKind; use rustc_errors::Applicability; @@ -42,7 +42,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub { return; } if_chain! { - if let Some((ref cond, ref then, None)) = higher::if_block(&expr); + if let ExprKind::If(cond, then, None) = &expr.kind; // Check if the conditional expression is a binary operation if let ExprKind::Binary(ref cond_op, ref cond_left, ref cond_right) = cond.kind; diff --git a/src/tools/clippy/clippy_lints/src/let_if_seq.rs b/src/tools/clippy/clippy_lints/src/let_if_seq.rs index 0d2d95324c4f7..db717cd1240a4 100644 --- a/src/tools/clippy/clippy_lints/src/let_if_seq.rs +++ b/src/tools/clippy/clippy_lints/src/let_if_seq.rs @@ -1,5 +1,4 @@ -use crate::utils::visitors::LocalUsedVisitor; -use crate::utils::{higher, qpath_res, snippet, span_lint_and_then}; +use crate::utils::{qpath_res, snippet, span_lint_and_then, visitors::LocalUsedVisitor}; use if_chain::if_chain; use rustc_errors::Applicability; use rustc_hir as hir; @@ -64,7 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for LetIfSeq { if let hir::StmtKind::Local(ref local) = stmt.kind; if let hir::PatKind::Binding(mode, canonical_id, ident, None) = local.pat.kind; if let hir::StmtKind::Expr(ref if_) = expr.kind; - if let Some((ref cond, ref then, ref else_)) = higher::if_block(&if_); + if let hir::ExprKind::If(ref cond, ref then, ref else_) = if_.kind; if !LocalUsedVisitor::new(canonical_id).check_expr(cond); if let hir::ExprKind::Block(ref then, _) = then.kind; if let Some(value) = check_assign(cx, canonical_id, &*then); diff --git a/src/tools/clippy/clippy_lints/src/loops.rs b/src/tools/clippy/clippy_lints/src/loops.rs index 1bd96b2b4c89b..281964ee5e8f3 100644 --- a/src/tools/clippy/clippy_lints/src/loops.rs +++ b/src/tools/clippy/clippy_lints/src/loops.rs @@ -742,6 +742,14 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult { // Break can come from the inner loop so remove them. absorb_break(&never_loop_block(b, main_loop_id)) }, + ExprKind::If(ref e, ref e2, ref e3) => { + let e1 = never_loop_expr(e, main_loop_id); + let e2 = never_loop_expr(e2, main_loop_id); + let e3 = e3 + .as_ref() + .map_or(NeverLoopResult::Otherwise, |e| never_loop_expr(e, main_loop_id)); + combine_seq(e1, combine_branches(e2, e3)) + }, ExprKind::Match(ref e, ref arms, _) => { let e = never_loop_expr(e, main_loop_id); if arms.is_empty() { @@ -2594,7 +2602,7 @@ fn is_loop(expr: &Expr<'_>) -> bool { } fn is_conditional(expr: &Expr<'_>) -> bool { - matches!(expr.kind, ExprKind::Match(..)) + matches!(expr.kind, ExprKind::If(..) | ExprKind::Match(..)) } fn is_nested(cx: &LateContext<'_>, match_expr: &Expr<'_>, iter_expr: &Expr<'_>) -> bool { diff --git a/src/tools/clippy/clippy_lints/src/manual_strip.rs b/src/tools/clippy/clippy_lints/src/manual_strip.rs index 3c4368a3545a9..a0cfe145a301c 100644 --- a/src/tools/clippy/clippy_lints/src/manual_strip.rs +++ b/src/tools/clippy/clippy_lints/src/manual_strip.rs @@ -80,7 +80,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualStrip { } if_chain! { - if let Some((cond, then, _)) = higher::if_block(&expr); + if let ExprKind::If(cond, then, _) = &expr.kind; if let ExprKind::MethodCall(_, _, [target_arg, pattern], _) = cond.kind; if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(cond.hir_id); if let ExprKind::Path(target_path) = &target_arg.kind; diff --git a/src/tools/clippy/clippy_lints/src/methods/mod.rs b/src/tools/clippy/clippy_lints/src/methods/mod.rs index e99fe1b97ff64..2234890d6e94f 100644 --- a/src/tools/clippy/clippy_lints/src/methods/mod.rs +++ b/src/tools/clippy/clippy_lints/src/methods/mod.rs @@ -2048,6 +2048,7 @@ fn lint_expect_fun_call( hir::ExprKind::Call(..) | hir::ExprKind::MethodCall(..) // These variants are debatable or require further examination + | hir::ExprKind::If(..) | hir::ExprKind::Match(..) | hir::ExprKind::Block{ .. } => true, _ => false, diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_filter_map.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_filter_map.rs index d082a88cd2db5..d98e6160d3085 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_filter_map.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_filter_map.rs @@ -90,6 +90,12 @@ fn check_expression<'tcx>(cx: &LateContext<'tcx>, arg_id: hir::HirId, expr: &'tc } (found_mapping, found_filtering) }, + // There must be an else_arm or there will be a type error + hir::ExprKind::If(_, ref if_arm, Some(ref else_arm)) => { + let if_check = check_expression(cx, arg_id, if_arm); + let else_check = check_expression(cx, arg_id, else_arm); + (if_check.0 | else_check.0, if_check.1 | else_check.1) + }, hir::ExprKind::Path(path) if match_qpath(path, &paths::OPTION_NONE) => (false, true), _ => (true, true), } diff --git a/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs b/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs index 76417aa7ed09d..71f91eb4bfbe3 100644 --- a/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs +++ b/src/tools/clippy/clippy_lints/src/mutable_debug_assertion.rs @@ -90,6 +90,10 @@ impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> { self.found = true; return; }, + ExprKind::If(..) => { + self.found = true; + return; + }, ExprKind::Path(_) => { if let Some(adj) = self.cx.typeck_results().adjustments().get(expr.hir_id) { if adj diff --git a/src/tools/clippy/clippy_lints/src/needless_bool.rs b/src/tools/clippy/clippy_lints/src/needless_bool.rs index 42f97b2ac497a..6b9a37b525201 100644 --- a/src/tools/clippy/clippy_lints/src/needless_bool.rs +++ b/src/tools/clippy/clippy_lints/src/needless_bool.rs @@ -4,7 +4,7 @@ use crate::utils::sugg::Sugg; use crate::utils::{ - higher, is_expn_of, parent_node_is_if_expr, snippet_with_applicability, span_lint, span_lint_and_sugg, + is_expn_of, parent_node_is_if_expr, snippet_with_applicability, span_lint, span_lint_and_sugg, }; use rustc_ast::ast::LitKind; use rustc_errors::Applicability; @@ -71,7 +71,7 @@ declare_lint_pass!(NeedlessBool => [NEEDLESS_BOOL]); impl<'tcx> LateLintPass<'tcx> for NeedlessBool { fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { use self::Expression::{Bool, RetBool}; - if let Some((ref pred, ref then_block, Some(ref else_expr))) = higher::if_block(&e) { + if let ExprKind::If(ref pred, ref then_block, Some(ref else_expr)) = e.kind { let reduce = |ret, not| { let mut applicability = Applicability::MachineApplicable; let snip = Sugg::hir_with_applicability(cx, pred, "<predicate>", &mut applicability); diff --git a/src/tools/clippy/clippy_lints/src/option_if_let_else.rs b/src/tools/clippy/clippy_lints/src/option_if_let_else.rs index 681dbce97697e..391f893ef35ff 100644 --- a/src/tools/clippy/clippy_lints/src/option_if_let_else.rs +++ b/src/tools/clippy/clippy_lints/src/option_if_let_else.rs @@ -109,25 +109,26 @@ fn extract_body_from_arm<'a>(arm: &'a Arm<'a>) -> Option<&'a Expr<'a>> { /// it in curly braces. Otherwise, we don't. fn should_wrap_in_braces(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { utils::get_enclosing_block(cx, expr.hir_id).map_or(false, |parent| { + let mut should_wrap = false; + if let Some(Expr { kind: ExprKind::Match( _, arms, - MatchSource::IfDesugar { - contains_else_clause: true, - } - | MatchSource::IfLetDesugar { + MatchSource::IfLetDesugar { contains_else_clause: true, }, ), .. }) = parent.expr { - expr.hir_id == arms[1].body.hir_id - } else { - false + should_wrap = expr.hir_id == arms[1].body.hir_id; + } else if let Some(Expr { kind: ExprKind::If(_, _, Some(else_clause)), .. }) = parent.expr { + should_wrap = expr.hir_id == else_clause.hir_id; } + + should_wrap }) } diff --git a/src/tools/clippy/clippy_lints/src/question_mark.rs b/src/tools/clippy/clippy_lints/src/question_mark.rs index b91233ac58280..6c480d48c7561 100644 --- a/src/tools/clippy/clippy_lints/src/question_mark.rs +++ b/src/tools/clippy/clippy_lints/src/question_mark.rs @@ -8,7 +8,7 @@ use rustc_span::sym; use crate::utils::sugg::Sugg; use crate::utils::{ - eq_expr_value, higher, is_type_diagnostic_item, match_def_path, match_qpath, paths, snippet_with_applicability, + eq_expr_value, is_type_diagnostic_item, match_def_path, match_qpath, paths, snippet_with_applicability, span_lint_and_sugg, }; @@ -50,7 +50,7 @@ impl QuestionMark { /// If it matches, it will suggest to use the question mark operator instead fn check_is_none_and_early_return_none(cx: &LateContext<'_>, expr: &Expr<'_>) { if_chain! { - if let Some((if_expr, body, else_)) = higher::if_block(&expr); + if let ExprKind::If(if_expr, body, else_) = &expr.kind; if let ExprKind::MethodCall(segment, _, args, _) = &if_expr.kind; if segment.ident.name == sym!(is_none); if Self::expression_returns_none(cx, body); diff --git a/src/tools/clippy/clippy_lints/src/returns.rs b/src/tools/clippy/clippy_lints/src/returns.rs index 7f4913a02cbd3..35827e027aab8 100644 --- a/src/tools/clippy/clippy_lints/src/returns.rs +++ b/src/tools/clippy/clippy_lints/src/returns.rs @@ -184,6 +184,14 @@ fn check_final_expr<'tcx>( ExprKind::Block(ref block, _) => { check_block_return(cx, block); }, + ExprKind::If(_, then, else_clause_opt) => { + if let ExprKind::Block(ref ifblock, _) = then.kind { + check_block_return(cx, ifblock); + } + if let Some(else_clause) = else_clause_opt { + check_final_expr(cx, else_clause, None, RetReplacement::Empty); + } + }, // a match expr, check all arms // an if/if let expr, check both exprs // note, if without else is going to be a type checking error anyways @@ -194,9 +202,6 @@ fn check_final_expr<'tcx>( check_final_expr(cx, &arm.body, Some(arm.body.span), RetReplacement::Block); } }, - MatchSource::IfDesugar { - contains_else_clause: true, - } | MatchSource::IfLetDesugar { contains_else_clause: true, } => { diff --git a/src/tools/clippy/clippy_lints/src/shadow.rs b/src/tools/clippy/clippy_lints/src/shadow.rs index f839659267825..f2f3dfa09a7d4 100644 --- a/src/tools/clippy/clippy_lints/src/shadow.rs +++ b/src/tools/clippy/clippy_lints/src/shadow.rs @@ -333,6 +333,13 @@ fn check_expr<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, bindings: &mut check_expr(cx, e, bindings) } }, + ExprKind::If(ref cond, ref then, ref otherwise) => { + check_expr(cx, cond, bindings); + check_expr(cx, &**then, bindings); + if let Some(ref o) = *otherwise { + check_expr(cx, o, bindings); + } + }, ExprKind::Match(ref init, arms, _) => { check_expr(cx, init, bindings); let len = bindings.len(); diff --git a/src/tools/clippy/clippy_lints/src/unwrap.rs b/src/tools/clippy/clippy_lints/src/unwrap.rs index f4a77e54dd149..6a87f53436980 100644 --- a/src/tools/clippy/clippy_lints/src/unwrap.rs +++ b/src/tools/clippy/clippy_lints/src/unwrap.rs @@ -1,5 +1,5 @@ use crate::utils::{ - differing_macro_contexts, higher::if_block, is_type_diagnostic_item, span_lint_and_then, + differing_macro_contexts, is_type_diagnostic_item, span_lint_and_then, usage::is_potentially_mutated, }; use if_chain::if_chain; @@ -158,7 +158,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnwrappableVariablesVisitor<'a, 'tcx> { if in_external_macro(self.cx.tcx.sess, expr.span) { return; } - if let Some((cond, then, els)) = if_block(&expr) { + if let ExprKind::If(cond, then, els) = &expr.kind { walk_expr(self, cond); self.visit_branch(cond, then, false); if let Some(els) = els { diff --git a/src/tools/clippy/clippy_lints/src/utils/author.rs b/src/tools/clippy/clippy_lints/src/utils/author.rs index 4249dbb4e6519..43afa65de3e55 100644 --- a/src/tools/clippy/clippy_lints/src/utils/author.rs +++ b/src/tools/clippy/clippy_lints/src/utils/author.rs @@ -1,7 +1,7 @@ //! A group of attributes that can be attached to Rust code in order //! to generate a clippy lint detecting said code automatically. -use crate::utils::{get_attr, higher}; +use crate::utils::get_attr; use rustc_ast::ast::{Attribute, LitFloatType, LitKind}; use rustc_ast::walk_list; use rustc_data_structures::fx::FxHashMap; @@ -201,32 +201,6 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor { #[allow(clippy::too_many_lines)] fn visit_expr(&mut self, expr: &Expr<'_>) { - // handle if desugarings - // TODO add more desugarings here - if let Some((cond, then, opt_else)) = higher::if_block(&expr) { - let cond_pat = self.next("cond"); - let then_pat = self.next("then"); - if let Some(else_) = opt_else { - let else_pat = self.next("else_"); - println!( - " if let Some((ref {}, ref {}, Some({}))) = higher::if_block(&{});", - cond_pat, then_pat, else_pat, self.current - ); - self.current = else_pat; - self.visit_expr(else_); - } else { - println!( - " if let Some((ref {}, ref {}, None)) = higher::if_block(&{});", - cond_pat, then_pat, self.current - ); - } - self.current = cond_pat; - self.visit_expr(cond); - self.current = then_pat; - self.visit_expr(then); - return; - } - print!(" if let ExprKind::"); let current = format!("{}.kind", self.current); match expr.kind { @@ -351,6 +325,25 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor { self.current = body_pat; self.visit_block(body); }, + ExprKind::If(ref cond, ref then, ref opt_else) => { + let cond_pat = self.next("cond"); + let then_pat = self.next("then"); + if let Some(ref else_) = *opt_else { + let else_pat = self.next("else_"); + println!( + "If(ref {}, ref {}, Some(ref {})) = {};", + cond_pat, then_pat, else_pat, current + ); + self.current = else_pat; + self.visit_expr(else_); + } else { + println!("If(ref {}, ref {}, None) = {};", cond_pat, then_pat, current); + } + self.current = cond_pat; + self.visit_expr(cond); + self.current = then_pat; + self.visit_expr(then); + }, ExprKind::Match(ref expr, ref arms, desugaring) => { let des = desugaring_name(desugaring); let expr_pat = self.next("expr"); @@ -743,10 +736,6 @@ fn desugaring_name(des: hir::MatchSource) -> String { contains_else_clause ), hir::MatchSource::IfLetGuardDesugar => "MatchSource::IfLetGuardDesugar".to_string(), - hir::MatchSource::IfDesugar { contains_else_clause } => format!( - "MatchSource::IfDesugar {{ contains_else_clause: {} }}", - contains_else_clause - ), hir::MatchSource::AwaitDesugar => "MatchSource::AwaitDesugar".to_string(), } } diff --git a/src/tools/clippy/clippy_lints/src/utils/eager_or_lazy.rs b/src/tools/clippy/clippy_lints/src/utils/eager_or_lazy.rs index 8fe5ddee1ca8d..2f157c5030f44 100644 --- a/src/tools/clippy/clippy_lints/src/utils/eager_or_lazy.rs +++ b/src/tools/clippy/clippy_lints/src/utils/eager_or_lazy.rs @@ -62,6 +62,7 @@ fn identify_some_pure_patterns(expr: &Expr<'_>) -> bool { | ExprKind::Type(..) | ExprKind::DropTemps(..) | ExprKind::Loop(..) + | ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Closure(..) | ExprKind::Block(..) diff --git a/src/tools/clippy/clippy_lints/src/utils/higher.rs b/src/tools/clippy/clippy_lints/src/utils/higher.rs index 01ffac5b5599d..9b3585865da32 100644 --- a/src/tools/clippy/clippy_lints/src/utils/higher.rs +++ b/src/tools/clippy/clippy_lints/src/utils/higher.rs @@ -170,33 +170,6 @@ pub fn while_loop<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> Option<(&'tcx hir::Expr< None } -/// Recover the essential nodes of a desugared if block -/// `if cond { then } else { els }` becomes `(cond, then, Some(els))` -pub fn if_block<'tcx>( - expr: &'tcx hir::Expr<'tcx>, -) -> Option<( - &'tcx hir::Expr<'tcx>, - &'tcx hir::Expr<'tcx>, - Option<&'tcx hir::Expr<'tcx>>, -)> { - if let hir::ExprKind::Match(ref cond, ref arms, hir::MatchSource::IfDesugar { contains_else_clause }) = expr.kind { - let cond = if let hir::ExprKind::DropTemps(ref cond) = cond.kind { - cond - } else { - panic!("If block desugar must contain DropTemps"); - }; - let then = &arms[0].body; - let els = if contains_else_clause { - Some(&*arms[1].body) - } else { - None - }; - Some((cond, then, els)) - } else { - None - } -} - /// Represent the pre-expansion arguments of a `vec!` invocation. pub enum VecArgs<'a> { /// `vec![elem; len]` @@ -267,12 +240,11 @@ pub fn extract_assert_macro_args<'tcx>(e: &'tcx Expr<'tcx>) -> Option<Vec<&'tcx if let ExprKind::Block(ref block, _) = e.kind { if block.stmts.len() == 1 { - if let StmtKind::Semi(ref matchexpr) = block.stmts[0].kind { + if let StmtKind::Semi(ref matchexpr) = block.stmts.get(0)?.kind { // macros with unique arg: `{debug_}assert!` (e.g., `debug_assert!(some_condition)`) if_chain! { - if let ExprKind::Match(ref ifclause, _, _) = matchexpr.kind; - if let ExprKind::DropTemps(ref droptmp) = ifclause.kind; - if let ExprKind::Unary(UnOp::UnNot, condition) = droptmp.kind; + if let ExprKind::If(ref clause, _, _) = matchexpr.kind; + if let ExprKind::Unary(UnOp::UnNot, condition) = clause.kind; then { return Some(vec![condition]); } diff --git a/src/tools/clippy/clippy_lints/src/utils/hir_utils.rs b/src/tools/clippy/clippy_lints/src/utils/hir_utils.rs index a8fbb2ffaf0b4..b5cc2bdc4636a 100644 --- a/src/tools/clippy/clippy_lints/src/utils/hir_utils.rs +++ b/src/tools/clippy/clippy_lints/src/utils/hir_utils.rs @@ -119,6 +119,9 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> { (&ExprKind::Index(ref la, ref li), &ExprKind::Index(ref ra, ref ri)) => { self.eq_expr(la, ra) && self.eq_expr(li, ri) }, + (&ExprKind::If(ref lc, ref lt, ref le), &ExprKind::If(ref rc, ref rt, ref re)) => { + self.eq_expr(lc, rc) && self.eq_expr(&**lt, &**rt) && both(le, re, |l, r| self.eq_expr(l, r)) + }, (&ExprKind::Lit(ref l), &ExprKind::Lit(ref r)) => l.node == r.node, (&ExprKind::Loop(ref lb, ref ll, ref lls), &ExprKind::Loop(ref rb, ref rl, ref rls)) => { lls == rls && self.eq_block(lb, rb) && both(ll, rl, |l, r| l.ident.as_str() == r.ident.as_str()) @@ -564,6 +567,15 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> { self.hash_name(i.ident.name); } }, + ExprKind::If(ref cond, ref then, ref else_opt) => { + let c: fn(_, _, _) -> _ = ExprKind::If; + c.hash(&mut self.s); + self.hash_expr(cond); + self.hash_expr(&**then); + if let Some(ref e) = *else_opt { + self.hash_expr(e); + } + }, ExprKind::Match(ref e, arms, ref s) => { self.hash_expr(e); diff --git a/src/tools/clippy/clippy_lints/src/utils/inspector.rs b/src/tools/clippy/clippy_lints/src/utils/inspector.rs index 5d946e4bd495d..71c11788d93ac 100644 --- a/src/tools/clippy/clippy_lints/src/utils/inspector.rs +++ b/src/tools/clippy/clippy_lints/src/utils/inspector.rs @@ -213,6 +213,15 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) { hir::ExprKind::Loop(..) => { println!("{}Loop", ind); }, + hir::ExprKind::If(ref cond, _, ref else_opt) => { + println!("{}If", ind); + println!("{}condition:", ind); + print_expr(cx, cond, indent + 1); + if let Some(ref els) = *else_opt { + println!("{}else:", ind); + print_expr(cx, els, indent + 1); + } + }, hir::ExprKind::Match(ref cond, _, ref source) => { println!("{}Match", ind); println!("{}condition:", ind); diff --git a/src/tools/clippy/clippy_lints/src/utils/mod.rs b/src/tools/clippy/clippy_lints/src/utils/mod.rs index 1c68e837c4ab9..bd103246e4ef8 100644 --- a/src/tools/clippy/clippy_lints/src/utils/mod.rs +++ b/src/tools/clippy/clippy_lints/src/utils/mod.rs @@ -1405,7 +1405,7 @@ pub fn if_sequence<'tcx>( let mut conds = SmallVec::new(); let mut blocks: SmallVec<[&Block<'_>; 1]> = SmallVec::new(); - while let Some((ref cond, ref then_expr, ref else_expr)) = higher::if_block(&expr) { + while let ExprKind::If(ref cond, ref then_expr, ref else_expr) = expr.kind { conds.push(&**cond); if let ExprKind::Block(ref block, _) = then_expr.kind { blocks.push(block); @@ -1434,11 +1434,11 @@ pub fn parent_node_is_if_expr(expr: &Expr<'_>, cx: &LateContext<'_>) -> bool { let map = cx.tcx.hir(); let parent_id = map.get_parent_node(expr.hir_id); let parent_node = map.get(parent_id); - - match parent_node { - Node::Expr(e) => higher::if_block(&e).is_some(), - Node::Arm(e) => higher::if_block(&e.body).is_some(), - _ => false, + if let Node::Expr(Expr { kind: ExprKind::If(_, _, _), .. }) = parent_node { + true + } + else { + false } } diff --git a/src/tools/clippy/clippy_lints/src/utils/sugg.rs b/src/tools/clippy/clippy_lints/src/utils/sugg.rs index 1fcd41e4dbfed..03678db575f0d 100644 --- a/src/tools/clippy/clippy_lints/src/utils/sugg.rs +++ b/src/tools/clippy/clippy_lints/src/utils/sugg.rs @@ -103,6 +103,7 @@ impl<'a> Sugg<'a> { match expr.kind { hir::ExprKind::AddrOf(..) | hir::ExprKind::Box(..) + | hir::ExprKind::If(..) | hir::ExprKind::Closure(..) | hir::ExprKind::Unary(..) | hir::ExprKind::Match(..) => Sugg::MaybeParen(snippet), diff --git a/src/tools/clippy/clippy_lints/src/utils/visitors.rs b/src/tools/clippy/clippy_lints/src/utils/visitors.rs index 28b3e79d7a6d6..b769a18802b6b 100644 --- a/src/tools/clippy/clippy_lints/src/utils/visitors.rs +++ b/src/tools/clippy/clippy_lints/src/utils/visitors.rs @@ -101,6 +101,13 @@ where } } else { match expr.kind { + hir::ExprKind::If(cond, then, else_opt) => { + self.inside_stmt(true).visit_expr(cond); + self.visit_expr(then); + if let Some(el) = else_opt { + self.visit_expr(el); + } + } hir::ExprKind::Match(cond, arms, _) => { self.inside_stmt(true).visit_expr(cond); for arm in arms { diff --git a/src/tools/clippy/tests/ui/author/if.stdout b/src/tools/clippy/tests/ui/author/if.stdout index c18d035953e53..cac64a3f40b41 100644 --- a/src/tools/clippy/tests/ui/author/if.stdout +++ b/src/tools/clippy/tests/ui/author/if.stdout @@ -1,7 +1,7 @@ if_chain! { if let StmtKind::Local(ref local) = stmt.kind; if let Some(ref init) = local.init; - if let Some((ref cond, ref then, Some(else_))) = higher::if_block(&init); + if let ExprKind::If(ref cond, ref then, Some(ref else_)) = init.kind; if let ExprKind::Block(ref block) = else_.kind; if let Some(trailing_expr) = &block.expr; if block.stmts.len() == 1; diff --git a/src/tools/clippy/tests/ui/panic_in_result_fn_assertions.stderr b/src/tools/clippy/tests/ui/panic_in_result_fn_assertions.stderr index 86f61ad718a9c..a17f043737d4e 100644 --- a/src/tools/clippy/tests/ui/panic_in_result_fn_assertions.stderr +++ b/src/tools/clippy/tests/ui/panic_in_result_fn_assertions.stderr @@ -14,7 +14,7 @@ note: return Err() instead of panicking --> $DIR/panic_in_result_fn_assertions.rs:9:9 | LL | assert!(x == 5, "wrong argument"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`