authorbors <bors@rust-lang.org> 2025-11-12 23:21:24 UTC
committerbors <bors@rust-lang.org> 2025-11-12 23:21:24 UTC
log503dce33e2e2a5d2fe978b2723ab2a994cc27472
tree72ca3e99701da0f1b1953b9119679a2b00243dce
parent01867557cd7dbe256a031a7b8e28d05daecd75ab
parentcfbdc2c36d002ed80dbc1cd918d84f6c18e901be

Auto merge of #148789 - m-ou-se:new-fmt-args-alt, r=wafflelapkin,jdonszelmann

New format_args!() and fmt::Arguments implementation Part of https://github.com/rust-lang/rust/issues/99012 This is a new implementation of `format_args!()` and `fmt::Arguments`. With this implementation, `fmt::Arguments` is only two pointers in size. (Instead of six, before.) This makes it the same size as a `&str` and makes it fit in a register pair. --- This `fmt::Arguments` can store a `&'static str` _without any indirection_ or additional storage. This means that simple cases like `print_fmt(format_args!("hello"))` are now just as efficient for the caller as `print_str("hello")`, as shown by this example: > code: > ```rust > fn main() { > println!("Hello, world!"); > } > ``` > > before: > ```asm > main: > sub rsp, 56 > lea rax, [rip + .Lanon_hello_world] > mov qword ptr [rsp + 8], rax > mov qword ptr [rsp + 16], 1 > mov qword ptr [rsp + 24], 8 > xorps xmm0, xmm0 > movups xmmword ptr [rsp + 32], xmm0 > lea rdi, [rsp + 8] > call qword ptr [rip + std::io::stdio::_print] > add rsp, 56 > ret > ``` > > after: > ```asm > main: > lea rsi, [rip + .Lanon_hello_world] > mov edi, 29 > jmp qword ptr [rip + std::io::stdio::_print] > ``` (`panic!("Hello, world!");` shows a similar change.) --- This implementation stores all static information as just a single (byte) string, without any indirection: > code: > ```rust > format_args!("Hello, {name:-^20}!") > ``` > > lowering before: > ```rust > fmt::Arguments::new_v1_formatted( > &["Hello, ", "!\n"], > &args, > &[ > Placeholder { > position: 0usize, > flags: 3355443245u32, > precision: format_count::Implied, > width: format_count::Is(20u16), > }, > ], > ) > ``` > > lowering after: > ```rust > fmt::Arguments::new( > b"\x07Hello, \xc3-\x00\x00\xc8\x14\x00\x02!\n\x00", > &args, > ) > ``` This saves a ton of pointers and simplifies the expansion significantly, but does mean that individual pieces (e.g. `"Hello, "` and `"!\n"`) cannot be reused. (Those pieces are often smaller than a pointer to them, though, in which case reusing them is useless.) --- The details of the new representation are documented in [library/core/src/fmt/mod.rs](https://github.com/m-ou-se/rust/blob/new-fmt-args-alt/library/core/src/fmt/mod.rs#L609-L712).

58 files changed, 886 insertions(+), 989 deletions(-)

compiler/rustc_ast_lowering/src/expr.rs+13-31
......@@ -13,7 +13,7 @@ use rustc_middle::span_bug;
1313use rustc_middle::ty::TyCtxt;
1414use rustc_session::errors::report_lit_error;
1515use rustc_span::source_map::{Spanned, respan};
16use rustc_span::{DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym};
16use rustc_span::{ByteSymbol, DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym};
1717use thin_vec::{ThinVec, thin_vec};
1818use visit::{Visitor, walk_expr};
1919
......@@ -924,7 +924,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
924924 arena_vec![self; new_unchecked, get_context],
925925 ),
926926 };
927 self.arena.alloc(self.expr_unsafe(call))
927 self.arena.alloc(self.expr_unsafe(span, call))
928928 };
929929
930930 // `::std::task::Poll::Ready(result) => break result`
......@@ -1832,7 +1832,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
18321832 arena_vec![self; iter],
18331833 ));
18341834 // `unsafe { ... }`
1835 let iter = self.arena.alloc(self.expr_unsafe(iter));
1835 let iter = self.arena.alloc(self.expr_unsafe(head_span, iter));
18361836 let kind = self.make_lowered_await(head_span, iter, FutureKind::AsyncIterator);
18371837 self.arena.alloc(hir::Expr { hir_id: self.next_id(), kind, span: head_span })
18381838 }
......@@ -1887,7 +1887,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
18871887 arena_vec![self; iter],
18881888 ));
18891889 // `unsafe { ... }`
1890 let iter = self.arena.alloc(self.expr_unsafe(iter));
1890 let iter = self.arena.alloc(self.expr_unsafe(head_span, iter));
18911891 let inner_match_expr = self.arena.alloc(self.expr_match(
18921892 for_span,
18931893 iter,
......@@ -2103,30 +2103,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
21032103 self.arena.alloc(self.expr(sp, hir::ExprKind::Tup(&[])))
21042104 }
21052105
2106 fn expr_uint(&mut self, sp: Span, ty: ast::UintTy, value: u128) -> hir::Expr<'hir> {
2106 pub(super) fn expr_str(&mut self, sp: Span, value: Symbol) -> hir::Expr<'hir> {
21072107 let lit = hir::Lit {
21082108 span: self.lower_span(sp),
2109 node: ast::LitKind::Int(value.into(), ast::LitIntType::Unsigned(ty)),
2109 node: ast::LitKind::Str(value, ast::StrStyle::Cooked),
21102110 };
21112111 self.expr(sp, hir::ExprKind::Lit(lit))
21122112 }
21132113
2114 pub(super) fn expr_usize(&mut self, sp: Span, value: usize) -> hir::Expr<'hir> {
2115 self.expr_uint(sp, ast::UintTy::Usize, value as u128)
2116 }
2117
2118 pub(super) fn expr_u32(&mut self, sp: Span, value: u32) -> hir::Expr<'hir> {
2119 self.expr_uint(sp, ast::UintTy::U32, value as u128)
2120 }
2121
2122 pub(super) fn expr_u16(&mut self, sp: Span, value: u16) -> hir::Expr<'hir> {
2123 self.expr_uint(sp, ast::UintTy::U16, value as u128)
2124 }
2125
2126 pub(super) fn expr_str(&mut self, sp: Span, value: Symbol) -> hir::Expr<'hir> {
2114 pub(super) fn expr_byte_str(&mut self, sp: Span, value: ByteSymbol) -> hir::Expr<'hir> {
21272115 let lit = hir::Lit {
21282116 span: self.lower_span(sp),
2129 node: ast::LitKind::Str(value, ast::StrStyle::Cooked),
2117 node: ast::LitKind::ByteStr(value, ast::StrStyle::Cooked),
21302118 };
21312119 self.expr(sp, hir::ExprKind::Lit(lit))
21322120 }
......@@ -2262,9 +2250,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
22622250 self.expr(span, expr_path)
22632251 }
22642252
2265 fn expr_unsafe(&mut self, expr: &'hir hir::Expr<'hir>) -> hir::Expr<'hir> {
2253 pub(super) fn expr_unsafe(
2254 &mut self,
2255 span: Span,
2256 expr: &'hir hir::Expr<'hir>,
2257 ) -> hir::Expr<'hir> {
22662258 let hir_id = self.next_id();
2267 let span = expr.span;
22682259 self.expr(
22692260 span,
22702261 hir::ExprKind::Block(
......@@ -2302,15 +2293,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
23022293 self.arena.alloc(self.expr_block(b))
23032294 }
23042295
2305 pub(super) fn expr_array_ref(
2306 &mut self,
2307 span: Span,
2308 elements: &'hir [hir::Expr<'hir>],
2309 ) -> hir::Expr<'hir> {
2310 let array = self.arena.alloc(self.expr(span, hir::ExprKind::Array(elements)));
2311 self.expr_ref(span, array)
2312 }
2313
23142296 pub(super) fn expr_ref(&mut self, span: Span, expr: &'hir hir::Expr<'hir>) -> hir::Expr<'hir> {
23152297 self.expr(span, hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Not, expr))
23162298 }
compiler/rustc_ast_lowering/src/format.rs+194-260
......@@ -4,7 +4,7 @@ use rustc_ast::*;
44use rustc_data_structures::fx::FxIndexMap;
55use rustc_hir as hir;
66use rustc_session::config::FmtDebug;
7use rustc_span::{DesugaringKind, Ident, Span, Symbol, sym};
7use rustc_span::{ByteSymbol, DesugaringKind, Ident, Span, Symbol, sym};
88
99use super::LoweringContext;
1010
......@@ -90,20 +90,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
9090 let mut inlined_anything = false;
9191
9292 for i in 0..fmt.template.len() {
93 let FormatArgsPiece::Placeholder(placeholder) = &fmt.template[i] else { continue };
94 let Ok(arg_index) = placeholder.argument.index else { continue };
95
96 let mut literal = None;
97
98 if let FormatTrait::Display = placeholder.format_trait
93 if let FormatArgsPiece::Placeholder(placeholder) = &fmt.template[i]
94 && let Ok(arg_index) = placeholder.argument.index
95 && let FormatTrait::Display = placeholder.format_trait
9996 && placeholder.format_options == Default::default()
10097 && let arg = fmt.arguments.all_args()[arg_index].expr.peel_parens_and_refs()
10198 && let ExprKind::Lit(lit) = arg.kind
99 && let Some(literal) = self.try_inline_lit(lit)
102100 {
103 literal = self.try_inline_lit(lit);
104 }
105
106 if let Some(literal) = literal {
107101 // Now we need to mutate the outer FormatArgs.
108102 // If this is the first time, this clones the outer FormatArgs.
109103 let fmt = fmt.to_mut();
......@@ -265,136 +259,21 @@ fn make_argument<'hir>(
265259 ctx.expr_call_mut(sp, new_fn, std::slice::from_ref(arg))
266260}
267261
268/// Generate a hir expression for a format_args Count.
269///
270/// Generates:
262/// Get the value for a `width` or `precision` field.
271263///
272/// ```text
273/// <core::fmt::rt::Count>::Is(…)
274/// ```
275///
276/// or
277///
278/// ```text
279/// <core::fmt::rt::Count>::Param(…)
280/// ```
281///
282/// or
283///
284/// ```text
285/// <core::fmt::rt::Count>::Implied
286/// ```
287fn make_count<'hir>(
288 ctx: &mut LoweringContext<'_, 'hir>,
289 sp: Span,
290 count: &Option<FormatCount>,
264/// Returns the value and whether it is indirect (an indexed argument) or not.
265fn make_count(
266 count: &FormatCount,
291267 argmap: &mut FxIndexMap<(usize, ArgumentType), Option<Span>>,
292) -> hir::Expr<'hir> {
268) -> (bool, u16) {
293269 match count {
294 Some(FormatCount::Literal(n)) => {
295 let count_is = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
296 sp,
297 hir::LangItem::FormatCount,
298 sym::Is,
299 ));
300 let value = ctx.arena.alloc_from_iter([ctx.expr_u16(sp, *n)]);
301 ctx.expr_call_mut(sp, count_is, value)
302 }
303 Some(FormatCount::Argument(arg)) => {
304 if let Ok(arg_index) = arg.index {
305 let (i, _) = argmap.insert_full((arg_index, ArgumentType::Usize), arg.span);
306 let count_param = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
307 sp,
308 hir::LangItem::FormatCount,
309 sym::Param,
310 ));
311 let value = ctx.arena.alloc_from_iter([ctx.expr_usize(sp, i)]);
312 ctx.expr_call_mut(sp, count_param, value)
313 } else {
314 ctx.expr(
315 sp,
316 hir::ExprKind::Err(
317 ctx.dcx().span_delayed_bug(sp, "lowered bad format_args count"),
318 ),
319 )
320 }
321 }
322 None => ctx.expr_lang_item_type_relative(sp, hir::LangItem::FormatCount, sym::Implied),
323 }
324}
325
326/// Generate a hir expression for a format_args placeholder specification.
327///
328/// Generates
329///
330/// ```text
331/// <core::fmt::rt::Placeholder {
332/// position: …usize,
333/// flags: …u32,
334/// precision: <core::fmt::rt::Count::…>,
335/// width: <core::fmt::rt::Count::…>,
336/// }
337/// ```
338fn make_format_spec<'hir>(
339 ctx: &mut LoweringContext<'_, 'hir>,
340 sp: Span,
341 placeholder: &FormatPlaceholder,
342 argmap: &mut FxIndexMap<(usize, ArgumentType), Option<Span>>,
343) -> hir::Expr<'hir> {
344 let position = match placeholder.argument.index {
345 Ok(arg_index) => {
346 let (i, _) = argmap.insert_full(
347 (arg_index, ArgumentType::Format(placeholder.format_trait)),
348 placeholder.span,
349 );
350 ctx.expr_usize(sp, i)
351 }
352 Err(_) => ctx.expr(
353 sp,
354 hir::ExprKind::Err(ctx.dcx().span_delayed_bug(sp, "lowered bad format_args count")),
270 FormatCount::Literal(n) => (false, *n),
271 FormatCount::Argument(arg) => (
272 true,
273 argmap.insert_full((arg.index.unwrap_or(usize::MAX), ArgumentType::Usize), arg.span).0
274 as u16,
355275 ),
356 };
357 let &FormatOptions {
358 ref width,
359 ref precision,
360 alignment,
361 fill,
362 sign,
363 alternate,
364 zero_pad,
365 debug_hex,
366 } = &placeholder.format_options;
367 let fill = fill.unwrap_or(' ');
368 // These need to match the constants in library/core/src/fmt/rt.rs.
369 let align = match alignment {
370 Some(FormatAlignment::Left) => 0,
371 Some(FormatAlignment::Right) => 1,
372 Some(FormatAlignment::Center) => 2,
373 None => 3,
374 };
375 // This needs to match the constants in library/core/src/fmt/rt.rs.
376 let flags: u32 = fill as u32
377 | ((sign == Some(FormatSign::Plus)) as u32) << 21
378 | ((sign == Some(FormatSign::Minus)) as u32) << 22
379 | (alternate as u32) << 23
380 | (zero_pad as u32) << 24
381 | ((debug_hex == Some(FormatDebugHex::Lower)) as u32) << 25
382 | ((debug_hex == Some(FormatDebugHex::Upper)) as u32) << 26
383 | (width.is_some() as u32) << 27
384 | (precision.is_some() as u32) << 28
385 | align << 29
386 | 1 << 31; // Highest bit always set.
387 let flags = ctx.expr_u32(sp, flags);
388 let precision = make_count(ctx, sp, precision, argmap);
389 let width = make_count(ctx, sp, width, argmap);
390 let position = ctx.expr_field(Ident::new(sym::position, sp), ctx.arena.alloc(position), sp);
391 let flags = ctx.expr_field(Ident::new(sym::flags, sp), ctx.arena.alloc(flags), sp);
392 let precision = ctx.expr_field(Ident::new(sym::precision, sp), ctx.arena.alloc(precision), sp);
393 let width = ctx.expr_field(Ident::new(sym::width, sp), ctx.arena.alloc(width), sp);
394 let placeholder =
395 ctx.arena.alloc(ctx.make_lang_item_qpath(hir::LangItem::FormatPlaceholder, sp, None));
396 let fields = ctx.arena.alloc_from_iter([position, flags, precision, width]);
397 ctx.expr(sp, hir::ExprKind::Struct(placeholder, fields, hir::StructTailExpr::None))
276 }
398277}
399278
400279fn expand_format_args<'hir>(
......@@ -405,85 +284,152 @@ fn expand_format_args<'hir>(
405284) -> hir::ExprKind<'hir> {
406285 let macsp = ctx.lower_span(macsp);
407286
287 // Create a list of all _unique_ (argument, format trait) combinations.
288 // E.g. "{0} {0:x} {0} {1}" -> [(0, Display), (0, LowerHex), (1, Display)]
289 //
290 // We use usize::MAX for arguments that don't exist, because that can never be a valid index
291 // into the arguments array.
292 let mut argmap = FxIndexMap::default();
293
408294 let mut incomplete_lit = String::new();
409 let lit_pieces =
410 ctx.arena.alloc_from_iter(fmt.template.iter().enumerate().filter_map(|(i, piece)| {
411 match piece {
412 &FormatArgsPiece::Literal(s) => {
413 // Coalesce adjacent literal pieces.
414 if let Some(FormatArgsPiece::Literal(_)) = fmt.template.get(i + 1) {
415 incomplete_lit.push_str(s.as_str());
416 None
417 } else if !incomplete_lit.is_empty() {
418 incomplete_lit.push_str(s.as_str());
419 let s = Symbol::intern(&incomplete_lit);
420 incomplete_lit.clear();
421 Some(ctx.expr_str(fmt.span, s))
422 } else {
423 Some(ctx.expr_str(fmt.span, s))
424 }
295
296 let mut implicit_arg_index = 0;
297
298 let mut bytecode = Vec::new();
299
300 let template = if fmt.template.is_empty() {
301 // Treat empty templates as a single literal piece (with an empty string),
302 // so we produce `from_str("")` for those.
303 &[FormatArgsPiece::Literal(sym::empty)][..]
304 } else {
305 &fmt.template[..]
306 };
307
308 // See library/core/src/fmt/mod.rs for the format string encoding format.
309
310 for (i, piece) in template.iter().enumerate() {
311 match piece {
312 &FormatArgsPiece::Literal(sym) => {
313 // Coalesce adjacent literal pieces.
314 if let Some(FormatArgsPiece::Literal(_)) = template.get(i + 1) {
315 incomplete_lit.push_str(sym.as_str());
316 continue;
317 }
318 let mut s = if incomplete_lit.is_empty() {
319 sym.as_str()
320 } else {
321 incomplete_lit.push_str(sym.as_str());
322 &incomplete_lit
323 };
324
325 // If this is the last piece and was the only piece, that means
326 // there are no placeholders and the entire format string is just a literal.
327 //
328 // In that case, we can just use `from_str`.
329 if i + 1 == template.len() && bytecode.is_empty() {
330 // Generate:
331 // <core::fmt::Arguments>::from_str("meow")
332 let from_str = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
333 macsp,
334 hir::LangItem::FormatArguments,
335 if allow_const { sym::from_str } else { sym::from_str_nonconst },
336 ));
337 let sym = if incomplete_lit.is_empty() { sym } else { Symbol::intern(s) };
338 let s = ctx.expr_str(fmt.span, sym);
339 let args = ctx.arena.alloc_from_iter([s]);
340 return hir::ExprKind::Call(from_str, args);
425341 }
426 &FormatArgsPiece::Placeholder(_) => {
427 // Inject empty string before placeholders when not already preceded by a literal piece.
428 if i == 0 || matches!(fmt.template[i - 1], FormatArgsPiece::Placeholder(_)) {
429 Some(ctx.expr_str(fmt.span, sym::empty))
342
343 // Encode the literal in chunks of up to u16::MAX bytes, split at utf-8 boundaries.
344 while !s.is_empty() {
345 let len = s.floor_char_boundary(usize::from(u16::MAX));
346 if len < 0x80 {
347 bytecode.push(len as u8);
430348 } else {
431 None
349 bytecode.push(0x80);
350 bytecode.extend_from_slice(&(len as u16).to_le_bytes());
432351 }
352 bytecode.extend(&s.as_bytes()[..len]);
353 s = &s[len..];
433354 }
434 }
435 }));
436 let lit_pieces = ctx.expr_array_ref(fmt.span, lit_pieces);
437
438 // Whether we'll use the `Arguments::new_v1_formatted` form (true),
439 // or the `Arguments::new_v1` form (false).
440 let mut use_format_options = false;
441355
442 // Create a list of all _unique_ (argument, format trait) combinations.
443 // E.g. "{0} {0:x} {0} {1}" -> [(0, Display), (0, LowerHex), (1, Display)]
444 let mut argmap = FxIndexMap::default();
445 for piece in &fmt.template {
446 let FormatArgsPiece::Placeholder(placeholder) = piece else { continue };
447 if placeholder.format_options != Default::default() {
448 // Can't use basic form if there's any formatting options.
449 use_format_options = true;
450 }
451 if let Ok(index) = placeholder.argument.index {
452 if argmap
453 .insert((index, ArgumentType::Format(placeholder.format_trait)), placeholder.span)
454 .is_some()
455 {
456 // Duplicate (argument, format trait) combination,
457 // which we'll only put once in the args array.
458 use_format_options = true;
356 incomplete_lit.clear();
357 }
358 FormatArgsPiece::Placeholder(p) => {
359 // Push the start byte and remember its index so we can set the option bits later.
360 let i = bytecode.len();
361 bytecode.push(0xC0);
362
363 let position = argmap
364 .insert_full(
365 (
366 p.argument.index.unwrap_or(usize::MAX),
367 ArgumentType::Format(p.format_trait),
368 ),
369 p.span,
370 )
371 .0 as u64;
372
373 // This needs to match the constants in library/core/src/fmt/mod.rs.
374 let o = &p.format_options;
375 let align = match o.alignment {
376 Some(FormatAlignment::Left) => 0,
377 Some(FormatAlignment::Right) => 1,
378 Some(FormatAlignment::Center) => 2,
379 None => 3,
380 };
381 let default_flags = 0x6000_0020;
382 let flags: u32 = o.fill.unwrap_or(' ') as u32
383 | ((o.sign == Some(FormatSign::Plus)) as u32) << 21
384 | ((o.sign == Some(FormatSign::Minus)) as u32) << 22
385 | (o.alternate as u32) << 23
386 | (o.zero_pad as u32) << 24
387 | ((o.debug_hex == Some(FormatDebugHex::Lower)) as u32) << 25
388 | ((o.debug_hex == Some(FormatDebugHex::Upper)) as u32) << 26
389 | (o.width.is_some() as u32) << 27
390 | (o.precision.is_some() as u32) << 28
391 | align << 29;
392 if flags != default_flags {
393 bytecode[i] |= 1;
394 bytecode.extend_from_slice(&flags.to_le_bytes());
395 if let Some(val) = &o.width {
396 let (indirect, val) = make_count(val, &mut argmap);
397 // Only encode if nonzero; zero is the default.
398 if indirect || val != 0 {
399 bytecode[i] |= 1 << 1 | (indirect as u8) << 4;
400 bytecode.extend_from_slice(&val.to_le_bytes());
401 }
402 }
403 if let Some(val) = &o.precision {
404 let (indirect, val) = make_count(val, &mut argmap);
405 // Only encode if nonzero; zero is the default.
406 if indirect || val != 0 {
407 bytecode[i] |= 1 << 2 | (indirect as u8) << 5;
408 bytecode.extend_from_slice(&val.to_le_bytes());
409 }
410 }
411 }
412 if implicit_arg_index != position {
413 bytecode[i] |= 1 << 3;
414 bytecode.extend_from_slice(&(position as u16).to_le_bytes());
415 }
416 implicit_arg_index = position + 1;
459417 }
460418 }
461419 }
462420
463 let format_options = use_format_options.then(|| {
464 // Generate:
465 // &[format_spec_0, format_spec_1, format_spec_2]
466 let elements = ctx.arena.alloc_from_iter(fmt.template.iter().filter_map(|piece| {
467 let FormatArgsPiece::Placeholder(placeholder) = piece else { return None };
468 Some(make_format_spec(ctx, macsp, placeholder, &mut argmap))
469 }));
470 ctx.expr_array_ref(macsp, elements)
471 });
421 assert!(incomplete_lit.is_empty());
472422
473 let arguments = fmt.arguments.all_args();
423 // Zero terminator.
424 bytecode.push(0);
474425
475 if allow_const && arguments.is_empty() && argmap.is_empty() {
476 // Generate:
477 // <core::fmt::Arguments>::new_const(lit_pieces)
478 let new = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
479 macsp,
480 hir::LangItem::FormatArguments,
481 sym::new_const,
482 ));
483 let new_args = ctx.arena.alloc_from_iter([lit_pieces]);
484 return hir::ExprKind::Call(new, new_args);
426 // Ensure all argument indexes actually fit in 16 bits, as we truncated them to 16 bits before.
427 if argmap.len() > u16::MAX as usize {
428 ctx.dcx().span_err(macsp, "too many format arguments");
485429 }
486430
431 let arguments = fmt.arguments.all_args();
432
487433 let (let_statements, args) = if arguments.is_empty() {
488434 // Generate:
489435 // []
......@@ -512,22 +458,30 @@ fn expand_format_args<'hir>(
512458 // ];
513459 let args = ctx.arena.alloc_from_iter(argmap.iter().map(
514460 |(&(arg_index, ty), &placeholder_span)| {
515 let arg = &arguments[arg_index];
516 let placeholder_span =
517 placeholder_span.unwrap_or(arg.expr.span).with_ctxt(macsp.ctxt());
518 let arg_span = match arg.kind {
519 FormatArgumentKind::Captured(_) => placeholder_span,
520 _ => arg.expr.span.with_ctxt(macsp.ctxt()),
521 };
522 let args_ident_expr = ctx.expr_ident(macsp, args_ident, args_hir_id);
523 let arg = ctx.arena.alloc(ctx.expr(
524 arg_span,
525 hir::ExprKind::Field(
526 args_ident_expr,
527 Ident::new(sym::integer(arg_index), macsp),
528 ),
529 ));
530 make_argument(ctx, placeholder_span, arg, ty)
461 if let Some(arg) = arguments.get(arg_index) {
462 let placeholder_span =
463 placeholder_span.unwrap_or(arg.expr.span).with_ctxt(macsp.ctxt());
464 let arg_span = match arg.kind {
465 FormatArgumentKind::Captured(_) => placeholder_span,
466 _ => arg.expr.span.with_ctxt(macsp.ctxt()),
467 };
468 let args_ident_expr = ctx.expr_ident(macsp, args_ident, args_hir_id);
469 let arg = ctx.arena.alloc(ctx.expr(
470 arg_span,
471 hir::ExprKind::Field(
472 args_ident_expr,
473 Ident::new(sym::integer(arg_index), macsp),
474 ),
475 ));
476 make_argument(ctx, placeholder_span, arg, ty)
477 } else {
478 ctx.expr(
479 macsp,
480 hir::ExprKind::Err(
481 ctx.dcx().span_delayed_bug(macsp, "missing format_args argument"),
482 ),
483 )
484 }
531485 },
532486 ));
533487 let args = ctx.arena.alloc(ctx.expr(macsp, hir::ExprKind::Array(args)));
......@@ -540,58 +494,38 @@ fn expand_format_args<'hir>(
540494 };
541495
542496 // Generate:
543 // &args
544 let args = ctx.expr_ref(macsp, args);
545
546 let call = if let Some(format_options) = format_options {
547 // Generate:
548 // unsafe {
549 // <core::fmt::Arguments>::new_v1_formatted(
550 // lit_pieces,
551 // args,
552 // format_options,
553 // )
554 // }
555 let new_v1_formatted = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
556 macsp,
557 hir::LangItem::FormatArguments,
558 sym::new_v1_formatted,
559 ));
560 let args = ctx.arena.alloc_from_iter([lit_pieces, args, format_options]);
561 let call = ctx.expr_call(macsp, new_v1_formatted, args);
562 let hir_id = ctx.next_id();
563 hir::ExprKind::Block(
564 ctx.arena.alloc(hir::Block {
565 stmts: &[],
566 expr: Some(call),
567 hir_id,
568 rules: hir::BlockCheckMode::UnsafeBlock(hir::UnsafeSource::CompilerGenerated),
569 span: macsp,
570 targeted_by_break: false,
571 }),
572 None,
573 )
574 } else {
575 // Generate:
576 // <core::fmt::Arguments>::new_v1(
577 // lit_pieces,
578 // args,
579 // )
580 let new_v1 = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
497 // unsafe {
498 // <core::fmt::Arguments>::new(b"…", &args)
499 // }
500 let template = ctx.expr_byte_str(macsp, ByteSymbol::intern(&bytecode));
501 let call = {
502 let new = ctx.arena.alloc(ctx.expr_lang_item_type_relative(
581503 macsp,
582504 hir::LangItem::FormatArguments,
583 sym::new_v1,
505 sym::new,
584506 ));
585 let new_args = ctx.arena.alloc_from_iter([lit_pieces, args]);
586 hir::ExprKind::Call(new_v1, new_args)
507 let args = ctx.expr_ref(macsp, args);
508 let new_args = ctx.arena.alloc_from_iter([template, args]);
509 ctx.expr_call(macsp, new, new_args)
587510 };
511 let call = hir::ExprKind::Block(
512 ctx.arena.alloc(hir::Block {
513 stmts: &[],
514 expr: Some(call),
515 hir_id: ctx.next_id(),
516 rules: hir::BlockCheckMode::UnsafeBlock(hir::UnsafeSource::CompilerGenerated),
517 span: macsp,
518 targeted_by_break: false,
519 }),
520 None,
521 );
588522
589523 if !let_statements.is_empty() {
590524 // Generate:
591525 // {
592526 // super let …
593527 // super let …
594 // <core::fmt::Arguments>::new_…(…)
528 // <core::fmt::Arguments>::new(…)
595529 // }
596530 let call = ctx.arena.alloc(ctx.expr(macsp, call));
597531 let block = ctx.block_all(macsp, ctx.arena.alloc_from_iter(let_statements), Some(call));
compiler/rustc_hir/src/lang_items.rs-3
......@@ -329,9 +329,6 @@ language_item_table! {
329329 // Lang items needed for `format_args!()`.
330330 FormatArgument, sym::format_argument, format_argument, Target::Struct, GenericRequirement::None;
331331 FormatArguments, sym::format_arguments, format_arguments, Target::Struct, GenericRequirement::None;
332 FormatCount, sym::format_count, format_count, Target::Enum, GenericRequirement::None;
333 FormatPlaceholder, sym::format_placeholder, format_placeholder, Target::Struct, GenericRequirement::None;
334 FormatUnsafeArg, sym::format_unsafe_arg, format_unsafe_arg, Target::Struct, GenericRequirement::None;
335332
336333 ExchangeMalloc, sym::exchange_malloc, exchange_malloc_fn, Target::Fn, GenericRequirement::None;
337334 DropInPlace, sym::drop_in_place, drop_in_place_fn, Target::Fn, GenericRequirement::Minimum(1);
compiler/rustc_span/src/symbol.rs+2-3
......@@ -1096,10 +1096,7 @@ symbols! {
10961096 format_args_nl,
10971097 format_argument,
10981098 format_arguments,
1099 format_count,
11001099 format_macro,
1101 format_placeholder,
1102 format_unsafe_arg,
11031100 framework,
11041101 freeze,
11051102 freeze_impls,
......@@ -1114,7 +1111,9 @@ symbols! {
11141111 from_output,
11151112 from_residual,
11161113 from_size_align_unchecked,
1114 from_str,
11171115 from_str_method,
1116 from_str_nonconst,
11181117 from_u16,
11191118 from_usize,
11201119 from_yeet,
library/core/src/fmt/mod.rs+305-103
......@@ -4,10 +4,12 @@
44
55use crate::cell::{Cell, Ref, RefCell, RefMut, SyncUnsafeCell, UnsafeCell};
66use crate::char::{EscapeDebugExtArgs, MAX_LEN_UTF8};
7use crate::hint::assert_unchecked;
78use crate::marker::{PhantomData, PointeeSized};
89use crate::num::fmt as numfmt;
910use crate::ops::Deref;
10use crate::{iter, result, str};
11use crate::ptr::NonNull;
12use crate::{iter, mem, result, str};
1113
1214mod builders;
1315#[cfg(not(no_fp_fmt_parse))]
......@@ -288,7 +290,7 @@ pub struct FormattingOptions {
288290 /// ```text
289291 /// 31 30 29 28 27 26 25 24 23 22 21 20 0
290292 /// ┌───┬───────┬───┬───┬───┬───┬───┬───┬───┬───┬──────────────────────────────────┐
291 /// │ 1 │ align │ p │ w │ X?│ x?│'0'│ # │ - │ + │ fill │
293 /// │ 0 │ align │ p │ w │ X?│ x?│'0'│ # │ - │ + │ fill │
292294 /// └───┴───────┴───┴───┴───┴───┴───┴───┴───┴───┴──────────────────────────────────┘
293295 /// │ │ │ │ └─┬───────────────────┘ └─┬──────────────────────────────┘
294296 /// │ │ │ │ │ └─ The fill character (21 bits char).
......@@ -299,12 +301,9 @@ pub struct FormattingOptions {
299301 /// │ ├─ 1: Align right. (>)
300302 /// │ ├─ 2: Align center. (^)
301303 /// │ └─ 3: Alignment not set. (default)
302 /// └─ Always set.
303 /// This makes it possible to distinguish formatting flags from
304 /// a &str size when stored in (the upper bits of) the same field.
305 /// (fmt::Arguments will make use of this property in the future.)
304 /// └─ Always zero.
306305 /// ```
307 // Note: This could use a special niche type with range 0x8000_0000..=0xfdd0ffff.
306 // Note: This could use a pattern type with range 0x0000_0000..=0x7dd0ffff.
308307 // It's unclear if that's useful, though.
309308 flags: u32,
310309 /// Width if width flag (bit 27) above is set. Otherwise, always 0.
......@@ -328,7 +327,6 @@ mod flags {
328327 pub(super) const ALIGN_RIGHT: u32 = 1 << 29;
329328 pub(super) const ALIGN_CENTER: u32 = 2 << 29;
330329 pub(super) const ALIGN_UNKNOWN: u32 = 3 << 29;
331 pub(super) const ALWAYS_SET: u32 = 1 << 31;
332330}
333331
334332impl FormattingOptions {
......@@ -344,11 +342,7 @@ impl FormattingOptions {
344342 /// - no [`DebugAsHex`] output mode.
345343 #[unstable(feature = "formatting_options", issue = "118117")]
346344 pub const fn new() -> Self {
347 Self {
348 flags: ' ' as u32 | flags::ALIGN_UNKNOWN | flags::ALWAYS_SET,
349 width: 0,
350 precision: 0,
351 }
345 Self { flags: ' ' as u32 | flags::ALIGN_UNKNOWN, width: 0, precision: 0 }
352346 }
353347
354348 /// Sets or removes the sign (the `+` or the `-` flag).
......@@ -612,19 +606,152 @@ impl<'a> Formatter<'a> {
612606/// ```
613607///
614608/// [`format()`]: ../../std/fmt/fn.format.html
609//
610// Internal representation:
611//
612// fmt::Arguments is represented in one of two ways:
613//
614// 1) String literal representation (e.g. format_args!("hello"))
615// ┌────────────────────────────────┐
616// template: │ *const u8 │ ─â–· "hello"
617// ├──────────────────────────────┬─┤
618// args: │ len │1│ (lowest bit is 1; field contains `len << 1 | 1`)
619// └──────────────────────────────┴─┘
620// In this representation, there are no placeholders and `fmt::Arguments::as_str()` returns Some.
621// The pointer points to the start of a static `str`. The length is given by `args as usize >> 1`.
622// (The length of a `&str` is isize::MAX at most, so it always fits in a usize minus one bit.)
623//
624// `fmt::Arguments::from_str()` constructs this representation from a `&'static str`.
625//
626// 2) Placeholders representation (e.g. format_args!("hello {name}\n"))
627// ┌────────────────────────────────┐
628// template: │ *const u8 │ ─â–· b"\x06hello \x80\x01\n\x00"
629// ├────────────────────────────────┤
630// args: │ &'a [Argument<'a>; _] 0│ (lower bit is 0 due to alignment of Argument type)
631// └────────────────────────────────┘
632// In this representation, the template is a byte sequence encoding both the literal string pieces
633// and the placeholders (including their options/flags).
634//
635// The `args` pointer points to an array of `fmt::Argument<'a>` values, of sufficient length to
636// match the placeholders in the template.
637//
638// `fmt::Arguments::new()` constructs this representation from a template byte slice and a slice
639// of arguments. This function is unsafe, as the template is assumed to be valid and the args
640// slice is assumed to have elements matching the template.
641//
642// The template byte sequence is the concatenation of parts of the following types:
643//
644// - Literal string piece:
645// Pieces that must be formatted verbatim (e.g. "hello " and "\n" in "hello {name}\n")
646// appear literally in the template byte sequence, prefixed by their length.
647//
648// For pieces of up to 127 bytes, these are represented as a single byte containing the
649// length followed directly by the bytes of the string:
650// ┌───┬────────────────────────────┐
651// │len│ `len` bytes (utf-8) │ (e.g. b"\x06hello ")
652// └───┴────────────────────────────┘
653//
654// For larger pieces up to u16::MAX bytes, these are represented as a 0x80 followed by
655// their length in 16-bit little endian, followed by the bytes of the string:
656// ┌────┬─────────┬───────────────────────────┐
657// │0x80│ len │ `len` bytes (utf-8) │ (e.g. b"\x80\x00\x01hello … ")
658// └────┴─────────┴───────────────────────────┘
659//
660// Longer pieces are split into multiple pieces of max u16::MAX bytes (at utf-8 boundaries).
661//
662// - Placeholder:
663// Placeholders (e.g. `{name}` in "hello {name}") are represented as a byte with the highest
664// two bits set, followed by zero or more fields depending on the flags in the first byte:
665// ┌──────────┬┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┄┐
666// │0b11______│ flags ┊ width ┊ precision ┊ arg_index ┊ (e.g. b"\xC2\x05\0")
667// └────││││││┴┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┄┴┄┄┄┄┄┄┄┄┄┄┄┘
668// ││││││ 32 bit 16 bit 16 bit 16 bit
669// │││││└─ flags present
670// ││││└─ width present
671// │││└─ precision present
672// ││└─ arg_index present
673// │└─ width indirect
674// └─ precision indirect
675//
676// All fields other than the first byte are optional and only present when their
677// corresponding flag is set in the first byte.
678//
679// So, a fully default placeholder without any options is just a single byte:
680// ┌──────────┐
681// │0b11000000│ (b"\xC0")
682// └──────────┘
683//
684// The fields are stored as little endian.
685//
686// The `flags` fields corresponds to the `flags` field of `FormattingOptions`.
687// See doc comment of `FormattingOptions::flags` for details.
688//
689// The `width` and `precision` fields correspond to their respective fields in
690// `FormattingOptions`. However, if their "indirect" flag is set, the field contains the
691// index in the `args` array where the dynamic width or precision is stored, rather than the
692// value directly.
693//
694// The `arg_index` field is the index into the `args` array for the argument to be
695// formatted.
696//
697// If omitted, the flags, width and precision of the default FormattingOptions::new() are
698// used.
699//
700// If the `arg_index` is omitted, the next argument in the `args` array is used (starting
701// at 0).
702//
703// - End:
704// A single zero byte marks the end of the template:
705// ┌───┐
706// │ 0 │ ("\0")
707// └───┘
708//
709// (Note that a zero byte may also occur naturally as part of the string pieces or flags,
710// width, precision and arg_index fields above. That is, the template byte sequence ends
711// with a 0 byte, but isn't terminated by the first 0 byte.)
712//
615713#[lang = "format_arguments"]
616714#[stable(feature = "rust1", since = "1.0.0")]
617715#[derive(Copy, Clone)]
618716pub struct Arguments<'a> {
619 // Format string pieces to print.
620 pieces: &'a [&'static str],
717 template: NonNull<u8>,
718 args: NonNull<rt::Argument<'a>>,
719}
720
721/// Used by the format_args!() macro to create a fmt::Arguments object.
722#[doc(hidden)]
723#[rustc_diagnostic_item = "FmtArgumentsNew"]
724#[unstable(feature = "fmt_internals", issue = "none")]
725impl<'a> Arguments<'a> {
726 // SAFETY: The caller must ensure that the provided template and args encode a valid
727 // fmt::Arguments, as documented above.
728 #[inline]
729 pub unsafe fn new<const N: usize, const M: usize>(
730 template: &'a [u8; N],
731 args: &'a [rt::Argument<'a>; M],
732 ) -> Arguments<'a> {
733 // SAFETY: Responsibility of the caller.
734 unsafe { Arguments { template: mem::transmute(template), args: mem::transmute(args) } }
735 }
621736
622 // Placeholder specs, or `None` if all specs are default (as in "{}{}").
623 fmt: Option<&'a [rt::Placeholder]>,
737 #[inline]
738 pub const fn from_str(s: &'static str) -> Arguments<'a> {
739 // SAFETY: This is the "static str" representation of fmt::Arguments; see above.
740 unsafe {
741 Arguments {
742 template: mem::transmute(s.as_ptr()),
743 args: mem::transmute(s.len() << 1 | 1),
744 }
745 }
746 }
624747
625 // Dynamic arguments for interpolation, to be interleaved with string
626 // pieces. (Every argument is preceded by a string piece.)
627 args: &'a [rt::Argument<'a>],
748 // Same as `from_str`, but not const.
749 // Used by format_args!() expansion when arguments are inlined,
750 // e.g. format_args!("{}", 123), which is not allowed in const.
751 #[inline]
752 pub fn from_str_nonconst(s: &'static str) -> Arguments<'a> {
753 Arguments::from_str(s)
754 }
628755}
629756
630757#[doc(hidden)]
......@@ -636,20 +763,56 @@ impl<'a> Arguments<'a> {
636763 /// when using `format!`. Note: this is neither the lower nor upper bound.
637764 #[inline]
638765 pub fn estimated_capacity(&self) -> usize {
639 let pieces_length: usize = self.pieces.iter().map(|x| x.len()).sum();
766 if let Some(s) = self.as_str() {
767 return s.len();
768 }
769 // Iterate over the template, counting the length of literal pieces.
770 let mut length = 0usize;
771 let mut starts_with_placeholder = false;
772 let mut template = self.template;
773 loop {
774 // SAFETY: We can assume the template is valid.
775 unsafe {
776 let n = template.read();
777 template = template.add(1);
778 if n == 0 {
779 // End of template.
780 break;
781 } else if n < 128 {
782 // Short literal string piece.
783 length += n as usize;
784 template = template.add(n as usize);
785 } else if n == 128 {
786 // Long literal string piece.
787 let len = usize::from(u16::from_le_bytes(template.cast_array().read()));
788 length += len;
789 template = template.add(2 + len);
790 } else {
791 assert_unchecked(n >= 0xC0);
792 // Placeholder piece.
793 if length == 0 {
794 starts_with_placeholder = true;
795 }
796 // Skip remainder of placeholder:
797 let skip = (n & 1 != 0) as usize * 4 // flags (32 bit)
798 + (n & 2 != 0) as usize * 2 // width (16 bit)
799 + (n & 4 != 0) as usize * 2 // precision (16 bit)
800 + (n & 8 != 0) as usize * 2; // arg_index (16 bit)
801 template = template.add(skip as usize);
802 }
803 }
804 }
640805
641 if self.args.is_empty() {
642 pieces_length
643 } else if !self.pieces.is_empty() && self.pieces[0].is_empty() && pieces_length < 16 {
644 // If the format string starts with an argument,
806 if starts_with_placeholder && length < 16 {
807 // If the format string starts with a placeholder,
645808 // don't preallocate anything, unless length
646 // of pieces is significant.
809 // of literal pieces is significant.
647810 0
648811 } else {
649 // There are some arguments, so any additional push
812 // There are some placeholders, so any additional push
650813 // will reallocate the string. To avoid that,
651814 // we're "pre-doubling" the capacity here.
652 pieces_length.checked_mul(2).unwrap_or(0)
815 length.wrapping_mul(2)
653816 }
654817 }
655818}
......@@ -702,10 +865,22 @@ impl<'a> Arguments<'a> {
702865 #[must_use]
703866 #[inline]
704867 pub const fn as_str(&self) -> Option<&'static str> {
705 match (self.pieces, self.args) {
706 ([], []) => Some(""),
707 ([s], []) => Some(s),
708 _ => None,
868 // SAFETY: During const eval, `self.args` must have come from a usize,
869 // not a pointer, because that's the only way to create a fmt::Arguments in const.
870 // (I.e. only fmt::Arguments::from_str is const, fmt::Arguments::new is not.)
871 //
872 // Outside const eval, transmuting a pointer to a usize is fine.
873 let bits: usize = unsafe { mem::transmute(self.args) };
874 if bits & 1 == 1 {
875 // SAFETY: This fmt::Arguments stores a &'static str. See encoding documentation above.
876 Some(unsafe {
877 str::from_utf8_unchecked(crate::slice::from_raw_parts(
878 self.template.as_ptr(),
879 bits >> 1,
880 ))
881 })
882 } else {
883 None
709884 }
710885 }
711886
......@@ -1448,86 +1623,113 @@ pub trait UpperExp: PointeeSized {
14481623///
14491624/// [`write!`]: crate::write!
14501625#[stable(feature = "rust1", since = "1.0.0")]
1451pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
1452 let mut formatter = Formatter::new(output, FormattingOptions::new());
1453 let mut idx = 0;
1454
1455 match args.fmt {
1456 None => {
1457 // We can use default formatting parameters for all arguments.
1458 for (i, arg) in args.args.iter().enumerate() {
1459 // SAFETY: args.args and args.pieces come from the same Arguments,
1460 // which guarantees the indexes are always within bounds.
1461 let piece = unsafe { args.pieces.get_unchecked(i) };
1462 if !piece.is_empty() {
1463 formatter.buf.write_str(*piece)?;
1464 }
1465
1466 // SAFETY: There are no formatting parameters and hence no
1467 // count arguments.
1468 unsafe {
1469 arg.fmt(&mut formatter)?;
1470 }
1471 idx += 1;
1472 }
1473 }
1474 Some(fmt) => {
1475 // Every spec has a corresponding argument that is preceded by
1476 // a string piece.
1477 for (i, arg) in fmt.iter().enumerate() {
1478 // SAFETY: fmt and args.pieces come from the same Arguments,
1479 // which guarantees the indexes are always within bounds.
1480 let piece = unsafe { args.pieces.get_unchecked(i) };
1481 if !piece.is_empty() {
1482 formatter.buf.write_str(*piece)?;
1483 }
1484 // SAFETY: arg and args.args come from the same Arguments,
1485 // which guarantees the indexes are always within bounds.
1486 unsafe { run(&mut formatter, arg, args.args) }?;
1487 idx += 1;
1488 }
1489 }
1626pub fn write(output: &mut dyn Write, fmt: Arguments<'_>) -> Result {
1627 if let Some(s) = fmt.as_str() {
1628 return output.write_str(s);
14901629 }
14911630
1492 // There can be only one trailing string piece left.
1493 if let Some(piece) = args.pieces.get(idx) {
1494 formatter.buf.write_str(*piece)?;
1495 }
1631 let mut template = fmt.template;
1632 let args = fmt.args;
14961633
1497 Ok(())
1498}
1634 let mut arg_index = 0;
14991635
1500unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[rt::Argument<'_>]) -> Result {
1501 let (width, precision) =
1502 // SAFETY: arg and args come from the same Arguments,
1503 // which guarantees the indexes are always within bounds.
1504 unsafe { (getcount(args, &arg.width), getcount(args, &arg.precision)) };
1636 // See comment on `fmt::Arguments` for the details of how the template is encoded.
15051637
1506 let options = FormattingOptions { flags: arg.flags, width, precision };
1638 // This must match the encoding from `expand_format_args` in
1639 // compiler/rustc_ast_lowering/src/format.rs.
1640 loop {
1641 // SAFETY: We can assume the template is valid.
1642 let n = unsafe {
1643 let n = template.read();
1644 template = template.add(1);
1645 n
1646 };
15071647
1508 // Extract the correct argument
1509 debug_assert!(arg.position < args.len());
1510 // SAFETY: arg and args come from the same Arguments,
1511 // which guarantees its index is always within bounds.
1512 let value = unsafe { args.get_unchecked(arg.position) };
1648 if n == 0 {
1649 // End of template.
1650 return Ok(());
1651 } else if n < 0x80 {
1652 // Literal string piece of length `n`.
1653
1654 // SAFETY: We can assume the strings in the template are valid.
1655 let s = unsafe {
1656 let s = crate::str::from_raw_parts(template.as_ptr(), n as usize);
1657 template = template.add(n as usize);
1658 s
1659 };
1660 output.write_str(s)?;
1661 } else if n == 0x80 {
1662 // Literal string piece with a 16-bit length.
1663
1664 // SAFETY: We can assume the strings in the template are valid.
1665 let s = unsafe {
1666 let len = usize::from(u16::from_le_bytes(template.cast_array().read()));
1667 template = template.add(2);
1668 let s = crate::str::from_raw_parts(template.as_ptr(), len);
1669 template = template.add(len);
1670 s
1671 };
1672 output.write_str(s)?;
1673 } else if n == 0xC0 {
1674 // Placeholder for next argument with default options.
1675 //
1676 // Having this as a separate case improves performance for the common case.
1677
1678 // SAFETY: We can assume the template only refers to arguments that exist.
1679 unsafe {
1680 args.add(arg_index)
1681 .as_ref()
1682 .fmt(&mut Formatter::new(output, FormattingOptions::new()))?;
1683 }
1684 arg_index += 1;
1685 } else {
1686 // SAFETY: We can assume the template is valid.
1687 unsafe { assert_unchecked(n > 0xC0) };
15131688
1514 // Set all the formatting options.
1515 fmt.options = options;
1689 // Placeholder with custom options.
15161690
1517 // Then actually do some printing
1518 // SAFETY: this is a placeholder argument.
1519 unsafe { value.fmt(fmt) }
1520}
1691 let mut opt = FormattingOptions::new();
15211692
1522unsafe fn getcount(args: &[rt::Argument<'_>], cnt: &rt::Count) -> u16 {
1523 match *cnt {
1524 rt::Count::Is(n) => n,
1525 rt::Count::Implied => 0,
1526 rt::Count::Param(i) => {
1527 debug_assert!(i < args.len());
1528 // SAFETY: cnt and args come from the same Arguments,
1529 // which guarantees this index is always within bounds.
1530 unsafe { args.get_unchecked(i).as_u16().unwrap_unchecked() }
1693 // SAFETY: We can assume the template is valid.
1694 unsafe {
1695 if n & 1 != 0 {
1696 opt.flags = u32::from_le_bytes(template.cast_array().read());
1697 template = template.add(4);
1698 }
1699 if n & 2 != 0 {
1700 opt.width = u16::from_le_bytes(template.cast_array().read());
1701 template = template.add(2);
1702 }
1703 if n & 4 != 0 {
1704 opt.precision = u16::from_le_bytes(template.cast_array().read());
1705 template = template.add(2);
1706 }
1707 if n & 8 != 0 {
1708 arg_index = usize::from(u16::from_le_bytes(template.cast_array().read()));
1709 template = template.add(2);
1710 }
1711 }
1712 if n & 16 != 0 {
1713 // Dynamic width from a usize argument.
1714 // SAFETY: We can assume the template only refers to arguments that exist.
1715 unsafe {
1716 opt.width = args.add(opt.width as usize).as_ref().as_u16().unwrap_unchecked();
1717 }
1718 }
1719 if n & 32 != 0 {
1720 // Dynamic precision from a usize argument.
1721 // SAFETY: We can assume the template only refers to arguments that exist.
1722 unsafe {
1723 opt.precision =
1724 args.add(opt.precision as usize).as_ref().as_u16().unwrap_unchecked();
1725 }
1726 }
1727
1728 // SAFETY: We can assume the template only refers to arguments that exist.
1729 unsafe {
1730 args.add(arg_index).as_ref().fmt(&mut Formatter::new(output, opt))?;
1731 }
1732 arg_index += 1;
15311733 }
15321734 }
15331735}
library/core/src/fmt/rt.rs+1-74
......@@ -10,28 +10,6 @@ use super::*;
1010use crate::hint::unreachable_unchecked;
1111use crate::ptr::NonNull;
1212
13#[lang = "format_placeholder"]
14#[derive(Copy, Clone)]
15pub struct Placeholder {
16 pub position: usize,
17 pub flags: u32,
18 pub precision: Count,
19 pub width: Count,
20}
21
22/// Used by [width](https://doc.rust-lang.org/std/fmt/#width)
23/// and [precision](https://doc.rust-lang.org/std/fmt/#precision) specifiers.
24#[lang = "format_count"]
25#[derive(Copy, Clone)]
26pub enum Count {
27 /// Specified with a literal number, stores the value
28 Is(u16),
29 /// Specified using `$` and `*` syntaxes, stores the index into `args`
30 Param(usize),
31 /// Not specified
32 Implied,
33}
34
3513#[derive(Copy, Clone)]
3614enum ArgumentType<'a> {
3715 Placeholder {
......@@ -56,6 +34,7 @@ enum ArgumentType<'a> {
5634/// precision and width.
5735#[lang = "format_argument"]
5836#[derive(Copy, Clone)]
37#[repr(align(2))] // To ensure pointers to this struct always have their lowest bit cleared.
5938pub struct Argument<'a> {
6039 ty: ArgumentType<'a>,
6140}
......@@ -184,55 +163,3 @@ impl Argument<'_> {
184163 }
185164 }
186165}
187
188/// Used by the format_args!() macro to create a fmt::Arguments object.
189#[doc(hidden)]
190#[unstable(feature = "fmt_internals", issue = "none")]
191#[rustc_diagnostic_item = "FmtArgumentsNew"]
192impl<'a> Arguments<'a> {
193 #[inline]
194 pub const fn new_const<const N: usize>(pieces: &'a [&'static str; N]) -> Self {
195 const { assert!(N <= 1) };
196 Arguments { pieces, fmt: None, args: &[] }
197 }
198
199 /// When using the format_args!() macro, this function is used to generate the
200 /// Arguments structure.
201 ///
202 /// This function should _not_ be const, to make sure we don't accept
203 /// format_args!() and panic!() with arguments in const, even when not evaluated:
204 ///
205 /// ```compile_fail,E0015
206 /// const _: () = if false { panic!("a {}", "a") };
207 /// ```
208 #[inline]
209 pub fn new_v1<const P: usize, const A: usize>(
210 pieces: &'a [&'static str; P],
211 args: &'a [rt::Argument<'a>; A],
212 ) -> Arguments<'a> {
213 const { assert!(P >= A && P <= A + 1, "invalid args") }
214 Arguments { pieces, fmt: None, args }
215 }
216
217 /// Specifies nonstandard formatting parameters.
218 ///
219 /// SAFETY: the following invariants must be held:
220 /// 1. The `pieces` slice must be at least as long as `fmt`.
221 /// 2. Every `rt::Placeholder::position` value within `fmt` must be a valid index of `args`.
222 /// 3. Every `rt::Count::Param` within `fmt` must contain a valid index of `args`.
223 ///
224 /// This function should _not_ be const, to make sure we don't accept
225 /// format_args!() and panic!() with arguments in const, even when not evaluated:
226 ///
227 /// ```compile_fail,E0015
228 /// const _: () = if false { panic!("a {:1}", "a") };
229 /// ```
230 #[inline]
231 pub unsafe fn new_v1_formatted(
232 pieces: &'a [&'static str],
233 args: &'a [rt::Argument<'a>],
234 fmt: &'a [rt::Placeholder],
235 ) -> Arguments<'a> {
236 Arguments { pieces, fmt: Some(fmt), args }
237 }
238}
library/core/src/panicking.rs+8-13
......@@ -136,18 +136,18 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
136136#[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
137137#[lang = "panic"] // used by lints and miri for panics
138138pub const fn panic(expr: &'static str) -> ! {
139 // Use Arguments::new_const instead of format_args!("{expr}") to potentially
139 // Use Arguments::from_str instead of format_args!("{expr}") to potentially
140140 // reduce size overhead. The format_args! macro uses str's Display trait to
141141 // write expr, which calls Formatter::pad, which must accommodate string
142142 // truncation and padding (even though none is used here). Using
143 // Arguments::new_const may allow the compiler to omit Formatter::pad from the
143 // Arguments::from_str may allow the compiler to omit Formatter::pad from the
144144 // output binary, saving up to a few kilobytes.
145 // However, this optimization only works for `'static` strings: `new_const` also makes this
145 // However, this optimization only works for `'static` strings: `from_str` also makes this
146146 // message return `Some` from `Arguments::as_str`, which means it can become part of the panic
147147 // payload without any allocation or copying. Shorter-lived strings would become invalid as
148148 // stack frames get popped during unwinding, and couldn't be directly referenced from the
149149 // payload.
150 panic_fmt(fmt::Arguments::new_const(&[expr]));
150 panic_fmt(fmt::Arguments::from_str(expr));
151151}
152152
153153// We generate functions for usage by compiler-generated assertions.
......@@ -171,13 +171,8 @@ macro_rules! panic_const {
171171 #[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
172172 #[lang = stringify!($lang)]
173173 pub const fn $lang() -> ! {
174 // Use Arguments::new_const instead of format_args!("{expr}") to potentially
175 // reduce size overhead. The format_args! macro uses str's Display trait to
176 // write expr, which calls Formatter::pad, which must accommodate string
177 // truncation and padding (even though none is used here). Using
178 // Arguments::new_const may allow the compiler to omit Formatter::pad from the
179 // output binary, saving up to a few kilobytes.
180 panic_fmt(fmt::Arguments::new_const(&[$message]));
174 // See the comment in `panic(&'static str)` for why we use `Arguments::from_str` here.
175 panic_fmt(fmt::Arguments::from_str($message));
181176 }
182177 )+
183178 }
......@@ -227,7 +222,7 @@ pub mod panic_const {
227222#[rustc_nounwind]
228223#[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable
229224pub const fn panic_nounwind(expr: &'static str) -> ! {
230 panic_nounwind_fmt(fmt::Arguments::new_const(&[expr]), /* force_no_backtrace */ false);
225 panic_nounwind_fmt(fmt::Arguments::from_str(expr), /* force_no_backtrace */ false);
231226}
232227
233228/// Like `panic_nounwind`, but also inhibits showing a backtrace.
......@@ -235,7 +230,7 @@ pub const fn panic_nounwind(expr: &'static str) -> ! {
235230#[cfg_attr(panic = "immediate-abort", inline)]
236231#[rustc_nounwind]
237232pub fn panic_nounwind_nobacktrace(expr: &'static str) -> ! {
238 panic_nounwind_fmt(fmt::Arguments::new_const(&[expr]), /* force_no_backtrace */ true);
233 panic_nounwind_fmt(fmt::Arguments::from_str(expr), /* force_no_backtrace */ true);
239234}
240235
241236#[inline]
library/core/src/ub_checks.rs+1-1
......@@ -70,7 +70,7 @@ macro_rules! assert_unsafe_precondition {
7070 let msg = concat!("unsafe precondition(s) violated: ", $message,
7171 "\n\nThis indicates a bug in the program. \
7272 This Undefined Behavior check is optional, and cannot be relied on for safety.");
73 ::core::panicking::panic_nounwind_fmt(::core::fmt::Arguments::new_const(&[msg]), false);
73 ::core::panicking::panic_nounwind_fmt(::core::fmt::Arguments::from_str(msg), false);
7474 }
7575 }
7676
src/tools/clippy/clippy_utils/src/sym.rs-1
......@@ -166,7 +166,6 @@ generate! {
166166 from_ne_bytes,
167167 from_ptr,
168168 from_raw,
169 from_str,
170169 from_str_radix,
171170 fs,
172171 fuse,
src/tools/clippy/tests/ui/author/macro_in_closure.stdout+9-12
......@@ -30,19 +30,16 @@ if let StmtKind::Let(local) = stmt.kind
3030 && let PatKind::Binding(BindingMode::NONE, _, name1, None) = local2.pat.kind
3131 && name1.as_str() == "args"
3232 && let Some(trailing_expr) = block1.expr
33 && let ExprKind::Call(func2, args2) = trailing_expr.kind
34 && paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
33 && let ExprKind::Block(block2, None) = trailing_expr.kind
34 && block2.stmts.is_empty()
35 && let Some(trailing_expr1) = block2.expr
36 && let ExprKind::Call(func2, args2) = trailing_expr1.kind
37 && paths::CORE_FMT_ARGUMENTS_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
3538 && args2.len() == 2
36 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
37 && let ExprKind::Array(elements2) = inner1.kind
38 && elements2.len() == 2
39 && let ExprKind::Lit(ref lit) = elements2[0].kind
40 && let LitKind::Str(s, _) = lit.node
41 && s.as_str() == ""
42 && let ExprKind::Lit(ref lit1) = elements2[1].kind
43 && let LitKind::Str(s1, _) = lit1.node
44 && s1.as_str() == "\n"
45 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
39 && let ExprKind::Lit(ref lit) = args2[0].kind
40 && let LitKind::ByteStr(ref vec) = lit.node
41 && let [[192, 1, 10, 0]] = **vec
42 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
4643 && block.expr.is_none()
4744 && let PatKind::Binding(BindingMode::NONE, _, name2, None) = local.pat.kind
4845 && name2.as_str() == "print_text"
src/tools/clippy/tests/ui/author/macro_in_loop.stdout+9-12
......@@ -41,19 +41,16 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
4141 && let PatKind::Binding(BindingMode::NONE, _, name2, None) = local1.pat.kind
4242 && name2.as_str() == "args"
4343 && let Some(trailing_expr) = block2.expr
44 && let ExprKind::Call(func2, args2) = trailing_expr.kind
45 && paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
44 && let ExprKind::Block(block3, None) = trailing_expr.kind
45 && block3.stmts.is_empty()
46 && let Some(trailing_expr1) = block3.expr
47 && let ExprKind::Call(func2, args2) = trailing_expr1.kind
48 && paths::CORE_FMT_ARGUMENTS_NEW.matches_path(cx, func2) // Add the path to `clippy_utils::paths` if needed
4649 && args2.len() == 2
47 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[0].kind
48 && let ExprKind::Array(elements2) = inner1.kind
49 && elements2.len() == 2
50 && let ExprKind::Lit(ref lit2) = elements2[0].kind
51 && let LitKind::Str(s, _) = lit2.node
52 && s.as_str() == ""
53 && let ExprKind::Lit(ref lit3) = elements2[1].kind
54 && let LitKind::Str(s1, _) = lit3.node
55 && s1.as_str() == "\n"
56 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner2) = args2[1].kind
50 && let ExprKind::Lit(ref lit2) = args2[0].kind
51 && let LitKind::ByteStr(ref vec) = lit2.node
52 && let [[192, 1, 10, 0]] = **vec
53 && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner1) = args2[1].kind
5754 && block1.expr.is_none()
5855 && block.expr.is_none()
5956{
tests/codegen-units/item-collection/opaque-return-impls.rs+1-1
......@@ -86,4 +86,4 @@ pub fn foo3() -> Box<dyn Iterator<Item = usize>> {
8686//~ MONO_ITEM fn foo3
8787//~ MONO_ITEM fn std::boxed::Box::<Counter>::new
8888//~ MONO_ITEM fn Counter::new
89//~ MONO_ITEM fn core::fmt::rt::<impl std::fmt::Arguments<'_>>::new_const::<1>
89//~ MONO_ITEM fn std::fmt::Arguments::<'_>::from_str
tests/coverage/abort.cov-map+2-3
......@@ -37,16 +37,15 @@ Number of file 0 mappings: 16
3737Highest counter ID seen: c4
3838
3939Function name: abort::might_abort
40Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 03, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 00, 12, 00, 1f, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02]
40Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 03, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02]
4141Number of files: 1
4242- file 0 => $DIR/abort.rs
4343Number of expressions: 1
4444- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
45Number of file 0 mappings: 7
45Number of file 0 mappings: 6
4646- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 46)
4747- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20)
4848- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
49- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 31)
5049- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15)
5150- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6)
5251 = (c0 - c1)
tests/coverage/assert.cov-map+3-7
......@@ -29,18 +29,14 @@ Number of file 0 mappings: 12
2929Highest counter ID seen: c3
3030
3131Function name: assert::might_fail_assert
32Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 01, 01, 05, 00, 0f, 02, 00, 25, 00, 3d, 05, 01, 01, 00, 02]
32Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 05, 01, 01, 00, 02]
3333Number of files: 1
3434- file 0 => $DIR/assert.rs
35Number of expressions: 1
36- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
37Number of file 0 mappings: 6
35Number of expressions: 0
36Number of file 0 mappings: 4
3837- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40)
3938- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
40- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32)
4139- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
42- Code(Expression(0, Sub)) at (prev + 0, 37) to (start + 0, 61)
43 = (c0 - c1)
4440- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2)
4541Highest counter ID seen: c1
4642
tests/coverage/assert.coverage-1
......@@ -4,7 +4,6 @@
44 LL| 4|fn might_fail_assert(one_plus_one: u32) {
55 LL| 4| println!("does 1 + 1 = {}?", one_plus_one);
66 LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong");
7 ^1
87 LL| 3|}
98 LL| |
109 LL| 1|fn main() -> Result<(), u8> {
tests/coverage/async2.cov-map+8-12
......@@ -8,14 +8,13 @@ Number of file 0 mappings: 1
88Highest counter ID seen: c0
99
1010Function name: async2::async_func::{closure#0}
11Raw bytes (49): 0x[01, 01, 00, 09, 01, 0f, 17, 00, 18, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 26, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
11Raw bytes (44): 0x[01, 01, 00, 08, 01, 0f, 17, 00, 18, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
1212Number of files: 1
1313- file 0 => $DIR/async2.rs
1414Number of expressions: 0
15Number of file 0 mappings: 9
15Number of file 0 mappings: 8
1616- Code(Counter(0)) at (prev + 15, 23) to (start + 0, 24)
1717- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
18- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 38)
1918- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10)
2019- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17)
2120- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9)
......@@ -34,26 +33,24 @@ Number of file 0 mappings: 1
3433Highest counter ID seen: c0
3534
3635Function name: async2::async_func_just_println::{closure#0}
37Raw bytes (24): 0x[01, 01, 00, 04, 01, 17, 24, 00, 25, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 33, 01, 01, 01, 00, 02]
36Raw bytes (19): 0x[01, 01, 00, 03, 01, 17, 24, 00, 25, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
3837Number of files: 1
3938- file 0 => $DIR/async2.rs
4039Number of expressions: 0
41Number of file 0 mappings: 4
40Number of file 0 mappings: 3
4241- Code(Counter(0)) at (prev + 23, 36) to (start + 0, 37)
4342- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
44- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 51)
4543- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
4644Highest counter ID seen: c0
4745
4846Function name: async2::main
49Raw bytes (49): 0x[01, 01, 00, 09, 01, 1b, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 23, 01, 02, 05, 00, 13, 01, 02, 05, 00, 17, 01, 00, 18, 00, 22, 01, 01, 05, 00, 17, 01, 00, 18, 00, 2f, 01, 01, 01, 00, 02]
47Raw bytes (44): 0x[01, 01, 00, 08, 01, 1b, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 13, 01, 02, 05, 00, 17, 01, 00, 18, 00, 22, 01, 01, 05, 00, 17, 01, 00, 18, 00, 2f, 01, 01, 01, 00, 02]
5048Number of files: 1
5149- file 0 => $DIR/async2.rs
5250Number of expressions: 0
53Number of file 0 mappings: 9
51Number of file 0 mappings: 8
5452- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 10)
5553- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
56- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 35)
5754- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 19)
5855- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 23)
5956- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 34)
......@@ -63,14 +60,13 @@ Number of file 0 mappings: 9
6360Highest counter ID seen: c0
6461
6562Function name: async2::non_async_func
66Raw bytes (49): 0x[01, 01, 00, 09, 01, 07, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 2a, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
63Raw bytes (44): 0x[01, 01, 00, 08, 01, 07, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02]
6764Number of files: 1
6865- file 0 => $DIR/async2.rs
6966Number of expressions: 0
70Number of file 0 mappings: 9
67Number of file 0 mappings: 8
7168- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 20)
7269- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
73- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 42)
7470- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10)
7571- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17)
7672- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9)
tests/coverage/attr/trait-impl-inherit.cov-map+2-3
......@@ -1,12 +1,11 @@
11Function name: <trait_impl_inherit::S as trait_impl_inherit::T>::f
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06]
33Number of files: 1
44- file 0 => $DIR/trait-impl-inherit.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 16)
88- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
9- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26)
109- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
1110Highest counter ID seen: c0
1211
tests/coverage/bad_counter_ids.cov-map+16-28
......@@ -1,108 +1,96 @@
11Function name: bad_counter_ids::eq_bad
2Raw bytes (29): 0x[01, 01, 00, 05, 01, 24, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 24, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/bad_counter_ids.rs
55Number of expressions: 0
6Number of file 0 mappings: 5
6Number of file 0 mappings: 4
77- Code(Counter(0)) at (prev + 36, 1) to (start + 0, 12)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
109- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
1110- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
1211Highest counter ID seen: c0
1312
1413Function name: bad_counter_ids::eq_bad_message
15Raw bytes (34): 0x[01, 01, 00, 06, 01, 29, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 20, 00, 2b, 00, 01, 01, 00, 02]
14Raw bytes (24): 0x[01, 01, 00, 04, 01, 29, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
1615Number of files: 1
1716- file 0 => $DIR/bad_counter_ids.rs
1817Number of expressions: 0
19Number of file 0 mappings: 6
18Number of file 0 mappings: 4
2019- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 20)
2120- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
22- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
2321- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
24- Code(Counter(0)) at (prev + 0, 32) to (start + 0, 43)
2522- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
2623Highest counter ID seen: c0
2724
2825Function name: bad_counter_ids::eq_good
29Raw bytes (29): 0x[01, 01, 00, 05, 01, 10, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
26Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
3027Number of files: 1
3128- file 0 => $DIR/bad_counter_ids.rs
3229Number of expressions: 0
33Number of file 0 mappings: 5
30Number of file 0 mappings: 4
3431- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 13)
3532- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
36- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
3733- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
3834- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
3935Highest counter ID seen: c0
4036
4137Function name: bad_counter_ids::eq_good_message
42Raw bytes (34): 0x[01, 01, 00, 06, 01, 15, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 00, 00, 20, 00, 2b, 01, 01, 01, 00, 02]
38Raw bytes (24): 0x[01, 01, 00, 04, 01, 15, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
4339Number of files: 1
4440- file 0 => $DIR/bad_counter_ids.rs
4541Number of expressions: 0
46Number of file 0 mappings: 6
42Number of file 0 mappings: 4
4743- Code(Counter(0)) at (prev + 21, 1) to (start + 0, 21)
4844- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
49- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
5045- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
51- Code(Zero) at (prev + 0, 32) to (start + 0, 43)
5246- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
5347Highest counter ID seen: c0
5448
5549Function name: bad_counter_ids::ne_bad
56Raw bytes (29): 0x[01, 01, 00, 05, 01, 2e, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
50Raw bytes (24): 0x[01, 01, 00, 04, 01, 2e, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
5751Number of files: 1
5852- file 0 => $DIR/bad_counter_ids.rs
5953Number of expressions: 0
60Number of file 0 mappings: 5
54Number of file 0 mappings: 4
6155- Code(Counter(0)) at (prev + 46, 1) to (start + 0, 12)
6256- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
63- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
6457- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
6558- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
6659Highest counter ID seen: c0
6760
6861Function name: bad_counter_ids::ne_bad_message
69Raw bytes (34): 0x[01, 01, 00, 06, 01, 33, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 20, 00, 2b, 00, 01, 01, 00, 02]
62Raw bytes (24): 0x[01, 01, 00, 04, 01, 33, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02]
7063Number of files: 1
7164- file 0 => $DIR/bad_counter_ids.rs
7265Number of expressions: 0
73Number of file 0 mappings: 6
66Number of file 0 mappings: 4
7467- Code(Counter(0)) at (prev + 51, 1) to (start + 0, 20)
7568- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
76- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
7769- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
78- Code(Counter(0)) at (prev + 0, 32) to (start + 0, 43)
7970- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
8071Highest counter ID seen: c0
8172
8273Function name: bad_counter_ids::ne_good
83Raw bytes (29): 0x[01, 01, 00, 05, 01, 1a, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
74Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
8475Number of files: 1
8576- file 0 => $DIR/bad_counter_ids.rs
8677Number of expressions: 0
87Number of file 0 mappings: 5
78Number of file 0 mappings: 4
8879- Code(Counter(0)) at (prev + 26, 1) to (start + 0, 13)
8980- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
90- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
9181- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
9282- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
9383Highest counter ID seen: c0
9484
9585Function name: bad_counter_ids::ne_good_message
96Raw bytes (34): 0x[01, 01, 00, 06, 01, 1f, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 00, 00, 20, 00, 2b, 01, 01, 01, 00, 02]
86Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02]
9787Number of files: 1
9888- file 0 => $DIR/bad_counter_ids.rs
9989Number of expressions: 0
100Number of file 0 mappings: 6
90Number of file 0 mappings: 4
10191- Code(Counter(0)) at (prev + 31, 1) to (start + 0, 21)
10292- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
103- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17)
10493- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
105- Code(Zero) at (prev + 0, 32) to (start + 0, 43)
10694- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
10795Highest counter ID seen: c0
10896
tests/coverage/bad_counter_ids.coverage-2
......@@ -21,7 +21,6 @@
2121 LL| 1|fn eq_good_message() {
2222 LL| 1| println!("b");
2323 LL| 1| assert_eq!(Foo(1), Foo(1), "message b");
24 ^0
2524 LL| 1|}
2625 LL| |
2726 LL| 1|fn ne_good() {
......@@ -32,7 +31,6 @@
3231 LL| 1|fn ne_good_message() {
3332 LL| 1| println!("d");
3433 LL| 1| assert_ne!(Foo(1), Foo(3), "message d");
35 ^0
3634 LL| 1|}
3735 LL| |
3836 LL| 1|fn eq_bad() {
tests/coverage/closure.cov-map+39-58
......@@ -1,10 +1,10 @@
11Function name: closure::main
2Raw bytes (336): 0x[01, 01, 01, 01, 05, 42, 01, 09, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 11, 01, 00, 14, 00, 1c, 01, 02, 09, 00, 18, 01, 00, 1b, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 20, 01, 02, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 3b, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 01, 09, 00, 20, 01, 02, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 04, 05, 00, 10, 01, 00, 13, 00, 17, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 20, 01, 02, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 17, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 01, 09, 00, 20, 01, 02, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 05, 09, 00, 16, 01, 0a, 05, 00, 0d, 01, 01, 09, 00, 28, 01, 02, 09, 00, 1a, 01, 01, 0e, 00, 12, 01, 01, 0e, 00, 11, 01, 02, 0d, 00, 1a, 01, 02, 0e, 00, 15, 01, 04, 09, 00, 18, 01, 0c, 09, 00, 16, 01, 00, 19, 00, 1b, 01, 01, 09, 00, 1e, 01, 03, 09, 00, 29, 01, 01, 09, 00, 2d, 01, 01, 09, 00, 24, 01, 05, 09, 00, 24, 01, 02, 09, 00, 21, 01, 04, 09, 00, 21, 01, 04, 09, 00, 28, 01, 09, 09, 00, 32, 01, 04, 09, 00, 33, 01, 07, 09, 00, 4b, 01, 08, 09, 00, 48, 01, 0a, 09, 00, 47, 01, 08, 09, 00, 44, 01, 0a, 08, 00, 10, 05, 00, 11, 04, 06, 05, 01, 09, 00, 30, 02, 03, 05, 00, 06, 01, 01, 05, 00, 28, 01, 01, 05, 00, 46, 01, 01, 05, 00, 43, 01, 01, 01, 00, 02]
2Raw bytes (311): 0x[01, 01, 01, 01, 05, 3d, 01, 09, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 11, 01, 00, 14, 00, 1c, 01, 02, 09, 00, 18, 01, 00, 1b, 00, 43, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 3b, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 04, 05, 00, 10, 01, 00, 13, 00, 17, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 17, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 05, 09, 00, 16, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 1a, 01, 01, 0e, 00, 12, 01, 01, 0e, 00, 11, 01, 02, 0d, 00, 1a, 01, 02, 0e, 00, 15, 01, 04, 09, 00, 18, 01, 0c, 09, 00, 16, 01, 00, 19, 00, 1b, 01, 01, 09, 00, 1e, 01, 03, 09, 00, 29, 01, 01, 09, 00, 2d, 01, 01, 09, 00, 24, 01, 05, 09, 00, 24, 01, 02, 09, 00, 21, 01, 04, 09, 00, 21, 01, 04, 09, 00, 28, 01, 09, 09, 00, 32, 01, 04, 09, 00, 33, 01, 07, 09, 00, 4b, 01, 08, 09, 00, 48, 01, 0a, 09, 00, 47, 01, 08, 09, 00, 44, 01, 0a, 08, 00, 10, 05, 00, 11, 04, 06, 05, 01, 09, 00, 30, 02, 03, 05, 00, 06, 01, 01, 05, 00, 28, 01, 01, 05, 00, 46, 01, 01, 05, 00, 43, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/closure.rs
55Number of expressions: 1
66- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
7Number of file 0 mappings: 66
7Number of file 0 mappings: 61
88- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 10)
99- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16)
1010- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46)
......@@ -13,35 +13,30 @@ Number of file 0 mappings: 66
1313- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 24)
1414- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 67)
1515- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
16- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 32)
17- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 20)
16- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20)
1817- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27)
1918- Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16)
2019- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 59)
2120- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
2221- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13)
23- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 32)
24- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 20)
22- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20)
2523- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27)
2624- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14)
2725- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 16)
2826- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23)
2927- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
30- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 32)
31- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 20)
28- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20)
3229- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27)
3330- Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16)
3431- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23)
3532- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
3633- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13)
37- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 32)
38- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 20)
34- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20)
3935- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27)
4036- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14)
4137- Code(Counter(0)) at (prev + 5, 9) to (start + 0, 22)
4238- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13)
43- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 40)
44- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 26)
39- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 26)
4540- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 18)
4641- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 17)
4742- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 26)
......@@ -94,74 +89,68 @@ Number of file 0 mappings: 9
9489Highest counter ID seen: c1
9590
9691Function name: closure::main::{closure#10} (unused)
97Raw bytes (25): 0x[01, 01, 00, 04, 00, 9b, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 00, 20, 00, 21]
92Raw bytes (20): 0x[01, 01, 00, 03, 00, 9b, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21]
9893Number of files: 1
9994- file 0 => $DIR/closure.rs
10095Number of expressions: 0
101Number of file 0 mappings: 4
96Number of file 0 mappings: 3
10297- Code(Zero) at (prev + 155, 7) to (start + 0, 8)
10398- Code(Zero) at (prev + 0, 9) to (start + 0, 17)
104- Code(Zero) at (prev + 0, 18) to (start + 0, 30)
10599- Code(Zero) at (prev + 0, 32) to (start + 0, 33)
106100Highest counter ID seen: (none)
107101
108102Function name: closure::main::{closure#11} (unused)
109Raw bytes (25): 0x[01, 01, 00, 04, 00, 9f, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 00, 20, 00, 21]
103Raw bytes (20): 0x[01, 01, 00, 03, 00, 9f, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21]
110104Number of files: 1
111105- file 0 => $DIR/closure.rs
112106Number of expressions: 0
113Number of file 0 mappings: 4
107Number of file 0 mappings: 3
114108- Code(Zero) at (prev + 159, 7) to (start + 0, 8)
115109- Code(Zero) at (prev + 0, 9) to (start + 0, 17)
116- Code(Zero) at (prev + 0, 18) to (start + 0, 30)
117110- Code(Zero) at (prev + 0, 32) to (start + 0, 33)
118111Highest counter ID seen: (none)
119112
120113Function name: closure::main::{closure#12} (unused)
121Raw bytes (15): 0x[01, 01, 00, 02, 00, a7, 01, 01, 00, 09, 00, 00, 0a, 00, 16]
114Raw bytes (10): 0x[01, 01, 00, 01, 00, a7, 01, 01, 00, 09]
122115Number of files: 1
123116- file 0 => $DIR/closure.rs
124117Number of expressions: 0
125Number of file 0 mappings: 2
118Number of file 0 mappings: 1
126119- Code(Zero) at (prev + 167, 1) to (start + 0, 9)
127- Code(Zero) at (prev + 0, 10) to (start + 0, 22)
128120Highest counter ID seen: (none)
129121
130122Function name: closure::main::{closure#13} (unused)
131Raw bytes (15): 0x[01, 01, 00, 02, 00, ac, 01, 0d, 00, 15, 00, 01, 11, 00, 1d]
123Raw bytes (10): 0x[01, 01, 00, 01, 00, ac, 01, 0d, 00, 15]
132124Number of files: 1
133125- file 0 => $DIR/closure.rs
134126Number of expressions: 0
135Number of file 0 mappings: 2
127Number of file 0 mappings: 1
136128- Code(Zero) at (prev + 172, 13) to (start + 0, 21)
137- Code(Zero) at (prev + 1, 17) to (start + 0, 29)
138129Highest counter ID seen: (none)
139130
140131Function name: closure::main::{closure#14}
141Raw bytes (27): 0x[01, 01, 01, 01, 05, 04, 01, b4, 01, 11, 00, 21, 01, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33]
132Raw bytes (22): 0x[01, 01, 01, 01, 05, 03, 01, b5, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33]
142133Number of files: 1
143134- file 0 => $DIR/closure.rs
144135Number of expressions: 1
145136- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
146Number of file 0 mappings: 4
147- Code(Counter(0)) at (prev + 180, 17) to (start + 0, 33)
148- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 27)
137Number of file 0 mappings: 3
138- Code(Counter(0)) at (prev + 181, 20) to (start + 0, 27)
149139- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37)
150140- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51)
151141 = (c0 - c1)
152142Highest counter ID seen: c1
153143
154144Function name: closure::main::{closure#15}
155Raw bytes (42): 0x[01, 01, 01, 01, 05, 07, 01, bb, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 01, 11, 00, 21, 01, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a]
145Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, bb, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a]
156146Number of files: 1
157147- file 0 => $DIR/closure.rs
158148Number of expressions: 1
159149- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
160Number of file 0 mappings: 7
150Number of file 0 mappings: 6
161151- Code(Counter(0)) at (prev + 187, 9) to (start + 0, 10)
162152- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21)
163- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 33)
164- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 27)
153- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27)
165154- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37)
166155- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51)
167156 = (c0 - c1)
......@@ -169,30 +158,28 @@ Number of file 0 mappings: 7
169158Highest counter ID seen: c1
170159
171160Function name: closure::main::{closure#16}
172Raw bytes (27): 0x[01, 01, 01, 01, 05, 04, 01, c6, 01, 11, 00, 21, 01, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33]
161Raw bytes (22): 0x[01, 01, 01, 01, 05, 03, 01, c7, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33]
173162Number of files: 1
174163- file 0 => $DIR/closure.rs
175164Number of expressions: 1
176165- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
177Number of file 0 mappings: 4
178- Code(Counter(0)) at (prev + 198, 17) to (start + 0, 33)
179- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 27)
166Number of file 0 mappings: 3
167- Code(Counter(0)) at (prev + 199, 20) to (start + 0, 27)
180168- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37)
181169- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51)
182170 = (c0 - c1)
183171Highest counter ID seen: c1
184172
185173Function name: closure::main::{closure#17}
186Raw bytes (42): 0x[01, 01, 01, 01, 05, 07, 01, cd, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 01, 11, 00, 21, 01, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a]
174Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, cd, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a]
187175Number of files: 1
188176- file 0 => $DIR/closure.rs
189177Number of expressions: 1
190178- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
191Number of file 0 mappings: 7
179Number of file 0 mappings: 6
192180- Code(Counter(0)) at (prev + 205, 9) to (start + 0, 10)
193181- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21)
194- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 33)
195- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 27)
182- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27)
196183- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37)
197184- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51)
198185 = (c0 - c1)
......@@ -257,12 +244,12 @@ Number of file 0 mappings: 9
257244Highest counter ID seen: c1
258245
259246Function name: closure::main::{closure#2}
260Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 68, 05, 00, 06, 01, 01, 0d, 00, 1a, 01, 00, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 11, 00, 17, 01, 01, 05, 00, 06]
247Raw bytes (46): 0x[01, 01, 01, 01, 05, 08, 01, 68, 05, 00, 06, 01, 01, 0d, 00, 1a, 01, 00, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 10, 01, 01, 05, 00, 06]
261248Number of files: 1
262249- file 0 => $DIR/closure.rs
263250Number of expressions: 1
264251- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
265Number of file 0 mappings: 9
252Number of file 0 mappings: 8
266253- Code(Counter(0)) at (prev + 104, 5) to (start + 0, 6)
267254- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 26)
268255- Code(Counter(0)) at (prev + 0, 29) to (start + 0, 30)
......@@ -271,7 +258,6 @@ Number of file 0 mappings: 9
271258- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10)
272259 = (c0 - c1)
273260- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16)
274- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 23)
275261- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
276262Highest counter ID seen: c1
277263
......@@ -291,56 +277,51 @@ Number of file 0 mappings: 7
291277Highest counter ID seen: (none)
292278
293279Function name: closure::main::{closure#5}
294Raw bytes (15): 0x[01, 01, 00, 02, 01, 8c, 01, 3d, 00, 45, 01, 00, 46, 00, 4e]
280Raw bytes (10): 0x[01, 01, 00, 01, 01, 8c, 01, 3d, 00, 45]
295281Number of files: 1
296282- file 0 => $DIR/closure.rs
297283Number of expressions: 0
298Number of file 0 mappings: 2
284Number of file 0 mappings: 1
299285- Code(Counter(0)) at (prev + 140, 61) to (start + 0, 69)
300- Code(Counter(0)) at (prev + 0, 70) to (start + 0, 78)
301286Highest counter ID seen: c0
302287
303288Function name: closure::main::{closure#6}
304Raw bytes (15): 0x[01, 01, 00, 02, 01, 8d, 01, 41, 00, 49, 01, 00, 4a, 00, 56]
289Raw bytes (10): 0x[01, 01, 00, 01, 01, 8d, 01, 41, 00, 49]
305290Number of files: 1
306291- file 0 => $DIR/closure.rs
307292Number of expressions: 0
308Number of file 0 mappings: 2
293Number of file 0 mappings: 1
309294- Code(Counter(0)) at (prev + 141, 65) to (start + 0, 73)
310- Code(Counter(0)) at (prev + 0, 74) to (start + 0, 86)
311295Highest counter ID seen: c0
312296
313297Function name: closure::main::{closure#7} (unused)
314Raw bytes (15): 0x[01, 01, 00, 02, 00, 8e, 01, 3b, 00, 43, 00, 00, 44, 00, 50]
298Raw bytes (10): 0x[01, 01, 00, 01, 00, 8e, 01, 3b, 00, 43]
315299Number of files: 1
316300- file 0 => $DIR/closure.rs
317301Number of expressions: 0
318Number of file 0 mappings: 2
302Number of file 0 mappings: 1
319303- Code(Zero) at (prev + 142, 59) to (start + 0, 67)
320- Code(Zero) at (prev + 0, 68) to (start + 0, 80)
321304Highest counter ID seen: (none)
322305
323306Function name: closure::main::{closure#8} (unused)
324Raw bytes (25): 0x[01, 01, 00, 04, 00, 93, 01, 3b, 00, 3c, 00, 00, 3d, 00, 45, 00, 00, 46, 00, 52, 00, 00, 54, 00, 55]
307Raw bytes (20): 0x[01, 01, 00, 03, 00, 93, 01, 3b, 00, 3c, 00, 00, 3d, 00, 45, 00, 00, 54, 00, 55]
325308Number of files: 1
326309- file 0 => $DIR/closure.rs
327310Number of expressions: 0
328Number of file 0 mappings: 4
311Number of file 0 mappings: 3
329312- Code(Zero) at (prev + 147, 59) to (start + 0, 60)
330313- Code(Zero) at (prev + 0, 61) to (start + 0, 69)
331- Code(Zero) at (prev + 0, 70) to (start + 0, 82)
332314- Code(Zero) at (prev + 0, 84) to (start + 0, 85)
333315Highest counter ID seen: (none)
334316
335317Function name: closure::main::{closure#9} (unused)
336Raw bytes (25): 0x[01, 01, 00, 04, 00, 95, 01, 38, 00, 39, 00, 01, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 01, 05, 00, 06]
318Raw bytes (20): 0x[01, 01, 00, 03, 00, 95, 01, 38, 00, 39, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06]
337319Number of files: 1
338320- file 0 => $DIR/closure.rs
339321Number of expressions: 0
340Number of file 0 mappings: 4
322Number of file 0 mappings: 3
341323- Code(Zero) at (prev + 149, 56) to (start + 0, 57)
342324- Code(Zero) at (prev + 1, 9) to (start + 0, 17)
343- Code(Zero) at (prev + 0, 18) to (start + 0, 30)
344325- Code(Zero) at (prev + 1, 5) to (start + 0, 6)
345326Highest counter ID seen: (none)
346327
tests/coverage/closure.coverage+13-13
......@@ -15,7 +15,7 @@
1515 LL| |
1616 LL| 1| let mut some_string = Some(String::from("the string content"));
1717 LL| 1| println!(
18 LL| 1| "The string or alt: {}"
18 LL| | "The string or alt: {}"
1919 LL| | ,
2020 LL| 1| some_string
2121 LL| | .
......@@ -45,7 +45,7 @@
4545 LL| 0| "alt string 2".to_owned()
4646 LL| 0| };
4747 LL| 1| println!(
48 LL| 1| "The string or alt: {}"
48 LL| | "The string or alt: {}"
4949 LL| | ,
5050 LL| 1| some_string
5151 LL| | .
......@@ -57,7 +57,7 @@
5757 LL| |
5858 LL| 1| some_string = None;
5959 LL| 1| println!(
60 LL| 1| "The string or alt: {}"
60 LL| | "The string or alt: {}"
6161 LL| | ,
6262 LL| 1| some_string
6363 LL| | .
......@@ -87,7 +87,7 @@
8787 LL| 1| "alt string 4".to_owned()
8888 LL| 1| };
8989 LL| 1| println!(
90 LL| 1| "The string or alt: {}"
90 LL| | "The string or alt: {}"
9191 LL| | ,
9292 LL| 1| some_string
9393 LL| | .
......@@ -109,7 +109,7 @@
109109 LL| 5| format!("'{}'", val)
110110 LL| 5| };
111111 LL| 1| println!(
112 LL| 1| "Repeated, quoted string: {:?}"
112 LL| | "Repeated, quoted string: {:?}"
113113 LL| | ,
114114 LL| 1| std::iter::repeat("repeat me")
115115 LL| 1| .take(5)
......@@ -139,15 +139,15 @@
139139 LL| |
140140 LL| 1| let short_used_covered_closure_macro = | used_arg: u8 | println!("called");
141141 LL| 1| let short_used_not_covered_closure_macro = | used_arg: u8 | println!("not called");
142 ^0 ^0
142 ^0
143143 LL| 1| let _short_unused_closure_macro = | _unused_arg: u8 | println!("not called");
144 ^0 ^0
144 ^0
145145 LL| |
146146 LL| |
147147 LL| |
148148 LL| |
149149 LL| 1| let _short_unused_closure_block = | _unused_arg: u8 | { println!("not called") };
150 ^0^0 ^0 ^0
150 ^0^0 ^0
151151 LL| |
152152 LL| 1| let _shortish_unused_closure = | _unused_arg: u8 | {
153153 ^0
......@@ -174,14 +174,14 @@
174174 LL| 1| let _short_unused_closure_line_break_no_block2 =
175175 LL| | | _unused_arg: u8 |
176176 LL| 0| println!(
177 LL| 0| "not called"
177 LL| | "not called"
178178 LL| | )
179179 LL| | ;
180180 LL| |
181181 LL| 1| let short_used_not_covered_closure_line_break_no_block_embedded_branch =
182182 LL| | | _unused_arg: u8 |
183183 LL| | println!(
184 LL| 0| "not called: {}",
184 LL| | "not called: {}",
185185 LL| 0| if is_true { "check" } else { "me" }
186186 LL| | )
187187 LL| | ;
......@@ -190,7 +190,7 @@
190190 LL| | | _unused_arg: u8 |
191191 LL| 0| {
192192 LL| 0| println!(
193 LL| 0| "not called: {}",
193 LL| | "not called: {}",
194194 LL| 0| if is_true { "check" } else { "me" }
195195 LL| | )
196196 LL| 0| }
......@@ -199,7 +199,7 @@
199199 LL| 1| let short_used_covered_closure_line_break_no_block_embedded_branch =
200200 LL| | | _unused_arg: u8 |
201201 LL| | println!(
202 LL| 1| "not called: {}",
202 LL| | "not called: {}",
203203 LL| 1| if is_true { "check" } else { "me" }
204204 ^0
205205 LL| | )
......@@ -209,7 +209,7 @@
209209 LL| | | _unused_arg: u8 |
210210 LL| 1| {
211211 LL| 1| println!(
212 LL| 1| "not called: {}",
212 LL| | "not called: {}",
213213 LL| 1| if is_true { "check" } else { "me" }
214214 ^0
215215 LL| | )
tests/coverage/closure_macro.cov-map+7-11
......@@ -10,15 +10,14 @@ Number of file 0 mappings: 3
1010Highest counter ID seen: c0
1111
1212Function name: closure_macro::main
13Raw bytes (66): 0x[01, 01, 01, 01, 05, 0c, 01, 21, 01, 00, 24, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
13Raw bytes (61): 0x[01, 01, 01, 01, 05, 0b, 01, 21, 01, 00, 24, 01, 01, 05, 00, 0d, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
1414Number of files: 1
1515- file 0 => $DIR/closure_macro.rs
1616Number of expressions: 1
1717- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
18Number of file 0 mappings: 12
18Number of file 0 mappings: 11
1919- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 36)
2020- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
21- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32)
2221- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15)
2322 = (c0 - c1)
2423- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27)
......@@ -36,25 +35,22 @@ Number of file 0 mappings: 12
3635Highest counter ID seen: c1
3736
3837Function name: closure_macro::main::{closure#0}
39Raw bytes (60): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0a, 01, 10, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 1e, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 06, 00, 17, 00, 1e, 01, 02, 09, 00, 0a]
38Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 10, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a]
4039Number of files: 1
4140- file 0 => $DIR/closure_macro.rs
42Number of expressions: 3
41Number of expressions: 1
4342- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
44- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add)
45- expression 2 operands: lhs = Counter(1), rhs = Counter(2)
46Number of file 0 mappings: 10
43Number of file 0 mappings: 9
4744- Code(Counter(0)) at (prev + 16, 28) to (start + 0, 29)
4845- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24)
4946- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34)
5047- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33)
5148- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25)
52- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 30)
5349- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39)
5450- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22)
5551 = (c0 - c1)
56- Code(Expression(1, Sub)) at (prev + 0, 23) to (start + 0, 30)
57 = (c0 - (c1 + c2))
52- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 30)
53 = (c0 - c1)
5854- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
5955Highest counter ID seen: c1
6056
tests/coverage/closure_macro_async.cov-map+7-11
......@@ -19,15 +19,14 @@ Number of file 0 mappings: 1
1919Highest counter ID seen: c0
2020
2121Function name: closure_macro_async::test::{closure#0}
22Raw bytes (66): 0x[01, 01, 01, 01, 05, 0c, 01, 25, 2b, 00, 2c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
22Raw bytes (61): 0x[01, 01, 01, 01, 05, 0b, 01, 25, 2b, 00, 2c, 01, 01, 05, 00, 0d, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
2323Number of files: 1
2424- file 0 => $DIR/closure_macro_async.rs
2525Number of expressions: 1
2626- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
27Number of file 0 mappings: 12
27Number of file 0 mappings: 11
2828- Code(Counter(0)) at (prev + 37, 43) to (start + 0, 44)
2929- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
30- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32)
3130- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15)
3231 = (c0 - c1)
3332- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27)
......@@ -45,25 +44,22 @@ Number of file 0 mappings: 12
4544Highest counter ID seen: c1
4645
4746Function name: closure_macro_async::test::{closure#0}::{closure#0}
48Raw bytes (60): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0a, 01, 14, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 1e, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 06, 00, 17, 00, 1e, 01, 02, 09, 00, 0a]
47Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 14, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a]
4948Number of files: 1
5049- file 0 => $DIR/closure_macro_async.rs
51Number of expressions: 3
50Number of expressions: 1
5251- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
53- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add)
54- expression 2 operands: lhs = Counter(1), rhs = Counter(2)
55Number of file 0 mappings: 10
52Number of file 0 mappings: 9
5653- Code(Counter(0)) at (prev + 20, 28) to (start + 0, 29)
5754- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24)
5855- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34)
5956- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33)
6057- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25)
61- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 30)
6258- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39)
6359- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22)
6460 = (c0 - c1)
65- Code(Expression(1, Sub)) at (prev + 0, 23) to (start + 0, 30)
66 = (c0 - (c1 + c2))
61- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 30)
62 = (c0 - c1)
6763- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
6864Highest counter ID seen: c1
6965
tests/coverage/conditions.cov-map+41-46
......@@ -1,8 +1,8 @@
11Function name: conditions::main
2Raw bytes (656): 0x[01, 01, 57, 05, 09, 01, 05, 09, 5d, 09, 27, 5d, 61, 27, 65, 5d, 61, 09, 23, 27, 65, 5d, 61, 01, 03, 03, 0d, 11, 51, 11, 4f, 51, 55, 4f, 59, 51, 55, 11, 4b, 4f, 59, 51, 55, 03, 9f, 01, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 9f, 01, 15, 0d, 11, 19, 45, 19, 97, 01, 45, 49, 97, 01, 4d, 45, 49, 19, 93, 01, 97, 01, 4d, 45, 49, 9f, 01, 9b, 02, 0d, 11, 15, 19, 15, 19, 15, 19, 15, 19, 15, 19, 1d, 21, 15, 19, 9b, 02, 1d, 15, 19, 21, 39, 21, e3, 01, 39, 3d, e3, 01, 41, 39, 3d, 21, df, 01, e3, 01, 41, 39, 3d, 9b, 02, d7, 02, 15, 19, 1d, 21, 9b, 02, d7, 02, 15, 19, 1d, 21, 9b, 02, d7, 02, 15, 19, 1d, 21, 9b, 02, d7, 02, 15, 19, 1d, 21, 9b, 02, d7, 02, 15, 19, 1d, 21, 25, 29, 1d, 21, d7, 02, 25, 1d, 21, 29, 2d, 29, cf, 02, 2d, 31, cf, 02, 35, 2d, 31, 29, cb, 02, cf, 02, 35, 2d, 31, d7, 02, db, 02, 1d, 21, 25, 29, 53, 01, 03, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0c, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 03, 09, 00, 0a, 01, 00, 10, 00, 1d, 05, 01, 09, 00, 17, 05, 01, 09, 00, 0a, 06, 01, 0f, 00, 1c, 09, 01, 0c, 00, 19, 0a, 00, 1d, 00, 2a, 0e, 00, 2e, 00, 3c, 23, 00, 3d, 02, 0a, 1e, 02, 09, 00, 0a, 09, 01, 09, 00, 17, 09, 01, 09, 00, 12, 2a, 02, 09, 00, 0f, 03, 03, 09, 00, 16, 03, 00, 19, 00, 1a, 03, 01, 08, 00, 0c, 03, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 02, 08, 00, 15, 0d, 00, 16, 02, 06, 2e, 02, 0f, 00, 1c, 11, 01, 0c, 00, 19, 32, 00, 1d, 00, 2a, 36, 00, 2e, 00, 3c, 4b, 00, 3d, 02, 0a, 46, 02, 09, 00, 0a, 11, 01, 09, 00, 17, 52, 02, 09, 00, 0f, 9f, 01, 03, 08, 00, 0c, 9f, 01, 01, 0d, 00, 1a, 9f, 01, 00, 1d, 00, 1e, 9f, 01, 01, 0c, 00, 10, 9f, 01, 00, 11, 02, 0a, 00, 02, 09, 00, 0a, 9f, 01, 02, 0c, 00, 19, 15, 00, 1a, 02, 0a, 72, 04, 11, 00, 1e, 19, 01, 10, 00, 1d, 7a, 00, 21, 00, 2e, 7e, 00, 32, 00, 40, 93, 01, 00, 41, 02, 0e, 8e, 01, 02, 0d, 00, 0e, 19, 01, 0d, 00, 1b, 9a, 01, 02, 0d, 00, 13, 00, 02, 05, 00, 06, 9b, 02, 02, 09, 00, 16, 9b, 02, 00, 19, 00, 1a, 9b, 02, 01, 08, 00, 0c, 9b, 02, 00, 0d, 02, 06, 00, 02, 05, 00, 06, d7, 02, 02, 09, 00, 0a, 9b, 02, 00, 10, 00, 1d, 1d, 00, 1e, 02, 06, be, 01, 02, 0f, 00, 1c, 21, 01, 0c, 00, 19, c6, 01, 00, 1d, 00, 2a, ca, 01, 00, 2e, 00, 3c, df, 01, 00, 3d, 02, 0a, da, 01, 02, 09, 00, 0a, 21, 01, 09, 00, 17, 96, 02, 02, 0d, 00, 20, 96, 02, 00, 23, 00, 2c, 96, 02, 01, 09, 00, 11, 96, 02, 00, 12, 00, 1b, 96, 02, 01, 09, 00, 0f, db, 02, 03, 09, 00, 0a, d7, 02, 00, 10, 00, 1d, 25, 00, 1e, 02, 06, aa, 02, 02, 0f, 00, 1c, 29, 01, 0c, 00, 19, b2, 02, 00, 1d, 00, 2a, b6, 02, 00, 2e, 00, 3c, cb, 02, 00, 3d, 02, 0a, c6, 02, 02, 09, 00, 0a, 29, 01, 09, 00, 17, d2, 02, 02, 09, 00, 0f, 01, 02, 01, 00, 02]
2Raw bytes (642): 0x[01, 01, 54, 05, 09, 01, 05, 09, 5d, 09, 27, 5d, 61, 27, 65, 5d, 61, 09, 23, 27, 65, 5d, 61, 01, 03, 03, 0d, 11, 51, 11, 4f, 51, 55, 4f, 59, 51, 55, 11, 4b, 4f, 59, 51, 55, 03, 9f, 01, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 9f, 01, 15, 0d, 11, 19, 45, 19, 97, 01, 45, 49, 97, 01, 4d, 45, 49, 19, 93, 01, 97, 01, 4d, 45, 49, 9f, 01, 8f, 02, 0d, 11, 15, 19, 15, 19, 15, 19, 15, 19, 15, 19, 1d, 21, 15, 19, 8f, 02, 1d, 15, 19, 21, 39, 21, e3, 01, 39, 3d, e3, 01, 41, 39, 3d, 21, df, 01, e3, 01, 41, 39, 3d, 8f, 02, cb, 02, 15, 19, 1d, 21, 8f, 02, cb, 02, 15, 19, 1d, 21, 8f, 02, cb, 02, 15, 19, 1d, 21, 8f, 02, cb, 02, 15, 19, 1d, 21, 25, 29, 1d, 21, cb, 02, 25, 1d, 21, 29, 2d, 29, c3, 02, 2d, 31, c3, 02, 35, 2d, 31, 29, bf, 02, c3, 02, 35, 2d, 31, cb, 02, cf, 02, 1d, 21, 25, 29, 52, 01, 03, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0c, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 03, 09, 00, 0a, 01, 00, 10, 00, 1d, 05, 01, 09, 00, 17, 05, 01, 09, 00, 0a, 06, 01, 0f, 00, 1c, 09, 01, 0c, 00, 19, 0a, 00, 1d, 00, 2a, 0e, 00, 2e, 00, 3c, 23, 00, 3d, 02, 0a, 1e, 02, 09, 00, 0a, 09, 01, 09, 00, 17, 09, 01, 09, 00, 12, 2a, 02, 09, 00, 0f, 03, 03, 09, 00, 16, 03, 00, 19, 00, 1a, 03, 01, 08, 00, 0c, 03, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 02, 08, 00, 15, 0d, 00, 16, 02, 06, 2e, 02, 0f, 00, 1c, 11, 01, 0c, 00, 19, 32, 00, 1d, 00, 2a, 36, 00, 2e, 00, 3c, 4b, 00, 3d, 02, 0a, 46, 02, 09, 00, 0a, 11, 01, 09, 00, 17, 52, 02, 09, 00, 0f, 9f, 01, 03, 08, 00, 0c, 9f, 01, 01, 0d, 00, 1a, 9f, 01, 00, 1d, 00, 1e, 9f, 01, 01, 0c, 00, 10, 9f, 01, 00, 11, 02, 0a, 00, 02, 09, 00, 0a, 9f, 01, 02, 0c, 00, 19, 15, 00, 1a, 02, 0a, 72, 04, 11, 00, 1e, 19, 01, 10, 00, 1d, 7a, 00, 21, 00, 2e, 7e, 00, 32, 00, 40, 93, 01, 00, 41, 02, 0e, 8e, 01, 02, 0d, 00, 0e, 19, 01, 0d, 00, 1b, 9a, 01, 02, 0d, 00, 13, 00, 02, 05, 00, 06, 8f, 02, 02, 09, 00, 16, 8f, 02, 00, 19, 00, 1a, 8f, 02, 01, 08, 00, 0c, 8f, 02, 00, 0d, 02, 06, 00, 02, 05, 00, 06, cb, 02, 02, 09, 00, 0a, 8f, 02, 00, 10, 00, 1d, 1d, 00, 1e, 02, 06, be, 01, 02, 0f, 00, 1c, 21, 01, 0c, 00, 19, c6, 01, 00, 1d, 00, 2a, ca, 01, 00, 2e, 00, 3c, df, 01, 00, 3d, 02, 0a, da, 01, 02, 09, 00, 0a, 21, 01, 09, 00, 17, 8a, 02, 02, 0d, 00, 20, 8a, 02, 00, 23, 00, 2c, 8a, 02, 01, 09, 00, 11, 8a, 02, 01, 09, 00, 0f, cf, 02, 03, 09, 00, 0a, cb, 02, 00, 10, 00, 1d, 25, 00, 1e, 02, 06, 9e, 02, 02, 0f, 00, 1c, 29, 01, 0c, 00, 19, a6, 02, 00, 1d, 00, 2a, aa, 02, 00, 2e, 00, 3c, bf, 02, 00, 3d, 02, 0a, ba, 02, 02, 09, 00, 0a, 29, 01, 09, 00, 17, c6, 02, 02, 09, 00, 0f, 01, 02, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/conditions.rs
5Number of expressions: 87
5Number of expressions: 84
66- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
77- expression 1 operands: lhs = Counter(0), rhs = Counter(1)
88- expression 2 operands: lhs = Counter(2), rhs = Counter(23)
......@@ -41,7 +41,7 @@ Number of expressions: 87
4141- expression 35 operands: lhs = Counter(6), rhs = Expression(36, Add)
4242- expression 36 operands: lhs = Expression(37, Add), rhs = Counter(19)
4343- expression 37 operands: lhs = Counter(17), rhs = Counter(18)
44- expression 38 operands: lhs = Expression(39, Add), rhs = Expression(70, Add)
44- expression 38 operands: lhs = Expression(39, Add), rhs = Expression(67, Add)
4545- expression 39 operands: lhs = Counter(3), rhs = Counter(4)
4646- expression 40 operands: lhs = Counter(5), rhs = Counter(6)
4747- expression 41 operands: lhs = Counter(5), rhs = Counter(6)
......@@ -50,7 +50,7 @@ Number of expressions: 87
5050- expression 44 operands: lhs = Counter(5), rhs = Counter(6)
5151- expression 45 operands: lhs = Counter(7), rhs = Counter(8)
5252- expression 46 operands: lhs = Counter(5), rhs = Counter(6)
53- expression 47 operands: lhs = Expression(70, Add), rhs = Counter(7)
53- expression 47 operands: lhs = Expression(67, Add), rhs = Counter(7)
5454- expression 48 operands: lhs = Counter(5), rhs = Counter(6)
5555- expression 49 operands: lhs = Counter(8), rhs = Counter(14)
5656- expression 50 operands: lhs = Counter(8), rhs = Expression(56, Add)
......@@ -60,37 +60,34 @@ Number of expressions: 87
6060- expression 54 operands: lhs = Counter(8), rhs = Expression(55, Add)
6161- expression 55 operands: lhs = Expression(56, Add), rhs = Counter(16)
6262- expression 56 operands: lhs = Counter(14), rhs = Counter(15)
63- expression 57 operands: lhs = Expression(70, Add), rhs = Expression(85, Add)
63- expression 57 operands: lhs = Expression(67, Add), rhs = Expression(82, Add)
6464- expression 58 operands: lhs = Counter(5), rhs = Counter(6)
6565- expression 59 operands: lhs = Counter(7), rhs = Counter(8)
66- expression 60 operands: lhs = Expression(70, Add), rhs = Expression(85, Add)
66- expression 60 operands: lhs = Expression(67, Add), rhs = Expression(82, Add)
6767- expression 61 operands: lhs = Counter(5), rhs = Counter(6)
6868- expression 62 operands: lhs = Counter(7), rhs = Counter(8)
69- expression 63 operands: lhs = Expression(70, Add), rhs = Expression(85, Add)
69- expression 63 operands: lhs = Expression(67, Add), rhs = Expression(82, Add)
7070- expression 64 operands: lhs = Counter(5), rhs = Counter(6)
7171- expression 65 operands: lhs = Counter(7), rhs = Counter(8)
72- expression 66 operands: lhs = Expression(70, Add), rhs = Expression(85, Add)
72- expression 66 operands: lhs = Expression(67, Add), rhs = Expression(82, Add)
7373- expression 67 operands: lhs = Counter(5), rhs = Counter(6)
7474- expression 68 operands: lhs = Counter(7), rhs = Counter(8)
75- expression 69 operands: lhs = Expression(70, Add), rhs = Expression(85, Add)
76- expression 70 operands: lhs = Counter(5), rhs = Counter(6)
77- expression 71 operands: lhs = Counter(7), rhs = Counter(8)
78- expression 72 operands: lhs = Counter(9), rhs = Counter(10)
79- expression 73 operands: lhs = Counter(7), rhs = Counter(8)
80- expression 74 operands: lhs = Expression(85, Add), rhs = Counter(9)
81- expression 75 operands: lhs = Counter(7), rhs = Counter(8)
82- expression 76 operands: lhs = Counter(10), rhs = Counter(11)
83- expression 77 operands: lhs = Counter(10), rhs = Expression(83, Add)
84- expression 78 operands: lhs = Counter(11), rhs = Counter(12)
85- expression 79 operands: lhs = Expression(83, Add), rhs = Counter(13)
75- expression 69 operands: lhs = Counter(9), rhs = Counter(10)
76- expression 70 operands: lhs = Counter(7), rhs = Counter(8)
77- expression 71 operands: lhs = Expression(82, Add), rhs = Counter(9)
78- expression 72 operands: lhs = Counter(7), rhs = Counter(8)
79- expression 73 operands: lhs = Counter(10), rhs = Counter(11)
80- expression 74 operands: lhs = Counter(10), rhs = Expression(80, Add)
81- expression 75 operands: lhs = Counter(11), rhs = Counter(12)
82- expression 76 operands: lhs = Expression(80, Add), rhs = Counter(13)
83- expression 77 operands: lhs = Counter(11), rhs = Counter(12)
84- expression 78 operands: lhs = Counter(10), rhs = Expression(79, Add)
85- expression 79 operands: lhs = Expression(80, Add), rhs = Counter(13)
8686- expression 80 operands: lhs = Counter(11), rhs = Counter(12)
87- expression 81 operands: lhs = Counter(10), rhs = Expression(82, Add)
88- expression 82 operands: lhs = Expression(83, Add), rhs = Counter(13)
89- expression 83 operands: lhs = Counter(11), rhs = Counter(12)
90- expression 84 operands: lhs = Expression(85, Add), rhs = Expression(86, Add)
91- expression 85 operands: lhs = Counter(7), rhs = Counter(8)
92- expression 86 operands: lhs = Counter(9), rhs = Counter(10)
93Number of file 0 mappings: 83
87- expression 81 operands: lhs = Expression(82, Add), rhs = Expression(83, Add)
88- expression 82 operands: lhs = Counter(7), rhs = Counter(8)
89- expression 83 operands: lhs = Counter(9), rhs = Counter(10)
90Number of file 0 mappings: 82
9491- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10)
9592- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
9693- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26)
......@@ -172,18 +169,18 @@ Number of file 0 mappings: 83
172169- Code(Expression(38, Sub)) at (prev + 2, 13) to (start + 0, 19)
173170 = ((c3 + c4) - (c5 + c6))
174171- Code(Zero) at (prev + 2, 5) to (start + 0, 6)
175- Code(Expression(70, Add)) at (prev + 2, 9) to (start + 0, 22)
172- Code(Expression(67, Add)) at (prev + 2, 9) to (start + 0, 22)
176173 = (c5 + c6)
177- Code(Expression(70, Add)) at (prev + 0, 25) to (start + 0, 26)
174- Code(Expression(67, Add)) at (prev + 0, 25) to (start + 0, 26)
178175 = (c5 + c6)
179- Code(Expression(70, Add)) at (prev + 1, 8) to (start + 0, 12)
176- Code(Expression(67, Add)) at (prev + 1, 8) to (start + 0, 12)
180177 = (c5 + c6)
181- Code(Expression(70, Add)) at (prev + 0, 13) to (start + 2, 6)
178- Code(Expression(67, Add)) at (prev + 0, 13) to (start + 2, 6)
182179 = (c5 + c6)
183180- Code(Zero) at (prev + 2, 5) to (start + 0, 6)
184- Code(Expression(85, Add)) at (prev + 2, 9) to (start + 0, 10)
181- Code(Expression(82, Add)) at (prev + 2, 9) to (start + 0, 10)
185182 = (c7 + c8)
186- Code(Expression(70, Add)) at (prev + 0, 16) to (start + 0, 29)
183- Code(Expression(67, Add)) at (prev + 0, 16) to (start + 0, 29)
187184 = (c5 + c6)
188185- Code(Counter(7)) at (prev + 0, 30) to (start + 2, 6)
189186- Code(Expression(47, Sub)) at (prev + 2, 15) to (start + 0, 28)
......@@ -198,34 +195,32 @@ Number of file 0 mappings: 83
198195- Code(Expression(54, Sub)) at (prev + 2, 9) to (start + 0, 10)
199196 = (c8 - ((c14 + c15) + c16))
200197- Code(Counter(8)) at (prev + 1, 9) to (start + 0, 23)
201- Code(Expression(69, Sub)) at (prev + 2, 13) to (start + 0, 32)
198- Code(Expression(66, Sub)) at (prev + 2, 13) to (start + 0, 32)
202199 = ((c5 + c6) - (c7 + c8))
203- Code(Expression(69, Sub)) at (prev + 0, 35) to (start + 0, 44)
200- Code(Expression(66, Sub)) at (prev + 0, 35) to (start + 0, 44)
204201 = ((c5 + c6) - (c7 + c8))
205- Code(Expression(69, Sub)) at (prev + 1, 9) to (start + 0, 17)
202- Code(Expression(66, Sub)) at (prev + 1, 9) to (start + 0, 17)
206203 = ((c5 + c6) - (c7 + c8))
207- Code(Expression(69, Sub)) at (prev + 0, 18) to (start + 0, 27)
204- Code(Expression(66, Sub)) at (prev + 1, 9) to (start + 0, 15)
208205 = ((c5 + c6) - (c7 + c8))
209- Code(Expression(69, Sub)) at (prev + 1, 9) to (start + 0, 15)
210 = ((c5 + c6) - (c7 + c8))
211- Code(Expression(86, Add)) at (prev + 3, 9) to (start + 0, 10)
206- Code(Expression(83, Add)) at (prev + 3, 9) to (start + 0, 10)
212207 = (c9 + c10)
213- Code(Expression(85, Add)) at (prev + 0, 16) to (start + 0, 29)
208- Code(Expression(82, Add)) at (prev + 0, 16) to (start + 0, 29)
214209 = (c7 + c8)
215210- Code(Counter(9)) at (prev + 0, 30) to (start + 2, 6)
216- Code(Expression(74, Sub)) at (prev + 2, 15) to (start + 0, 28)
211- Code(Expression(71, Sub)) at (prev + 2, 15) to (start + 0, 28)
217212 = ((c7 + c8) - c9)
218213- Code(Counter(10)) at (prev + 1, 12) to (start + 0, 25)
219- Code(Expression(76, Sub)) at (prev + 0, 29) to (start + 0, 42)
214- Code(Expression(73, Sub)) at (prev + 0, 29) to (start + 0, 42)
220215 = (c10 - c11)
221- Code(Expression(77, Sub)) at (prev + 0, 46) to (start + 0, 60)
216- Code(Expression(74, Sub)) at (prev + 0, 46) to (start + 0, 60)
222217 = (c10 - (c11 + c12))
223- Code(Expression(82, Add)) at (prev + 0, 61) to (start + 2, 10)
218- Code(Expression(79, Add)) at (prev + 0, 61) to (start + 2, 10)
224219 = ((c11 + c12) + c13)
225- Code(Expression(81, Sub)) at (prev + 2, 9) to (start + 0, 10)
220- Code(Expression(78, Sub)) at (prev + 2, 9) to (start + 0, 10)
226221 = (c10 - ((c11 + c12) + c13))
227222- Code(Counter(10)) at (prev + 1, 9) to (start + 0, 23)
228- Code(Expression(84, Sub)) at (prev + 2, 9) to (start + 0, 15)
223- Code(Expression(81, Sub)) at (prev + 2, 9) to (start + 0, 15)
229224 = ((c7 + c8) - (c9 + c10))
230225- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
231226Highest counter ID seen: c10
tests/coverage/coverage_attr_closure.cov-map+6-9
......@@ -1,24 +1,22 @@
11Function name: coverage_attr_closure::GLOBAL_CLOSURE_ON::{closure#0}
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 06, 0f, 00, 10, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 17, 01, 01, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 06, 0f, 00, 10, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/coverage_attr_closure.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 6, 15) to (start + 0, 16)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 23)
109- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
1312Function name: coverage_attr_closure::contains_closures_off::{closure#0} (unused)
14Raw bytes (24): 0x[01, 01, 00, 04, 00, 1d, 13, 00, 14, 00, 01, 09, 00, 11, 00, 00, 12, 00, 1b, 00, 01, 05, 00, 06]
13Raw bytes (19): 0x[01, 01, 00, 03, 00, 1d, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06]
1514Number of files: 1
1615- file 0 => $DIR/coverage_attr_closure.rs
1716Number of expressions: 0
18Number of file 0 mappings: 4
17Number of file 0 mappings: 3
1918- Code(Zero) at (prev + 29, 19) to (start + 0, 20)
2019- Code(Zero) at (prev + 1, 9) to (start + 0, 17)
21- Code(Zero) at (prev + 0, 18) to (start + 0, 27)
2220- Code(Zero) at (prev + 1, 5) to (start + 0, 6)
2321Highest counter ID seen: (none)
2422
......@@ -35,14 +33,13 @@ Number of file 0 mappings: 4
3533Highest counter ID seen: c0
3634
3735Function name: coverage_attr_closure::contains_closures_on::{closure#0} (unused)
38Raw bytes (24): 0x[01, 01, 00, 04, 00, 11, 13, 00, 14, 00, 01, 09, 00, 11, 00, 00, 12, 00, 1b, 00, 01, 05, 00, 06]
36Raw bytes (19): 0x[01, 01, 00, 03, 00, 11, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06]
3937Number of files: 1
4038- file 0 => $DIR/coverage_attr_closure.rs
4139Number of expressions: 0
42Number of file 0 mappings: 4
40Number of file 0 mappings: 3
4341- Code(Zero) at (prev + 17, 19) to (start + 0, 20)
4442- Code(Zero) at (prev + 1, 9) to (start + 0, 17)
45- Code(Zero) at (prev + 0, 18) to (start + 0, 27)
4643- Code(Zero) at (prev + 1, 5) to (start + 0, 6)
4744Highest counter ID seen: (none)
4845
tests/coverage/drop_trait.cov-map+4-6
......@@ -1,21 +1,20 @@
11Function name: <drop_trait::Firework as core::ops::drop::Drop>::drop
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 12, 00, 24, 01, 01, 05, 00, 06]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06]
33Number of files: 1
44- file 0 => $DIR/drop_trait.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 23)
88- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
9- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36)
109- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
1110Highest counter ID seen: c0
1211
1312Function name: drop_trait::main
14Raw bytes (69): 0x[01, 01, 00, 0d, 01, 0e, 01, 00, 1c, 01, 01, 09, 00, 15, 01, 00, 18, 00, 30, 01, 02, 09, 00, 0d, 01, 00, 10, 00, 2a, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 00, 12, 00, 29, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
13Raw bytes (64): 0x[01, 01, 00, 0c, 01, 0e, 01, 00, 1c, 01, 01, 09, 00, 15, 01, 00, 18, 00, 30, 01, 02, 09, 00, 0d, 01, 00, 10, 00, 2a, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
1514Number of files: 1
1615- file 0 => $DIR/drop_trait.rs
1716Number of expressions: 0
18Number of file 0 mappings: 13
17Number of file 0 mappings: 12
1918- Code(Counter(0)) at (prev + 14, 1) to (start + 0, 28)
2019- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21)
2120- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 48)
......@@ -23,7 +22,6 @@ Number of file 0 mappings: 13
2322- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 42)
2423- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12)
2524- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
26- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 41)
2725- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22)
2826- Code(Zero) at (prev + 1, 5) to (start + 0, 6)
2927- Code(Zero) at (prev + 2, 13) to (start + 0, 40)
tests/coverage/generics.cov-map+6-9
......@@ -1,12 +1,11 @@
11Function name: <generics::Firework<f64> as core::ops::drop::Drop>::drop
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 12, 00, 24, 01, 01, 05, 00, 06]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06]
33Number of files: 1
44- file 0 => $DIR/generics.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23)
88- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
9- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36)
109- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
1110Highest counter ID seen: c0
1211
......@@ -22,14 +21,13 @@ Number of file 0 mappings: 3
2221Highest counter ID seen: c0
2322
2423Function name: <generics::Firework<i32> as core::ops::drop::Drop>::drop
25Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 12, 00, 24, 01, 01, 05, 00, 06]
24Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06]
2625Number of files: 1
2726- file 0 => $DIR/generics.rs
2827Number of expressions: 0
29Number of file 0 mappings: 4
28Number of file 0 mappings: 3
3029- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23)
3130- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
32- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36)
3331- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
3432Highest counter ID seen: c0
3533
......@@ -45,11 +43,11 @@ Number of file 0 mappings: 3
4543Highest counter ID seen: c0
4644
4745Function name: generics::main
48Raw bytes (99): 0x[01, 01, 00, 13, 01, 16, 01, 00, 1c, 01, 01, 09, 00, 18, 01, 00, 1b, 00, 33, 01, 01, 05, 00, 10, 01, 00, 11, 00, 1d, 01, 02, 09, 00, 10, 01, 00, 13, 00, 2f, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 00, 12, 00, 29, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
46Raw bytes (94): 0x[01, 01, 00, 12, 01, 16, 01, 00, 1c, 01, 01, 09, 00, 18, 01, 00, 1b, 00, 33, 01, 01, 05, 00, 10, 01, 00, 11, 00, 1d, 01, 02, 09, 00, 10, 01, 00, 13, 00, 2f, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
4947Number of files: 1
5048- file 0 => $DIR/generics.rs
5149Number of expressions: 0
52Number of file 0 mappings: 19
50Number of file 0 mappings: 18
5351- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 28)
5452- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 24)
5553- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 51)
......@@ -63,7 +61,6 @@ Number of file 0 mappings: 19
6361- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 21)
6462- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12)
6563- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
66- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 41)
6764- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22)
6865- Code(Zero) at (prev + 1, 5) to (start + 0, 6)
6966- Code(Zero) at (prev + 2, 13) to (start + 0, 40)
tests/coverage/inline-dead.cov-map+2-3
......@@ -25,14 +25,13 @@ Number of file 0 mappings: 5
2525Highest counter ID seen: c1
2626
2727Function name: inline_dead::main
28Raw bytes (39): 0x[01, 01, 00, 07, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 12, 01, 00, 14, 00, 21, 01, 02, 09, 00, 0a, 01, 03, 05, 00, 0d, 01, 01, 01, 00, 02]
28Raw bytes (34): 0x[01, 01, 00, 06, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 14, 00, 21, 01, 02, 09, 00, 0a, 01, 03, 05, 00, 0d, 01, 01, 01, 00, 02]
2929Number of files: 1
3030- file 0 => $DIR/inline-dead.rs
3131Number of expressions: 0
32Number of file 0 mappings: 7
32Number of file 0 mappings: 6
3333- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10)
3434- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
35- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18)
3635- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 33)
3736- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10)
3837- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 13)
tests/coverage/inner_items.cov-map+2-3
......@@ -53,18 +53,17 @@ Number of file 0 mappings: 16
5353Highest counter ID seen: c2
5454
5555Function name: inner_items::main::in_func
56Raw bytes (44): 0x[01, 01, 00, 08, 01, 12, 05, 00, 17, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 16, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06]
56Raw bytes (39): 0x[01, 01, 00, 07, 01, 12, 05, 00, 17, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 16, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06]
5757Number of files: 1
5858- file 0 => $DIR/inner_items.rs
5959Number of expressions: 0
60Number of file 0 mappings: 8
60Number of file 0 mappings: 7
6161- Code(Counter(0)) at (prev + 18, 5) to (start + 0, 23)
6262- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14)
6363- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18)
6464- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14)
6565- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22)
6666- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
67- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26)
6867- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6)
6968Highest counter ID seen: c0
7069
tests/coverage/issue-83601.cov-map+2-5
......@@ -1,9 +1,9 @@
11Function name: issue_83601::main
2Raw bytes (74): 0x[01, 01, 00, 0e, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 01, 00, 02]
2Raw bytes (59): 0x[01, 01, 00, 0b, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/issue-83601.rs
55Number of expressions: 0
6Number of file 0 mappings: 14
6Number of file 0 mappings: 11
77- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10)
88- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
99- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
......@@ -12,11 +12,8 @@ Number of file 0 mappings: 14
1212- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
1313- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
1414- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
15- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
1615- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
17- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
1816- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
19- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
2017- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2118Highest counter ID seen: c0
2219
tests/coverage/issue-84561.cov-map+20-43
......@@ -1,14 +1,13 @@
11Function name: <issue_84561::Foo as core::fmt::Debug>::fmt
2Raw bytes (42): 0x[01, 01, 01, 01, 05, 07, 01, 8a, 01, 05, 00, 43, 01, 01, 09, 00, 0f, 01, 00, 10, 00, 11, 01, 00, 13, 00, 24, 05, 00, 25, 00, 26, 02, 01, 09, 00, 0f, 01, 01, 05, 00, 06]
2Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, 8a, 01, 05, 00, 43, 01, 01, 09, 00, 0f, 01, 00, 10, 00, 11, 05, 00, 25, 00, 26, 02, 01, 09, 00, 0f, 01, 01, 05, 00, 06]
33Number of files: 1
44- file 0 => $DIR/issue-84561.rs
55Number of expressions: 1
66- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
7Number of file 0 mappings: 7
7Number of file 0 mappings: 6
88- Code(Counter(0)) at (prev + 138, 5) to (start + 0, 67)
99- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15)
1010- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 17)
11- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 36)
1211- Code(Counter(1)) at (prev + 0, 37) to (start + 0, 38)
1312- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15)
1413 = (c0 - c1)
......@@ -29,54 +28,48 @@ Number of file 0 mappings: 5
2928Highest counter ID seen: c0
3029
3130Function name: issue_84561::test1
32Raw bytes (65): 0x[01, 01, 00, 0c, 01, 9a, 01, 01, 00, 0b, 01, 01, 05, 00, 0b, 05, 00, 0c, 00, 1e, 01, 01, 05, 00, 0b, 09, 00, 0c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 05, 00, 0b, 0d, 00, 0c, 00, 1e, 01, 01, 05, 02, 06, 01, 03, 05, 00, 0b, 11, 00, 0c, 00, 1e, 01, 01, 01, 00, 02]
31Raw bytes (45): 0x[01, 01, 00, 08, 01, 9a, 01, 01, 00, 0b, 01, 01, 05, 00, 0b, 01, 01, 05, 00, 0b, 01, 01, 0d, 00, 0e, 01, 01, 05, 00, 0b, 01, 01, 05, 02, 06, 01, 03, 05, 00, 0b, 01, 01, 01, 00, 02]
3332Number of files: 1
3433- file 0 => $DIR/issue-84561.rs
3534Number of expressions: 0
36Number of file 0 mappings: 12
35Number of file 0 mappings: 8
3736- Code(Counter(0)) at (prev + 154, 1) to (start + 0, 11)
3837- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11)
39- Code(Counter(1)) at (prev + 0, 12) to (start + 0, 30)
4038- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11)
41- Code(Counter(2)) at (prev + 0, 12) to (start + 0, 30)
4239- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14)
4340- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11)
44- Code(Counter(3)) at (prev + 0, 12) to (start + 0, 30)
4541- Code(Counter(0)) at (prev + 1, 5) to (start + 2, 6)
4642- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 11)
47- Code(Counter(4)) at (prev + 0, 12) to (start + 0, 30)
4843- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
49Highest counter ID seen: c4
44Highest counter ID seen: c0
5045
5146Function name: issue_84561::test2
52Raw bytes (25): 0x[01, 01, 00, 04, 01, b0, 01, 01, 00, 0b, 01, 01, 05, 00, 10, 05, 00, 11, 00, 23, 01, 01, 01, 00, 02]
47Raw bytes (20): 0x[01, 01, 00, 03, 01, b0, 01, 01, 00, 0b, 01, 01, 05, 00, 10, 01, 01, 01, 00, 02]
5348Number of files: 1
5449- file 0 => $DIR/issue-84561.rs
5550Number of expressions: 0
56Number of file 0 mappings: 4
51Number of file 0 mappings: 3
5752- Code(Counter(0)) at (prev + 176, 1) to (start + 0, 11)
5853- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16)
59- Code(Counter(1)) at (prev + 0, 17) to (start + 0, 35)
6054- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
61Highest counter ID seen: c1
55Highest counter ID seen: c0
6256
6357Function name: issue_84561::test2::call_print
64Raw bytes (25): 0x[01, 01, 00, 04, 01, a7, 01, 09, 00, 1f, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 18, 01, 01, 09, 00, 0a]
58Raw bytes (20): 0x[01, 01, 00, 03, 01, a7, 01, 09, 00, 1f, 01, 01, 0d, 00, 13, 01, 01, 09, 00, 0a]
6559Number of files: 1
6660- file 0 => $DIR/issue-84561.rs
6761Number of expressions: 0
68Number of file 0 mappings: 4
62Number of file 0 mappings: 3
6963- Code(Counter(0)) at (prev + 167, 9) to (start + 0, 31)
7064- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19)
71- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 24)
7265- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10)
7366Highest counter ID seen: c0
7467
7568Function name: issue_84561::test3
76Raw bytes (409): 0x[01, 01, 0a, 01, 05, 01, 09, 01, 0d, 11, 15, 1d, 21, 19, 1d, 19, 1d, 19, 1d, 27, 25, 1d, 21, 4d, 01, 08, 01, 00, 0b, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 02, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 00, 00, 20, 00, 30, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 02, 05, 00, 0f, 00, 00, 20, 00, 24, 00, 00, 29, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 01, 01, 05, 00, 0f, 00, 05, 09, 00, 0d, 00, 03, 09, 00, 10, 00, 02, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 04, 08, 00, 0f, 05, 01, 09, 00, 13, 02, 05, 09, 00, 13, 01, 05, 08, 00, 0f, 09, 01, 09, 00, 13, 00, 03, 0d, 00, 1d, 06, 03, 09, 00, 13, 00, 03, 0d, 00, 1d, 01, 03, 05, 00, 0f, 01, 01, 0c, 00, 13, 0d, 01, 0d, 00, 13, 0a, 02, 0d, 00, 13, 11, 04, 05, 00, 0f, 11, 02, 0c, 00, 13, 15, 01, 0d, 00, 13, 0e, 02, 0d, 00, 13, 27, 03, 05, 00, 0f, 19, 01, 0c, 00, 13, 1d, 01, 0d, 00, 17, 1d, 04, 0d, 00, 13, 1e, 02, 0d, 00, 17, 1e, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 1e, 02, 15, 00, 1b, 21, 04, 0d, 00, 13, 22, 03, 09, 00, 19, 25, 02, 05, 00, 0f, 25, 03, 09, 00, 22, 00, 02, 05, 00, 0f, 00, 03, 09, 00, 2c, 00, 02, 01, 00, 02]
69Raw bytes (340): 0x[01, 01, 08, 01, 05, 01, 09, 01, 0d, 11, 15, 1d, 21, 19, 1d, 19, 1d, 19, 1d, 40, 01, 08, 01, 00, 0b, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 0f, 00, 00, 29, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 01, 01, 05, 00, 0f, 00, 08, 09, 00, 10, 00, 02, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 04, 08, 00, 0f, 05, 01, 09, 00, 13, 02, 05, 09, 00, 13, 01, 05, 08, 00, 0f, 09, 01, 09, 00, 13, 06, 06, 09, 00, 13, 01, 06, 05, 00, 0f, 01, 01, 0c, 00, 13, 0d, 01, 0d, 00, 13, 0a, 02, 0d, 00, 13, 11, 04, 05, 00, 0f, 11, 02, 0c, 00, 13, 15, 01, 0d, 00, 13, 0e, 02, 0d, 00, 13, 13, 03, 05, 00, 0f, 19, 01, 0c, 00, 13, 1d, 01, 0d, 00, 17, 1d, 04, 0d, 00, 13, 1e, 02, 0d, 00, 17, 1e, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 1e, 02, 15, 00, 1b, 21, 04, 0d, 00, 13, 25, 05, 05, 00, 0f, 00, 05, 05, 00, 0f, 00, 05, 01, 00, 02]
7770Number of files: 1
7871- file 0 => $DIR/issue-84561.rs
79Number of expressions: 10
72Number of expressions: 8
8073- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
8174- expression 1 operands: lhs = Counter(0), rhs = Counter(2)
8275- expression 2 operands: lhs = Counter(0), rhs = Counter(3)
......@@ -85,9 +78,7 @@ Number of expressions: 10
8578- expression 5 operands: lhs = Counter(6), rhs = Counter(7)
8679- expression 6 operands: lhs = Counter(6), rhs = Counter(7)
8780- expression 7 operands: lhs = Counter(6), rhs = Counter(7)
88- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(9)
89- expression 9 operands: lhs = Counter(7), rhs = Counter(8)
90Number of file 0 mappings: 77
81Number of file 0 mappings: 64
9182- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11)
9283- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16)
9384- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46)
......@@ -98,11 +89,8 @@ Number of file 0 mappings: 77
9889- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
9990- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
10091- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
101- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
10292- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
103- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
10493- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
105- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
10694- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15)
10795- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
10896- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
......@@ -111,19 +99,14 @@ Number of file 0 mappings: 77
11199- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
112100- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
113101- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
114- Code(Zero) at (prev + 0, 32) to (start + 0, 48)
115102- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
116- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
117103- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
118- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
119104- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15)
120- Code(Zero) at (prev + 0, 32) to (start + 0, 36)
121105- Code(Zero) at (prev + 0, 41) to (start + 0, 48)
122106- Code(Zero) at (prev + 0, 51) to (start + 0, 65)
123107- Code(Zero) at (prev + 0, 75) to (start + 0, 90)
124108- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
125- Code(Zero) at (prev + 5, 9) to (start + 0, 13)
126- Code(Zero) at (prev + 3, 9) to (start + 0, 16)
109- Code(Zero) at (prev + 8, 9) to (start + 0, 16)
127110- Code(Zero) at (prev + 2, 13) to (start + 0, 27)
128111- Code(Zero) at (prev + 2, 13) to (start + 0, 28)
129112- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16)
......@@ -140,11 +123,9 @@ Number of file 0 mappings: 77
140123 = (c0 - c1)
141124- Code(Counter(0)) at (prev + 5, 8) to (start + 0, 15)
142125- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 19)
143- Code(Zero) at (prev + 3, 13) to (start + 0, 29)
144- Code(Expression(1, Sub)) at (prev + 3, 9) to (start + 0, 19)
126- Code(Expression(1, Sub)) at (prev + 6, 9) to (start + 0, 19)
145127 = (c0 - c2)
146- Code(Zero) at (prev + 3, 13) to (start + 0, 29)
147- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 15)
128- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 15)
148129- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 19)
149130- Code(Counter(3)) at (prev + 1, 13) to (start + 0, 19)
150131- Code(Expression(2, Sub)) at (prev + 2, 13) to (start + 0, 19)
......@@ -154,7 +135,7 @@ Number of file 0 mappings: 77
154135- Code(Counter(5)) at (prev + 1, 13) to (start + 0, 19)
155136- Code(Expression(3, Sub)) at (prev + 2, 13) to (start + 0, 19)
156137 = (c4 - c5)
157- Code(Expression(9, Add)) at (prev + 3, 5) to (start + 0, 15)
138- Code(Expression(4, Add)) at (prev + 3, 5) to (start + 0, 15)
158139 = (c7 + c8)
159140- Code(Counter(6)) at (prev + 1, 12) to (start + 0, 19)
160141- Code(Counter(7)) at (prev + 1, 13) to (start + 0, 23)
......@@ -167,12 +148,8 @@ Number of file 0 mappings: 77
167148- Code(Expression(7, Sub)) at (prev + 2, 21) to (start + 0, 27)
168149 = (c6 - c7)
169150- Code(Counter(8)) at (prev + 4, 13) to (start + 0, 19)
170- Code(Expression(8, Sub)) at (prev + 3, 9) to (start + 0, 25)
171 = ((c7 + c8) - c9)
172- Code(Counter(9)) at (prev + 2, 5) to (start + 0, 15)
173- Code(Counter(9)) at (prev + 3, 9) to (start + 0, 34)
174- Code(Zero) at (prev + 2, 5) to (start + 0, 15)
175- Code(Zero) at (prev + 3, 9) to (start + 0, 44)
176- Code(Zero) at (prev + 2, 1) to (start + 0, 2)
151- Code(Counter(9)) at (prev + 5, 5) to (start + 0, 15)
152- Code(Zero) at (prev + 5, 5) to (start + 0, 15)
153- Code(Zero) at (prev + 5, 1) to (start + 0, 2)
177154Highest counter ID seen: c9
178155
tests/coverage/issue-84561.coverage+7-11
......@@ -22,18 +22,17 @@
2222 LL| 1| assert_ne!(bar, Foo(3));
2323 LL| 1| assert_ne!(Foo(0), Foo(4));
2424 LL| 1| assert_eq!(Foo(3), Foo(3), "with a message");
25 ^0
2625 LL| 1| println!("{:?}", bar);
2726 LL| 1| println!("{:?}", Foo(1));
2827 LL| |
2928 LL| 1| assert_ne!(Foo(0), Foo(5), "{}", if is_true { "true message" } else { "false message" });
30 ^0 ^0 ^0 ^0
29 ^0 ^0 ^0
3130 LL| 1| assert_ne!(
3231 LL| | Foo(0)
3332 LL| | ,
3433 LL| | Foo(5)
3534 LL| | ,
36 LL| 0| "{}"
35 LL| | "{}"
3736 LL| | ,
3837 LL| | if
3938 LL| 0| is_true
......@@ -78,13 +77,13 @@
7877 LL| 1| assert_ne!(
7978 LL| | Foo(0),
8079 LL| | Foo(4),
81 LL| 0| "with a message"
80 LL| | "with a message"
8281 LL| | );
8382 LL| | } else {
8483 LL| 0| assert_eq!(
8584 LL| | Foo(3),
8685 LL| | Foo(3),
87 LL| 0| "with a message"
86 LL| | "with a message"
8887 LL| | );
8988 LL| | }
9089 LL| 1| assert_ne!(
......@@ -122,17 +121,17 @@
122121 LL| 0| Foo(1)
123122 LL| | },
124123 LL| | Foo(5),
125 LL| 0| "with a message"
124 LL| | "with a message"
126125 LL| | );
127126 LL| 1| assert_eq!(
128127 LL| | Foo(1),
129128 LL| | Foo(3),
130 LL| 1| "this assert should fail"
129 LL| | "this assert should fail"
131130 LL| | );
132131 LL| 0| assert_eq!(
133132 LL| | Foo(3),
134133 LL| | Foo(3),
135 LL| 0| "this assert should not be reached"
134 LL| | "this assert should not be reached"
136135 LL| | );
137136 LL| 0|}
138137 LL| |
......@@ -156,12 +155,9 @@
156155 LL| |
157156 LL| 1|fn test1() {
158157 LL| 1| debug!("debug is enabled");
159 ^0
160158 LL| 1| debug!("debug is enabled");
161 ^0
162159 LL| 1| let _ = 0;
163160 LL| 1| debug!("debug is enabled");
164 ^0
165161 LL| 1| unsafe {
166162 LL| 1| DEBUG_LEVEL_ENABLED = true;
167163 LL| 1| }
tests/coverage/loops_branches.cov-map+6-12
......@@ -1,5 +1,5 @@
11Function name: <loops_branches::DebugTest as core::fmt::Debug>::fmt
2Raw bytes (139): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 05, 0d, 0d, 09, 19, 01, 09, 05, 00, 43, 01, 01, 0c, 00, 10, 01, 01, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 01, 00, 17, 00, 1d, 05, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 09, 03, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 14, 09, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 09, 00, 1b, 00, 21, 06, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06]
2Raw bytes (129): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 05, 0d, 0d, 09, 17, 01, 09, 05, 00, 43, 01, 01, 0c, 00, 10, 01, 01, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 05, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 09, 03, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 14, 09, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 06, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06]
33Number of files: 1
44- file 0 => $DIR/loops_branches.rs
55Number of expressions: 5
......@@ -8,7 +8,7 @@ Number of expressions: 5
88- expression 2 operands: lhs = Counter(0), rhs = Counter(2)
99- expression 3 operands: lhs = Counter(1), rhs = Counter(3)
1010- expression 4 operands: lhs = Counter(3), rhs = Counter(2)
11Number of file 0 mappings: 25
11Number of file 0 mappings: 23
1212- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 67)
1313- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 16)
1414- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 21)
......@@ -17,7 +17,6 @@ Number of file 0 mappings: 25
1717- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14)
1818- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19)
1919- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21)
20- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29)
2120- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31)
2221- Code(Zero) at (prev + 1, 16) to (start + 1, 10)
2322- Code(Counter(2)) at (prev + 3, 13) to (start + 0, 14)
......@@ -30,7 +29,6 @@ Number of file 0 mappings: 25
3029- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18)
3130- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23)
3231- Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25)
33- Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33)
3432- Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35)
3533 = ((c0 + c2) - (c1 + c3))
3634- Code(Zero) at (prev + 1, 20) to (start + 1, 14)
......@@ -40,7 +38,7 @@ Number of file 0 mappings: 25
4038Highest counter ID seen: c2
4139
4240Function name: <loops_branches::DisplayTest as core::fmt::Display>::fmt
43Raw bytes (139): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 0d, 05, 0d, 09, 19, 01, 22, 05, 00, 43, 01, 01, 0c, 00, 11, 00, 00, 12, 01, 0a, 01, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 01, 00, 17, 00, 1d, 05, 00, 1e, 00, 1f, 09, 02, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 09, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 09, 00, 1b, 00, 21, 06, 00, 22, 00, 23, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06]
41Raw bytes (129): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 0d, 05, 0d, 09, 17, 01, 22, 05, 00, 43, 01, 01, 0c, 00, 11, 00, 00, 12, 01, 0a, 01, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 05, 00, 1e, 00, 1f, 09, 02, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 09, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 06, 00, 22, 00, 23, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06]
4442Number of files: 1
4543- file 0 => $DIR/loops_branches.rs
4644Number of expressions: 5
......@@ -49,7 +47,7 @@ Number of expressions: 5
4947- expression 2 operands: lhs = Counter(0), rhs = Counter(2)
5048- expression 3 operands: lhs = Counter(3), rhs = Counter(1)
5149- expression 4 operands: lhs = Counter(3), rhs = Counter(2)
52Number of file 0 mappings: 25
50Number of file 0 mappings: 23
5351- Code(Counter(0)) at (prev + 34, 5) to (start + 0, 67)
5452- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 17)
5553- Code(Zero) at (prev + 0, 18) to (start + 1, 10)
......@@ -59,7 +57,6 @@ Number of file 0 mappings: 25
5957- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14)
6058- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19)
6159- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21)
62- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29)
6360- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31)
6461- Code(Counter(2)) at (prev + 2, 13) to (start + 0, 14)
6562- Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 23)
......@@ -72,7 +69,6 @@ Number of file 0 mappings: 25
7269- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18)
7370- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23)
7471- Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25)
75- Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33)
7672- Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35)
7773 = ((c0 + c2) - (c3 + c1))
7874- Code(Expression(4, Sub)) at (prev + 3, 9) to (start + 0, 15)
......@@ -81,20 +77,18 @@ Number of file 0 mappings: 25
8177Highest counter ID seen: c2
8278
8379Function name: loops_branches::main
84Raw bytes (54): 0x[01, 01, 00, 0a, 01, 37, 01, 00, 0a, 01, 01, 09, 00, 13, 01, 00, 16, 00, 1f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 09, 00, 15, 01, 00, 18, 00, 23, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 12, 01, 01, 01, 00, 02]
80Raw bytes (44): 0x[01, 01, 00, 08, 01, 37, 01, 00, 0a, 01, 01, 09, 00, 13, 01, 00, 16, 00, 1f, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 15, 01, 00, 18, 00, 23, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
8581Number of files: 1
8682- file 0 => $DIR/loops_branches.rs
8783Number of expressions: 0
88Number of file 0 mappings: 10
84Number of file 0 mappings: 8
8985- Code(Counter(0)) at (prev + 55, 1) to (start + 0, 10)
9086- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19)
9187- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 31)
9288- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
93- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
9489- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21)
9590- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 35)
9691- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
97- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18)
9892- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
9993Highest counter ID seen: c0
10094
tests/coverage/macro_in_closure.cov-map+4-6
......@@ -1,22 +1,20 @@
11Function name: macro_in_closure::NO_BLOCK::{closure#0}
2Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 1c, 00, 24, 01, 00, 25, 00, 2c]
2Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 1c, 00, 24]
33Number of files: 1
44- file 0 => $DIR/macro_in_closure.rs
55Number of expressions: 0
6Number of file 0 mappings: 2
6Number of file 0 mappings: 1
77- Code(Counter(0)) at (prev + 7, 28) to (start + 0, 36)
8- Code(Counter(0)) at (prev + 0, 37) to (start + 0, 44)
98Highest counter ID seen: c0
109
1110Function name: macro_in_closure::WITH_BLOCK::{closure#0}
12Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 1e, 00, 1f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 15, 01, 01, 01, 00, 02]
11Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 1e, 00, 1f, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
1312Number of files: 1
1413- file 0 => $DIR/macro_in_closure.rs
1514Number of expressions: 0
16Number of file 0 mappings: 4
15Number of file 0 mappings: 3
1716- Code(Counter(0)) at (prev + 9, 30) to (start + 0, 31)
1817- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
19- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 21)
2018- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2119Highest counter ID seen: c0
2220
tests/coverage/no_cov_crate.cov-map+10-15
......@@ -1,36 +1,33 @@
11Function name: no_cov_crate::add_coverage_1
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/no_cov_crate.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 20)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34)
109- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
1312Function name: no_cov_crate::add_coverage_2
14Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02]
13Raw bytes (19): 0x[01, 01, 00, 03, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
1514Number of files: 1
1615- file 0 => $DIR/no_cov_crate.rs
1716Number of expressions: 0
18Number of file 0 mappings: 4
17Number of file 0 mappings: 3
1918- Code(Counter(0)) at (prev + 26, 1) to (start + 0, 20)
2019- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
21- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34)
2220- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2321Highest counter ID seen: c0
2422
2523Function name: no_cov_crate::add_coverage_not_called (unused)
26Raw bytes (24): 0x[01, 01, 00, 04, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02]
24Raw bytes (19): 0x[01, 01, 00, 03, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02]
2725Number of files: 1
2826- file 0 => $DIR/no_cov_crate.rs
2927Number of expressions: 0
30Number of file 0 mappings: 4
28Number of file 0 mappings: 3
3129- Code(Zero) at (prev + 31, 1) to (start + 0, 29)
3230- Code(Zero) at (prev + 1, 5) to (start + 0, 13)
33- Code(Zero) at (prev + 0, 14) to (start + 0, 38)
3431- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
3532Highest counter ID seen: (none)
3633
......@@ -57,28 +54,26 @@ Number of file 0 mappings: 14
5754Highest counter ID seen: c0
5855
5956Function name: no_cov_crate::nested_fns::outer
60Raw bytes (34): 0x[01, 01, 00, 06, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 1a, 01, 00, 1b, 00, 22, 01, 0a, 05, 00, 06]
57Raw bytes (29): 0x[01, 01, 00, 05, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 01, 09, 00, 1a, 01, 00, 1b, 00, 22, 01, 0a, 05, 00, 06]
6158Number of files: 1
6259- file 0 => $DIR/no_cov_crate.rs
6360Number of expressions: 0
64Number of file 0 mappings: 6
61Number of file 0 mappings: 5
6562- Code(Counter(0)) at (prev + 51, 5) to (start + 0, 32)
6663- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
67- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38)
6864- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 26)
6965- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34)
7066- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 6)
7167Highest counter ID seen: c0
7268
7369Function name: no_cov_crate::nested_fns::outer_both_covered
74Raw bytes (34): 0x[01, 01, 00, 06, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 0e, 01, 00, 0f, 00, 16, 01, 09, 05, 00, 06]
70Raw bytes (29): 0x[01, 01, 00, 05, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 01, 09, 00, 0e, 01, 00, 0f, 00, 16, 01, 09, 05, 00, 06]
7571Number of files: 1
7672- file 0 => $DIR/no_cov_crate.rs
7773Number of expressions: 0
78Number of file 0 mappings: 6
74Number of file 0 mappings: 5
7975- Code(Counter(0)) at (prev + 65, 5) to (start + 0, 45)
8076- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17)
81- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38)
8277- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14)
8378- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 22)
8479- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 6)
tests/coverage/overflow.cov-map+4-8
......@@ -1,5 +1,5 @@
11Function name: overflow::main
2Raw bytes (96): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 10, 01, 10, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 03, 0a, 09, 01, 11, 00, 17, 09, 00, 1a, 00, 28, 06, 02, 13, 00, 20, 0d, 00, 21, 03, 0a, 0d, 01, 11, 00, 17, 0d, 00, 1a, 00, 28, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
2Raw bytes (86): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0e, 01, 10, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 03, 0a, 09, 01, 11, 00, 17, 06, 02, 13, 00, 20, 0d, 00, 21, 03, 0a, 0d, 01, 11, 00, 17, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/overflow.rs
55Number of expressions: 6
......@@ -9,7 +9,7 @@ Number of expressions: 6
99- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add)
1010- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3)
1111- expression 5 operands: lhs = Counter(0), rhs = Counter(2)
12Number of file 0 mappings: 16
12Number of file 0 mappings: 14
1313- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 28)
1414- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
1515- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27)
......@@ -18,12 +18,10 @@ Number of file 0 mappings: 16
1818 = (c1 - c0)
1919- Code(Counter(2)) at (prev + 0, 27) to (start + 3, 10)
2020- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23)
21- Code(Counter(2)) at (prev + 0, 26) to (start + 0, 40)
2221- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32)
2322 = (c1 - (c0 + c2))
2423- Code(Counter(3)) at (prev + 0, 33) to (start + 3, 10)
2524- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 23)
26- Code(Counter(3)) at (prev + 0, 26) to (start + 0, 40)
2725- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10)
2826 = (c1 - ((c0 + c2) + c3))
2927- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23)
......@@ -33,12 +31,12 @@ Number of file 0 mappings: 16
3331Highest counter ID seen: c3
3432
3533Function name: overflow::might_overflow
36Raw bytes (76): 0x[01, 01, 01, 01, 05, 0e, 01, 05, 01, 00, 26, 01, 01, 08, 00, 12, 05, 00, 13, 02, 06, 02, 02, 05, 00, 06, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1e, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 26, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 21, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 2f, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
34Raw bytes (66): 0x[01, 01, 01, 01, 05, 0c, 01, 05, 01, 00, 26, 01, 01, 08, 00, 12, 05, 00, 13, 02, 06, 02, 02, 05, 00, 06, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1e, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 21, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02]
3735Number of files: 1
3836- file 0 => $DIR/overflow.rs
3937Number of expressions: 1
4038- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
41Number of file 0 mappings: 14
39Number of file 0 mappings: 12
4240- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 38)
4341- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 18)
4442- Code(Counter(1)) at (prev + 0, 19) to (start + 2, 6)
......@@ -47,11 +45,9 @@ Number of file 0 mappings: 14
4745- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15)
4846- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 30)
4947- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
50- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 38)
5148- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15)
5249- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 33)
5350- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
54- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 47)
5551- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11)
5652- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
5753Highest counter ID seen: c1
tests/coverage/panic_unwind.cov-map+2-3
......@@ -29,16 +29,15 @@ Number of file 0 mappings: 12
2929Highest counter ID seen: c3
3030
3131Function name: panic_unwind::might_panic
32Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 04, 01, 00, 23, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 00, 12, 00, 20, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02]
32Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 04, 01, 00, 23, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02]
3333Number of files: 1
3434- file 0 => $DIR/panic_unwind.rs
3535Number of expressions: 1
3636- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
37Number of file 0 mappings: 7
37Number of file 0 mappings: 6
3838- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 35)
3939- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20)
4040- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
41- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 32)
4241- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15)
4342- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6)
4443 = (c0 - c1)
tests/coverage/partial_eq.cov-map+3-4
......@@ -11,19 +11,18 @@ Number of file 0 mappings: 4
1111Highest counter ID seen: c0
1212
1313Function name: partial_eq::main
14Raw bytes (49): 0x[01, 01, 00, 09, 01, 11, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 02, 05, 00, 0d, 01, 01, 09, 00, 1b, 01, 03, 09, 00, 26, 01, 02, 01, 00, 02]
14Raw bytes (44): 0x[01, 01, 00, 08, 01, 11, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 02, 05, 00, 0d, 01, 04, 09, 00, 26, 01, 02, 01, 00, 02]
1515Number of files: 1
1616- file 0 => $DIR/partial_eq.rs
1717Number of expressions: 0
18Number of file 0 mappings: 9
18Number of file 0 mappings: 8
1919- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 10)
2020- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
2121- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37)
2222- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22)
2323- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37)
2424- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13)
25- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 27)
26- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 38)
25- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 38)
2726- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
2827Highest counter ID seen: c0
2928
tests/coverage/partial_eq.coverage+1-1
......@@ -19,7 +19,7 @@
1919 LL| 1| let version_3_3_0 = Version::new(3, 3, 0);
2020 LL| |
2121 LL| 1| println!(
22 LL| 1| "{:?} < {:?} = {}",
22 LL| | "{:?} < {:?} = {}",
2323 LL| | version_3_2_1,
2424 LL| | version_3_3_0,
2525 LL| 1| version_3_2_1 < version_3_3_0, //
tests/coverage/rustfmt-skip.cov-map+3-4
......@@ -1,12 +1,11 @@
11Function name: rustfmt_skip::main
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 0a, 01, 00, 0a, 01, 02, 05, 00, 0d, 01, 03, 09, 00, 10, 01, 02, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 0a, 01, 00, 0a, 01, 02, 05, 00, 0d, 01, 05, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/rustfmt-skip.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 10, 1) to (start + 0, 10)
88- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 16)
10- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2)
9- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
tests/coverage/rustfmt-skip.coverage+1-1
......@@ -12,7 +12,7 @@
1212 LL| 1| println!(
1313 LL| | // Keep this on a separate line, to distinguish instrumentation of
1414 LL| | // `println!` from instrumentation of its arguments.
15 LL| 1| "hello"
15 LL| | "hello"
1616 LL| | );
1717 LL| 1|}
1818
tests/coverage/sort_groups.cov-map+12-16
......@@ -1,63 +1,59 @@
11Function name: sort_groups::generic_fn::<&str>
2Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02]
2Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/sort_groups.rs
55Number of expressions: 1
66- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
7Number of file 0 mappings: 6
7Number of file 0 mappings: 5
88- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29)
99- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12)
1010- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6)
11- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
12- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6)
11- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
1312 = (c0 - c1)
1413- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1514Highest counter ID seen: c1
1615
1716Function name: sort_groups::generic_fn::<()>
18Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02]
17Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02]
1918Number of files: 1
2019- file 0 => $DIR/sort_groups.rs
2120Number of expressions: 1
2221- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
23Number of file 0 mappings: 6
22Number of file 0 mappings: 5
2423- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29)
2524- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12)
2625- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6)
27- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
28- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6)
26- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
2927 = (c0 - c1)
3028- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
3129Highest counter ID seen: c1
3230
3331Function name: sort_groups::generic_fn::<char>
34Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02]
32Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02]
3533Number of files: 1
3634- file 0 => $DIR/sort_groups.rs
3735Number of expressions: 1
3836- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
39Number of file 0 mappings: 6
37Number of file 0 mappings: 5
4038- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29)
4139- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12)
4240- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6)
43- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
44- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6)
41- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
4542 = (c0 - c1)
4643- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
4744Highest counter ID seen: c1
4845
4946Function name: sort_groups::generic_fn::<i32>
50Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 05, 01, 09, 00, 11, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02]
47Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 11, 01, 00, 1d, 01, 01, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02]
5148Number of files: 1
5249- file 0 => $DIR/sort_groups.rs
5350Number of expressions: 1
5451- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
55Number of file 0 mappings: 6
52Number of file 0 mappings: 5
5653- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29)
5754- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12)
5855- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6)
59- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17)
60- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6)
56- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6)
6157 = (c0 - c1)
6258- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
6359Highest counter ID seen: c1
tests/coverage/unused_mod.cov-map+4-6
......@@ -1,24 +1,22 @@
11Function name: unused_mod::main
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 1c, 01, 01, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/unused_mod.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 28)
109- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
1312Function name: unused_mod::unused_module::never_called_function (unused)
14Raw bytes (24): 0x[01, 02, 00, 04, 00, 02, 01, 00, 1f, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 21, 00, 01, 01, 00, 02]
13Raw bytes (19): 0x[01, 02, 00, 03, 00, 02, 01, 00, 1f, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02]
1514Number of files: 1
1615- file 0 => $DIR/auxiliary/unused_mod_helper.rs
1716Number of expressions: 0
18Number of file 0 mappings: 4
17Number of file 0 mappings: 3
1918- Code(Zero) at (prev + 2, 1) to (start + 0, 31)
2019- Code(Zero) at (prev + 1, 5) to (start + 0, 13)
21- Code(Zero) at (prev + 0, 14) to (start + 0, 33)
2220- Code(Zero) at (prev + 1, 1) to (start + 0, 2)
2321Highest counter ID seen: (none)
2422
tests/coverage/uses_crate.cov-map+8-12
......@@ -1,48 +1,44 @@
11Function name: used_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>>
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 1b, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 4f, 01, 01, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 1b, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/auxiliary/used_crate.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 76)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 79)
109- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
1312Function name: used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>
14Raw bytes (24): 0x[01, 01, 00, 04, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 46, 01, 01, 01, 00, 02]
13Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
1514Number of files: 1
1615- file 0 => $DIR/auxiliary/used_crate.rs
1716Number of expressions: 0
18Number of file 0 mappings: 4
17Number of file 0 mappings: 3
1918- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67)
2019- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
21- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70)
2220- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
2321Highest counter ID seen: c0
2422
2523Function name: used_crate::used_only_from_bin_crate_generic_function::<&str>
26Raw bytes (24): 0x[01, 01, 00, 04, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 46, 01, 01, 01, 00, 02]
24Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
2725Number of files: 1
2826- file 0 => $DIR/auxiliary/used_crate.rs
2927Number of expressions: 0
30Number of file 0 mappings: 4
28Number of file 0 mappings: 3
3129- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67)
3230- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
33- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70)
3431- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
3532Highest counter ID seen: c0
3633
3734Function name: used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>
38Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 5e, 01, 01, 01, 00, 02]
35Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
3936Number of files: 1
4037- file 0 => $DIR/auxiliary/used_crate.rs
4138Number of expressions: 0
42Number of file 0 mappings: 4
39Number of file 0 mappings: 3
4340- Code(Counter(0)) at (prev + 31, 1) to (start + 0, 91)
4441- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
45- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 94)
4642- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
4743Highest counter ID seen: c0
4844
tests/coverage/uses_inline_crate.cov-map+8-12
......@@ -1,12 +1,11 @@
11Function name: used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>>
2Raw bytes (24): 0x[01, 01, 00, 04, 01, 2c, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 4f, 01, 01, 01, 00, 02]
2Raw bytes (19): 0x[01, 01, 00, 03, 01, 2c, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
33Number of files: 1
44- file 0 => $DIR/auxiliary/used_inline_crate.rs
55Number of expressions: 0
6Number of file 0 mappings: 4
6Number of file 0 mappings: 3
77- Code(Counter(0)) at (prev + 44, 1) to (start + 0, 76)
88- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
9- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 79)
109- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
1110Highest counter ID seen: c0
1211
......@@ -31,38 +30,35 @@ Number of file 0 mappings: 10
3130Highest counter ID seen: c1
3231
3332Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>
34Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 46, 01, 01, 01, 00, 02]
33Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
3534Number of files: 1
3635- file 0 => $DIR/auxiliary/used_inline_crate.rs
3736Number of expressions: 0
38Number of file 0 mappings: 4
37Number of file 0 mappings: 3
3938- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67)
4039- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
41- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70)
4240- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
4341Highest counter ID seen: c0
4442
4543Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&str>
46Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 46, 01, 01, 01, 00, 02]
44Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
4745Number of files: 1
4846- file 0 => $DIR/auxiliary/used_inline_crate.rs
4947Number of expressions: 0
50Number of file 0 mappings: 4
48Number of file 0 mappings: 3
5149- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67)
5250- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
53- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70)
5451- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
5552Highest counter ID seen: c0
5653
5754Function name: used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str>
58Raw bytes (24): 0x[01, 01, 00, 04, 01, 31, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 5e, 01, 01, 01, 00, 02]
55Raw bytes (19): 0x[01, 01, 00, 03, 01, 31, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02]
5956Number of files: 1
6057- file 0 => $DIR/auxiliary/used_inline_crate.rs
6158Number of expressions: 0
62Number of file 0 mappings: 4
59Number of file 0 mappings: 3
6360- Code(Counter(0)) at (prev + 49, 1) to (start + 0, 91)
6461- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
65- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 94)
6662- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
6763Highest counter ID seen: c0
6864
tests/incremental/hashes/inherent_impls.rs+4-16
......@@ -72,15 +72,9 @@ impl Foo {
7272// This should affect the method itself, but not the impl.
7373#[cfg(any(cfail1,cfail4))]
7474impl Foo {
75 //------------
76 //---------------
77 //----------------------------------------------------------------
78 //
75 //-----------------------------------------------------------------------------
7976 //--------------------------
80 //------------
81 //---------------
82 //----------------------------------------------------------------
83 //
77 //-----------------------------------------------------------------------------
8478 //--------------------------
8579 #[inline]
8680 pub fn method_body_inlined() {
......@@ -94,15 +88,9 @@ impl Foo {
9488#[rustc_clean(cfg="cfail5")]
9589#[rustc_clean(cfg="cfail6")]
9690impl Foo {
97 #[rustc_clean(
98 cfg="cfail2",
99 except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck"
100 )]
91 #[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
10192 #[rustc_clean(cfg="cfail3")]
102 #[rustc_clean(
103 cfg="cfail5",
104 except="opt_hir_owner_nodes,optimized_mir,promoted_mir,typeck"
105 )]
93 #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
10694 #[rustc_clean(cfg="cfail6")]
10795 #[inline]
10896 pub fn method_body_inlined() {
tests/incremental/hygiene/auxiliary/cached_hygiene.rs+1-1
......@@ -13,7 +13,7 @@ macro_rules! first_macro {
1313 }
1414}
1515
16#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir,promoted_mir", cfg="rpass2")]
16#[rustc_clean(except="opt_hir_owner_nodes,typeck,optimized_mir", cfg="rpass2")]
1717#[inline(always)]
1818pub fn changed_fn() {
1919 // This will cause additional hygiene to be generate,
tests/incremental/string_constant.rs+1-1
......@@ -17,7 +17,7 @@ pub mod x {
1717 }
1818
1919 #[cfg(cfail2)]
20 #[rustc_clean(except = "opt_hir_owner_nodes,promoted_mir", cfg = "cfail2")]
20 #[rustc_clean(except = "opt_hir_owner_nodes,optimized_mir", cfg = "cfail2")]
2121 pub fn x() {
2222 println!("{}", "2");
2323 }
tests/mir-opt/gvn.slices.GVN.panic-abort.diff+10-5
......@@ -209,9 +209,10 @@
209209+ _27 = &(*_12);
210210 _26 = &(*_27);
211211 StorageLive(_28);
212 _28 = Option::<Arguments<'_>>::None;
212- _28 = Option::<Arguments<'_>>::None;
213213- _22 = assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind unreachable;
214+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind unreachable;
214+ _28 = const Option::<Arguments<'_>>::None;
215+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, const Option::<Arguments<'_>>::None) -> unwind unreachable;
215216 }
216217
217218 bb7: {
......@@ -311,11 +312,15 @@
311312+ _53 = &(*_38);
312313 _52 = &(*_53);
313314 StorageLive(_54);
314 _54 = Option::<Arguments<'_>>::None;
315- _54 = Option::<Arguments<'_>>::None;
315316- _48 = assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind unreachable;
316+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind unreachable;
317+ _54 = const Option::<Arguments<'_>>::None;
318+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, const Option::<Arguments<'_>>::None) -> unwind unreachable;
317319 }
318320 }
319321
320 ALLOC0 (size: 18, align: 1) { .. }
322- ALLOC0 (size: 18, align: 1) { .. }
323+ ALLOC0 (size: 16, align: 8) { .. }
324+
325+ ALLOC1 (size: 18, align: 1) { .. }
321326
tests/mir-opt/gvn.slices.GVN.panic-unwind.diff+10-5
......@@ -209,9 +209,10 @@
209209+ _27 = &(*_12);
210210 _26 = &(*_27);
211211 StorageLive(_28);
212 _28 = Option::<Arguments<'_>>::None;
212- _28 = Option::<Arguments<'_>>::None;
213213- _22 = assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind continue;
214+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, move _28) -> unwind continue;
214+ _28 = const Option::<Arguments<'_>>::None;
215+ _22 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _24, move _26, const Option::<Arguments<'_>>::None) -> unwind continue;
215216 }
216217
217218 bb7: {
......@@ -311,11 +312,15 @@
311312+ _53 = &(*_38);
312313 _52 = &(*_53);
313314 StorageLive(_54);
314 _54 = Option::<Arguments<'_>>::None;
315- _54 = Option::<Arguments<'_>>::None;
315316- _48 = assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind continue;
316+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, move _54) -> unwind continue;
317+ _54 = const Option::<Arguments<'_>>::None;
318+ _48 = assert_failed::<*const u8, *const u8>(const core::panicking::AssertKind::Eq, move _50, move _52, const Option::<Arguments<'_>>::None) -> unwind continue;
317319 }
318320 }
319321
320 ALLOC0 (size: 18, align: 1) { .. }
322- ALLOC0 (size: 18, align: 1) { .. }
323+ ALLOC0 (size: 16, align: 8) { .. }
324+
325+ ALLOC1 (size: 18, align: 1) { .. }
321326
tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir-1
......@@ -164,7 +164,6 @@ fn array_casts() -> () {
164164 _31 = &(*_32);
165165 StorageLive(_33);
166166 _33 = Option::<Arguments<'_>>::None;
167 Retag(_33);
168167 _27 = core::panicking::assert_failed::<usize, usize>(move _28, move _29, move _31, move _33) -> unwind unreachable;
169168 }
170169}
tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir-1
......@@ -164,7 +164,6 @@ fn array_casts() -> () {
164164 _31 = &(*_32);
165165 StorageLive(_33);
166166 _33 = Option::<Arguments<'_>>::None;
167 Retag(_33);
168167 _27 = core::panicking::assert_failed::<usize, usize>(move _28, move _29, move _31, move _33) -> unwind continue;
169168 }
170169}
tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff+52-51
......@@ -17,23 +17,22 @@
1717 let mut _17: &std::boxed::Box<dyn std::fmt::Display>;
1818 let mut _18: core::fmt::rt::Argument<'_>;
1919 let mut _19: &u32;
20 let mut _20: &[&str; 3];
21 let _21: &[&str; 3];
22 let _22: [&str; 3];
23 let mut _23: &[core::fmt::rt::Argument<'_>; 2];
24 let _24: &[core::fmt::rt::Argument<'_>; 2];
25 let mut _26: &std::boxed::Box<dyn std::fmt::Display>;
26 let mut _27: &u32;
27 let mut _28: bool;
20 let mut _20: &[u8; 7];
21 let _21: &[u8; 7];
22 let mut _22: &[core::fmt::rt::Argument<'_>; 2];
23 let _23: &[core::fmt::rt::Argument<'_>; 2];
24 let mut _24: &std::boxed::Box<dyn std::fmt::Display>;
25 let mut _25: &u32;
26 let mut _26: bool;
27 let mut _27: isize;
28 let mut _28: isize;
2829 let mut _29: isize;
29 let mut _30: isize;
30 let mut _31: isize;
31+ let _32: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
32+ let _33: u32;
30+ let _30: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
31+ let _31: u32;
3332 scope 1 {
3433- debug foo => _1;
35+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _32;
36+ debug ((foo: Foo<T>).1: u32) => _33;
34+ debug ((foo: Foo<T>).0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>) => _30;
35+ debug ((foo: Foo<T>).1: u32) => _31;
3736 let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>;
3837 scope 2 {
3938 debug x => _5;
......@@ -44,16 +43,15 @@
4443 debug x => _8;
4544 let _8: std::boxed::Box<dyn std::fmt::Display>;
4645 let _12: (&std::boxed::Box<dyn std::fmt::Display>, &u32);
47+ let _34: &std::boxed::Box<dyn std::fmt::Display>;
48+ let _35: &u32;
46+ let _32: &std::boxed::Box<dyn std::fmt::Display>;
47+ let _33: &u32;
4948 scope 5 {
5049- debug args => _12;
51+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).0: &std::boxed::Box<dyn std::fmt::Display>) => _34;
52+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).1: &u32) => _35;
50+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).0: &std::boxed::Box<dyn std::fmt::Display>) => _32;
51+ debug ((args: (&Box<dyn std::fmt::Display>, &u32)).1: &u32) => _33;
5352 let _15: [core::fmt::rt::Argument<'_>; 2];
5453 scope 6 {
5554 debug args => _15;
56 let mut _25: &[&str; 3];
5755 }
5856 }
5957 }
......@@ -62,10 +60,10 @@
6260 }
6361
6462 bb0: {
65 _28 = const false;
63 _26 = const false;
6664- StorageLive(_1);
67+ StorageLive(_32);
68+ StorageLive(_33);
65+ StorageLive(_30);
66+ StorageLive(_31);
6967+ nop;
7068 StorageLive(_2);
7169 StorageLive(_3);
......@@ -79,17 +77,17 @@
7977 _2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3);
8078 StorageDead(_3);
8179- _1 = Foo::<T> { x: move _2, y: const 7_u32 };
82+ _32 = move _2;
83+ _33 = const 7_u32;
80+ _30 = move _2;
81+ _31 = const 7_u32;
8482+ nop;
8583 StorageDead(_2);
8684 StorageLive(_5);
87 _28 = const true;
85 _26 = const true;
8886- _5 = move (_1.0: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>);
89+ _5 = move _32;
87+ _5 = move _30;
9088 StorageLive(_6);
9189- _6 = copy (_1.1: u32);
92+ _6 = copy _33;
90+ _6 = copy _31;
9391 _7 = discriminant(_5);
9492 switchInt(move _7) -> [0: bb2, otherwise: bb7];
9593 }
......@@ -101,25 +99,25 @@
10199 StorageLive(_10);
102100 StorageLive(_11);
103101- StorageLive(_12);
104+ StorageLive(_34);
105+ StorageLive(_35);
102+ StorageLive(_32);
103+ StorageLive(_33);
106104+ nop;
107105 StorageLive(_13);
108106 _13 = &_8;
109107 StorageLive(_14);
110108 _14 = &_6;
111109- _12 = (move _13, move _14);
112+ _34 = move _13;
113+ _35 = move _14;
110+ _32 = move _13;
111+ _33 = move _14;
114112+ nop;
115113 StorageDead(_14);
116114 StorageDead(_13);
117115 StorageLive(_15);
118116 StorageLive(_16);
119117 StorageLive(_17);
120- _26 = copy (_12.0: &std::boxed::Box<dyn std::fmt::Display>);
121+ _26 = copy _34;
122 _17 = &(*_26);
118- _24 = copy (_12.0: &std::boxed::Box<dyn std::fmt::Display>);
119+ _24 = copy _32;
120 _17 = &(*_24);
123121 _16 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _17) -> [return: bb3, unwind unreachable];
124122 }
125123
......@@ -127,9 +125,9 @@
127125 StorageDead(_17);
128126 StorageLive(_18);
129127 StorageLive(_19);
130- _27 = copy (_12.1: &u32);
131+ _27 = copy _35;
132 _19 = &(*_27);
128- _25 = copy (_12.1: &u32);
129+ _25 = copy _33;
130 _19 = &(*_25);
133131 _18 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _19) -> [return: bb4, unwind unreachable];
134132 }
135133
......@@ -140,19 +138,18 @@
140138 StorageDead(_16);
141139 StorageLive(_20);
142140 StorageLive(_21);
143 _25 = const foo::<T>::promoted[0];
144 _21 = &(*_25);
141 _21 = const b"\xc0\x01 \xc0\x01\n\x00";
145142 _20 = &(*_21);
143 StorageLive(_22);
146144 StorageLive(_23);
147 StorageLive(_24);
148 _24 = &_15;
149 _23 = &(*_24);
150 _11 = core::fmt::rt::<impl Arguments<'_>>::new_v1::<3, 2>(move _20, move _23) -> [return: bb5, unwind unreachable];
145 _23 = &_15;
146 _22 = &(*_23);
147 _11 = Arguments::<'_>::new::<7, 2>(move _20, move _22) -> [return: bb5, unwind unreachable];
151148 }
152149
153150 bb5: {
154 StorageDead(_24);
155151 StorageDead(_23);
152 StorageDead(_22);
156153 StorageDead(_21);
157154 StorageDead(_20);
158155 _10 = _eprint(move _11) -> [return: bb6, unwind unreachable];
......@@ -162,8 +159,8 @@
162159 StorageDead(_11);
163160 StorageDead(_15);
164161- StorageDead(_12);
165+ StorageDead(_34);
166+ StorageDead(_35);
162+ StorageDead(_32);
163+ StorageDead(_33);
167164+ nop;
168165 StorageDead(_10);
169166 _9 = const ();
......@@ -184,16 +181,16 @@
184181
185182 bb9: {
186183 StorageDead(_6);
187 _29 = discriminant(_5);
188 switchInt(move _29) -> [0: bb10, otherwise: bb11];
184 _27 = discriminant(_5);
185 switchInt(move _27) -> [0: bb10, otherwise: bb11];
189186 }
190187
191188 bb10: {
192 _28 = const false;
189 _26 = const false;
193190 StorageDead(_5);
194191- StorageDead(_1);
195+ StorageDead(_32);
196+ StorageDead(_33);
192+ StorageDead(_30);
193+ StorageDead(_31);
197194+ nop;
198195 return;
199196 }
......@@ -203,3 +200,7 @@
203200 }
204201 }
205202
203 ALLOC0 (size: 7, align: 1) {
204 c0 01 20 c0 01 0a 00 │ .. ....
205 }
206
tests/pretty/issue-4264.pp+3-4
......@@ -32,11 +32,10 @@ fn bar() ({
3232 ((::alloc::__export::must_use as
3333 fn(String) -> String {must_use::<String>})(({
3434 ((::alloc::fmt::format as
35 for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const
35 for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::from_str
3636 as
37 fn(&[&'static str; 1]) -> Arguments<'_> {core::fmt::rt::<impl Arguments<'_>>::new_const::<1>})((&([("test"
38 as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
39 as String)
37 fn(&'static str) -> Arguments<'_> {Arguments::<'_>::from_str})(("test"
38 as &str)) as Arguments<'_>)) as String)
4039 } as String)) as String);
4140} as ())
4241type Foo = [i32; (3 as usize)];
tests/run-make/symbol-mangling-hashed/rmake.rs+2-2
......@@ -61,7 +61,7 @@ fn main() {
6161 }
6262
6363 let expected_prefix = adjust_symbol_prefix!("_RNxC12hashed_dylib");
64 if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_prefix)).count() != 2 {
64 if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_prefix)).count() != 1 {
6565 eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
6666 panic!("expected two dynamic symbols starting with `{expected_prefix}`");
6767 }
......@@ -88,7 +88,7 @@ fn main() {
8888 }
8989
9090 let expected_rlib_prefix = adjust_symbol_prefix!("_RNxC11hashed_rlib");
91 if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_rlib_prefix)).count() != 2 {
91 if dynamic_symbols.iter().filter(|sym| sym.starts_with(expected_rlib_prefix)).count() != 1 {
9292 eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols);
9393 panic!("expected two exported symbols starting with `{expected_rlib_prefix}`");
9494 }
tests/ui/consts/recursive-const-in-impl.stderr+1-1
......@@ -5,7 +5,7 @@ LL | println!("{}", Thing::<i32>::X);
55 | ^^^^^^^^^^^^^^^
66 |
77 = help: consider increasing the recursion limit by adding a `#![recursion_limit = "14"]` attribute to your crate (`recursive_const_in_impl`)
8 = note: query depth increased by 9 when simplifying constant for the type system `main::promoted[1]`
8 = note: query depth increased by 9 when simplifying constant for the type system `main::promoted[0]`
99 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
1010
1111error: aborting due to 1 previous error
tests/ui/unpretty/exhaustive.hir.stdout+2-2
......@@ -390,11 +390,11 @@ mod expressions {
390390 /// ExprKind::FormatArgs
391391 fn expr_format_args() {
392392 let expr;
393 format_arguments::new_const(&[]);
393 format_arguments::from_str("");
394394 {
395395 super let args = (&expr,);
396396 super let args = [format_argument::new_display(args.0)];
397 format_arguments::new_v1(&[""], &args)
397 unsafe { format_arguments::new(b"\xc0\x00", &args) }
398398 };
399399 }
400400}
tests/ui/unpretty/flattened-format-args.stdout+4-1
......@@ -13,7 +13,10 @@ fn main() {
1313 ::std::io::_print({
1414 super let args = (&x,);
1515 super let args = [format_argument::new_display(args.0)];
16 format_arguments::new_v1(&["a 123 b ", " xyz\n"], &args)
16 unsafe {
17 format_arguments::new(b"\x08a 123 b \xc0\x05 xyz\n\x00",
18 &args)
19 }
1720 });
1821 };
1922}