| author | bors <bors@rust-lang.org> 2025-11-12 23:21:24 UTC |
| committer | bors <bors@rust-lang.org> 2025-11-12 23:21:24 UTC |
| log | 503dce33e2e2a5d2fe978b2723ab2a994cc27472 |
| tree | 72ca3e99701da0f1b1953b9119679a2b00243dce |
| parent | 01867557cd7dbe256a031a7b8e28d05daecd75ab |
| parent | cfbdc2c36d002ed80dbc1cd918d84f6c18e901be |
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; |
| 13 | 13 | use rustc_middle::ty::TyCtxt; |
| 14 | 14 | use rustc_session::errors::report_lit_error; |
| 15 | 15 | use rustc_span::source_map::{Spanned, respan}; |
| 16 | use rustc_span::{DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym}; | |
| 16 | use rustc_span::{ByteSymbol, DUMMY_SP, DesugaringKind, Ident, Span, Symbol, sym}; | |
| 17 | 17 | use thin_vec::{ThinVec, thin_vec}; |
| 18 | 18 | use visit::{Visitor, walk_expr}; |
| 19 | 19 | |
| ... | ... | @@ -924,7 +924,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 924 | 924 | arena_vec![self; new_unchecked, get_context], |
| 925 | 925 | ), |
| 926 | 926 | }; |
| 927 | self.arena.alloc(self.expr_unsafe(call)) | |
| 927 | self.arena.alloc(self.expr_unsafe(span, call)) | |
| 928 | 928 | }; |
| 929 | 929 | |
| 930 | 930 | // `::std::task::Poll::Ready(result) => break result` |
| ... | ... | @@ -1832,7 +1832,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 1832 | 1832 | arena_vec![self; iter], |
| 1833 | 1833 | )); |
| 1834 | 1834 | // `unsafe { ... }` |
| 1835 | let iter = self.arena.alloc(self.expr_unsafe(iter)); | |
| 1835 | let iter = self.arena.alloc(self.expr_unsafe(head_span, iter)); | |
| 1836 | 1836 | let kind = self.make_lowered_await(head_span, iter, FutureKind::AsyncIterator); |
| 1837 | 1837 | self.arena.alloc(hir::Expr { hir_id: self.next_id(), kind, span: head_span }) |
| 1838 | 1838 | } |
| ... | ... | @@ -1887,7 +1887,7 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 1887 | 1887 | arena_vec![self; iter], |
| 1888 | 1888 | )); |
| 1889 | 1889 | // `unsafe { ... }` |
| 1890 | let iter = self.arena.alloc(self.expr_unsafe(iter)); | |
| 1890 | let iter = self.arena.alloc(self.expr_unsafe(head_span, iter)); | |
| 1891 | 1891 | let inner_match_expr = self.arena.alloc(self.expr_match( |
| 1892 | 1892 | for_span, |
| 1893 | 1893 | iter, |
| ... | ... | @@ -2103,30 +2103,18 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 2103 | 2103 | self.arena.alloc(self.expr(sp, hir::ExprKind::Tup(&[]))) |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 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> { | |
| 2107 | 2107 | let lit = hir::Lit { |
| 2108 | 2108 | 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), | |
| 2110 | 2110 | }; |
| 2111 | 2111 | self.expr(sp, hir::ExprKind::Lit(lit)) |
| 2112 | 2112 | } |
| 2113 | 2113 | |
| 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> { | |
| 2127 | 2115 | let lit = hir::Lit { |
| 2128 | 2116 | span: self.lower_span(sp), |
| 2129 | node: ast::LitKind::Str(value, ast::StrStyle::Cooked), | |
| 2117 | node: ast::LitKind::ByteStr(value, ast::StrStyle::Cooked), | |
| 2130 | 2118 | }; |
| 2131 | 2119 | self.expr(sp, hir::ExprKind::Lit(lit)) |
| 2132 | 2120 | } |
| ... | ... | @@ -2262,9 +2250,12 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 2262 | 2250 | self.expr(span, expr_path) |
| 2263 | 2251 | } |
| 2264 | 2252 | |
| 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> { | |
| 2266 | 2258 | let hir_id = self.next_id(); |
| 2267 | let span = expr.span; | |
| 2268 | 2259 | self.expr( |
| 2269 | 2260 | span, |
| 2270 | 2261 | hir::ExprKind::Block( |
| ... | ... | @@ -2302,15 +2293,6 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 2302 | 2293 | self.arena.alloc(self.expr_block(b)) |
| 2303 | 2294 | } |
| 2304 | 2295 | |
| 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 | ||
| 2314 | 2296 | pub(super) fn expr_ref(&mut self, span: Span, expr: &'hir hir::Expr<'hir>) -> hir::Expr<'hir> { |
| 2315 | 2297 | self.expr(span, hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Not, expr)) |
| 2316 | 2298 | } |
compiler/rustc_ast_lowering/src/format.rs+194-260| ... | ... | @@ -4,7 +4,7 @@ use rustc_ast::*; |
| 4 | 4 | use rustc_data_structures::fx::FxIndexMap; |
| 5 | 5 | use rustc_hir as hir; |
| 6 | 6 | use rustc_session::config::FmtDebug; |
| 7 | use rustc_span::{DesugaringKind, Ident, Span, Symbol, sym}; | |
| 7 | use rustc_span::{ByteSymbol, DesugaringKind, Ident, Span, Symbol, sym}; | |
| 8 | 8 | |
| 9 | 9 | use super::LoweringContext; |
| 10 | 10 | |
| ... | ... | @@ -90,20 +90,14 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 90 | 90 | let mut inlined_anything = false; |
| 91 | 91 | |
| 92 | 92 | 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 | |
| 99 | 96 | && placeholder.format_options == Default::default() |
| 100 | 97 | && let arg = fmt.arguments.all_args()[arg_index].expr.peel_parens_and_refs() |
| 101 | 98 | && let ExprKind::Lit(lit) = arg.kind |
| 99 | && let Some(literal) = self.try_inline_lit(lit) | |
| 102 | 100 | { |
| 103 | literal = self.try_inline_lit(lit); | |
| 104 | } | |
| 105 | ||
| 106 | if let Some(literal) = literal { | |
| 107 | 101 | // Now we need to mutate the outer FormatArgs. |
| 108 | 102 | // If this is the first time, this clones the outer FormatArgs. |
| 109 | 103 | let fmt = fmt.to_mut(); |
| ... | ... | @@ -265,136 +259,21 @@ fn make_argument<'hir>( |
| 265 | 259 | ctx.expr_call_mut(sp, new_fn, std::slice::from_ref(arg)) |
| 266 | 260 | } |
| 267 | 261 | |
| 268 | /// Generate a hir expression for a format_args Count. | |
| 269 | /// | |
| 270 | /// Generates: | |
| 262 | /// Get the value for a `width` or `precision` field. | |
| 271 | 263 | /// |
| 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 | /// ``` | |
| 287 | fn 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. | |
| 265 | fn make_count( | |
| 266 | count: &FormatCount, | |
| 291 | 267 | argmap: &mut FxIndexMap<(usize, ArgumentType), Option<Span>>, |
| 292 | ) -> hir::Expr<'hir> { | |
| 268 | ) -> (bool, u16) { | |
| 293 | 269 | 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 | /// ``` | |
| 338 | fn 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, | |
| 355 | 275 | ), |
| 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 | } | |
| 398 | 277 | } |
| 399 | 278 | |
| 400 | 279 | fn expand_format_args<'hir>( |
| ... | ... | @@ -405,85 +284,152 @@ fn expand_format_args<'hir>( |
| 405 | 284 | ) -> hir::ExprKind<'hir> { |
| 406 | 285 | let macsp = ctx.lower_span(macsp); |
| 407 | 286 | |
| 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 | ||
| 408 | 294 | 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); | |
| 425 | 341 | } |
| 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); | |
| 430 | 348 | } else { |
| 431 | None | |
| 349 | bytecode.push(0x80); | |
| 350 | bytecode.extend_from_slice(&(len as u16).to_le_bytes()); | |
| 432 | 351 | } |
| 352 | bytecode.extend(&s.as_bytes()[..len]); | |
| 353 | s = &s[len..]; | |
| 433 | 354 | } |
| 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; | |
| 441 | 355 | |
| 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; | |
| 459 | 417 | } |
| 460 | 418 | } |
| 461 | 419 | } |
| 462 | 420 | |
| 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()); | |
| 472 | 422 | |
| 473 | let arguments = fmt.arguments.all_args(); | |
| 423 | // Zero terminator. | |
| 424 | bytecode.push(0); | |
| 474 | 425 | |
| 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"); | |
| 485 | 429 | } |
| 486 | 430 | |
| 431 | let arguments = fmt.arguments.all_args(); | |
| 432 | ||
| 487 | 433 | let (let_statements, args) = if arguments.is_empty() { |
| 488 | 434 | // Generate: |
| 489 | 435 | // [] |
| ... | ... | @@ -512,22 +458,30 @@ fn expand_format_args<'hir>( |
| 512 | 458 | // ]; |
| 513 | 459 | let args = ctx.arena.alloc_from_iter(argmap.iter().map( |
| 514 | 460 | |(&(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 | } | |
| 531 | 485 | }, |
| 532 | 486 | )); |
| 533 | 487 | let args = ctx.arena.alloc(ctx.expr(macsp, hir::ExprKind::Array(args))); |
| ... | ... | @@ -540,58 +494,38 @@ fn expand_format_args<'hir>( |
| 540 | 494 | }; |
| 541 | 495 | |
| 542 | 496 | // 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( | |
| 581 | 503 | macsp, |
| 582 | 504 | hir::LangItem::FormatArguments, |
| 583 | sym::new_v1, | |
| 505 | sym::new, | |
| 584 | 506 | )); |
| 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) | |
| 587 | 510 | }; |
| 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 | ); | |
| 588 | 522 | |
| 589 | 523 | if !let_statements.is_empty() { |
| 590 | 524 | // Generate: |
| 591 | 525 | // { |
| 592 | 526 | // super let … |
| 593 | 527 | // super let … |
| 594 | // <core::fmt::Arguments>::new_…(…) | |
| 528 | // <core::fmt::Arguments>::new(…) | |
| 595 | 529 | // } |
| 596 | 530 | let call = ctx.arena.alloc(ctx.expr(macsp, call)); |
| 597 | 531 | 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! { |
| 329 | 329 | // Lang items needed for `format_args!()`. |
| 330 | 330 | FormatArgument, sym::format_argument, format_argument, Target::Struct, GenericRequirement::None; |
| 331 | 331 | 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; | |
| 335 | 332 | |
| 336 | 333 | ExchangeMalloc, sym::exchange_malloc, exchange_malloc_fn, Target::Fn, GenericRequirement::None; |
| 337 | 334 | 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! { |
| 1096 | 1096 | format_args_nl, |
| 1097 | 1097 | format_argument, |
| 1098 | 1098 | format_arguments, |
| 1099 | format_count, | |
| 1100 | 1099 | format_macro, |
| 1101 | format_placeholder, | |
| 1102 | format_unsafe_arg, | |
| 1103 | 1100 | framework, |
| 1104 | 1101 | freeze, |
| 1105 | 1102 | freeze_impls, |
| ... | ... | @@ -1114,7 +1111,9 @@ symbols! { |
| 1114 | 1111 | from_output, |
| 1115 | 1112 | from_residual, |
| 1116 | 1113 | from_size_align_unchecked, |
| 1114 | from_str, | |
| 1117 | 1115 | from_str_method, |
| 1116 | from_str_nonconst, | |
| 1118 | 1117 | from_u16, |
| 1119 | 1118 | from_usize, |
| 1120 | 1119 | from_yeet, |
library/core/src/fmt/mod.rs+305-103| ... | ... | @@ -4,10 +4,12 @@ |
| 4 | 4 | |
| 5 | 5 | use crate::cell::{Cell, Ref, RefCell, RefMut, SyncUnsafeCell, UnsafeCell}; |
| 6 | 6 | use crate::char::{EscapeDebugExtArgs, MAX_LEN_UTF8}; |
| 7 | use crate::hint::assert_unchecked; | |
| 7 | 8 | use crate::marker::{PhantomData, PointeeSized}; |
| 8 | 9 | use crate::num::fmt as numfmt; |
| 9 | 10 | use crate::ops::Deref; |
| 10 | use crate::{iter, result, str}; | |
| 11 | use crate::ptr::NonNull; | |
| 12 | use crate::{iter, mem, result, str}; | |
| 11 | 13 | |
| 12 | 14 | mod builders; |
| 13 | 15 | #[cfg(not(no_fp_fmt_parse))] |
| ... | ... | @@ -288,7 +290,7 @@ pub struct FormattingOptions { |
| 288 | 290 | /// ```text |
| 289 | 291 | /// 31 30 29 28 27 26 25 24 23 22 21 20 0 |
| 290 | 292 | /// ┌───┬───────┬───┬───┬───┬───┬───┬───┬───┬───┬──────────────────────────────────┐ |
| 291 | /// │ 1 │ align │ p │ w │ X?│ x?│'0'│ # │ - │ + │ fill │ | |
| 293 | /// │ 0 │ align │ p │ w │ X?│ x?│'0'│ # │ - │ + │ fill │ | |
| 292 | 294 | /// └───┴───────┴───┴───┴───┴───┴───┴───┴───┴───┴──────────────────────────────────┘ |
| 293 | 295 | /// │ │ │ │ └─┬───────────────────┘ └─┬──────────────────────────────┘ |
| 294 | 296 | /// │ │ │ │ │ └─ The fill character (21 bits char). |
| ... | ... | @@ -299,12 +301,9 @@ pub struct FormattingOptions { |
| 299 | 301 | /// │ ├─ 1: Align right. (>) |
| 300 | 302 | /// │ ├─ 2: Align center. (^) |
| 301 | 303 | /// │ └─ 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. | |
| 306 | 305 | /// ``` |
| 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. | |
| 308 | 307 | // It's unclear if that's useful, though. |
| 309 | 308 | flags: u32, |
| 310 | 309 | /// Width if width flag (bit 27) above is set. Otherwise, always 0. |
| ... | ... | @@ -328,7 +327,6 @@ mod flags { |
| 328 | 327 | pub(super) const ALIGN_RIGHT: u32 = 1 << 29; |
| 329 | 328 | pub(super) const ALIGN_CENTER: u32 = 2 << 29; |
| 330 | 329 | pub(super) const ALIGN_UNKNOWN: u32 = 3 << 29; |
| 331 | pub(super) const ALWAYS_SET: u32 = 1 << 31; | |
| 332 | 330 | } |
| 333 | 331 | |
| 334 | 332 | impl FormattingOptions { |
| ... | ... | @@ -344,11 +342,7 @@ impl FormattingOptions { |
| 344 | 342 | /// - no [`DebugAsHex`] output mode. |
| 345 | 343 | #[unstable(feature = "formatting_options", issue = "118117")] |
| 346 | 344 | 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 } | |
| 352 | 346 | } |
| 353 | 347 | |
| 354 | 348 | /// Sets or removes the sign (the `+` or the `-` flag). |
| ... | ... | @@ -612,19 +606,152 @@ impl<'a> Formatter<'a> { |
| 612 | 606 | /// ``` |
| 613 | 607 | /// |
| 614 | 608 | /// [`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 | // | |
| 615 | 713 | #[lang = "format_arguments"] |
| 616 | 714 | #[stable(feature = "rust1", since = "1.0.0")] |
| 617 | 715 | #[derive(Copy, Clone)] |
| 618 | 716 | pub 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")] | |
| 725 | impl<'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 | } | |
| 621 | 736 | |
| 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 | } | |
| 624 | 747 | |
| 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 | } | |
| 628 | 755 | } |
| 629 | 756 | |
| 630 | 757 | #[doc(hidden)] |
| ... | ... | @@ -636,20 +763,56 @@ impl<'a> Arguments<'a> { |
| 636 | 763 | /// when using `format!`. Note: this is neither the lower nor upper bound. |
| 637 | 764 | #[inline] |
| 638 | 765 | 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 | } | |
| 640 | 805 | |
| 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, | |
| 645 | 808 | // don't preallocate anything, unless length |
| 646 | // of pieces is significant. | |
| 809 | // of literal pieces is significant. | |
| 647 | 810 | 0 |
| 648 | 811 | } else { |
| 649 | // There are some arguments, so any additional push | |
| 812 | // There are some placeholders, so any additional push | |
| 650 | 813 | // will reallocate the string. To avoid that, |
| 651 | 814 | // we're "pre-doubling" the capacity here. |
| 652 | pieces_length.checked_mul(2).unwrap_or(0) | |
| 815 | length.wrapping_mul(2) | |
| 653 | 816 | } |
| 654 | 817 | } |
| 655 | 818 | } |
| ... | ... | @@ -702,10 +865,22 @@ impl<'a> Arguments<'a> { |
| 702 | 865 | #[must_use] |
| 703 | 866 | #[inline] |
| 704 | 867 | 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 | |
| 709 | 884 | } |
| 710 | 885 | } |
| 711 | 886 | |
| ... | ... | @@ -1448,86 +1623,113 @@ pub trait UpperExp: PointeeSized { |
| 1448 | 1623 | /// |
| 1449 | 1624 | /// [`write!`]: crate::write! |
| 1450 | 1625 | #[stable(feature = "rust1", since = "1.0.0")] |
| 1451 | pub 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 | } | |
| 1626 | pub fn write(output: &mut dyn Write, fmt: Arguments<'_>) -> Result { | |
| 1627 | if let Some(s) = fmt.as_str() { | |
| 1628 | return output.write_str(s); | |
| 1490 | 1629 | } |
| 1491 | 1630 | |
| 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; | |
| 1496 | 1633 | |
| 1497 | Ok(()) | |
| 1498 | } | |
| 1634 | let mut arg_index = 0; | |
| 1499 | 1635 | |
| 1500 | unsafe 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. | |
| 1505 | 1637 | |
| 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 | }; | |
| 1507 | 1647 | |
| 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) }; | |
| 1513 | 1688 | |
| 1514 | // Set all the formatting options. | |
| 1515 | fmt.options = options; | |
| 1689 | // Placeholder with custom options. | |
| 1516 | 1690 | |
| 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(); | |
| 1521 | 1692 | |
| 1522 | unsafe 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; | |
| 1531 | 1733 | } |
| 1532 | 1734 | } |
| 1533 | 1735 | } |
library/core/src/fmt/rt.rs+1-74| ... | ... | @@ -10,28 +10,6 @@ use super::*; |
| 10 | 10 | use crate::hint::unreachable_unchecked; |
| 11 | 11 | use crate::ptr::NonNull; |
| 12 | 12 | |
| 13 | #[lang = "format_placeholder"] | |
| 14 | #[derive(Copy, Clone)] | |
| 15 | pub 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)] | |
| 26 | pub 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 | ||
| 35 | 13 | #[derive(Copy, Clone)] |
| 36 | 14 | enum ArgumentType<'a> { |
| 37 | 15 | Placeholder { |
| ... | ... | @@ -56,6 +34,7 @@ enum ArgumentType<'a> { |
| 56 | 34 | /// precision and width. |
| 57 | 35 | #[lang = "format_argument"] |
| 58 | 36 | #[derive(Copy, Clone)] |
| 37 | #[repr(align(2))] // To ensure pointers to this struct always have their lowest bit cleared. | |
| 59 | 38 | pub struct Argument<'a> { |
| 60 | 39 | ty: ArgumentType<'a>, |
| 61 | 40 | } |
| ... | ... | @@ -184,55 +163,3 @@ impl Argument<'_> { |
| 184 | 163 | } |
| 185 | 164 | } |
| 186 | 165 | } |
| 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"] | |
| 192 | impl<'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 |
| 136 | 136 | #[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable |
| 137 | 137 | #[lang = "panic"] // used by lints and miri for panics |
| 138 | 138 | pub 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 | |
| 140 | 140 | // reduce size overhead. The format_args! macro uses str's Display trait to |
| 141 | 141 | // write expr, which calls Formatter::pad, which must accommodate string |
| 142 | 142 | // 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 | |
| 144 | 144 | // 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 | |
| 146 | 146 | // message return `Some` from `Arguments::as_str`, which means it can become part of the panic |
| 147 | 147 | // payload without any allocation or copying. Shorter-lived strings would become invalid as |
| 148 | 148 | // stack frames get popped during unwinding, and couldn't be directly referenced from the |
| 149 | 149 | // payload. |
| 150 | panic_fmt(fmt::Arguments::new_const(&[expr])); | |
| 150 | panic_fmt(fmt::Arguments::from_str(expr)); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | // We generate functions for usage by compiler-generated assertions. |
| ... | ... | @@ -171,13 +171,8 @@ macro_rules! panic_const { |
| 171 | 171 | #[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable |
| 172 | 172 | #[lang = stringify!($lang)] |
| 173 | 173 | 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)); | |
| 181 | 176 | } |
| 182 | 177 | )+ |
| 183 | 178 | } |
| ... | ... | @@ -227,7 +222,7 @@ pub mod panic_const { |
| 227 | 222 | #[rustc_nounwind] |
| 228 | 223 | #[rustc_const_stable_indirect] // must follow stable const rules since it is exposed to stable |
| 229 | 224 | pub 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); | |
| 231 | 226 | } |
| 232 | 227 | |
| 233 | 228 | /// Like `panic_nounwind`, but also inhibits showing a backtrace. |
| ... | ... | @@ -235,7 +230,7 @@ pub const fn panic_nounwind(expr: &'static str) -> ! { |
| 235 | 230 | #[cfg_attr(panic = "immediate-abort", inline)] |
| 236 | 231 | #[rustc_nounwind] |
| 237 | 232 | pub 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); | |
| 239 | 234 | } |
| 240 | 235 | |
| 241 | 236 | #[inline] |
library/core/src/ub_checks.rs+1-1| ... | ... | @@ -70,7 +70,7 @@ macro_rules! assert_unsafe_precondition { |
| 70 | 70 | let msg = concat!("unsafe precondition(s) violated: ", $message, |
| 71 | 71 | "\n\nThis indicates a bug in the program. \ |
| 72 | 72 | 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); | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 |
src/tools/clippy/clippy_utils/src/sym.rs-1| ... | ... | @@ -166,7 +166,6 @@ generate! { |
| 166 | 166 | from_ne_bytes, |
| 167 | 167 | from_ptr, |
| 168 | 168 | from_raw, |
| 169 | from_str, | |
| 170 | 169 | from_str_radix, |
| 171 | 170 | fs, |
| 172 | 171 | fuse, |
src/tools/clippy/tests/ui/author/macro_in_closure.stdout+9-12| ... | ... | @@ -30,19 +30,16 @@ if let StmtKind::Let(local) = stmt.kind |
| 30 | 30 | && let PatKind::Binding(BindingMode::NONE, _, name1, None) = local2.pat.kind |
| 31 | 31 | && name1.as_str() == "args" |
| 32 | 32 | && 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 | |
| 35 | 38 | && 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 | |
| 46 | 43 | && block.expr.is_none() |
| 47 | 44 | && let PatKind::Binding(BindingMode::NONE, _, name2, None) = local.pat.kind |
| 48 | 45 | && 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 |
| 41 | 41 | && let PatKind::Binding(BindingMode::NONE, _, name2, None) = local1.pat.kind |
| 42 | 42 | && name2.as_str() == "args" |
| 43 | 43 | && 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 | |
| 46 | 49 | && 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 | |
| 57 | 54 | && block1.expr.is_none() |
| 58 | 55 | && block.expr.is_none() |
| 59 | 56 | { |
tests/codegen-units/item-collection/opaque-return-impls.rs+1-1| ... | ... | @@ -86,4 +86,4 @@ pub fn foo3() -> Box<dyn Iterator<Item = usize>> { |
| 86 | 86 | //~ MONO_ITEM fn foo3 |
| 87 | 87 | //~ MONO_ITEM fn std::boxed::Box::<Counter>::new |
| 88 | 88 | //~ 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 |
| 37 | 37 | Highest counter ID seen: c4 |
| 38 | 38 | |
| 39 | 39 | Function name: abort::might_abort |
| 40 | Raw 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] | |
| 40 | Raw 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] | |
| 41 | 41 | Number of files: 1 |
| 42 | 42 | - file 0 => $DIR/abort.rs |
| 43 | 43 | Number of expressions: 1 |
| 44 | 44 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 45 | Number of file 0 mappings: 7 | |
| 45 | Number of file 0 mappings: 6 | |
| 46 | 46 | - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 46) |
| 47 | 47 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20) |
| 48 | 48 | - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17) |
| 49 | - Code(Counter(1)) at (prev + 0, 18) to (start + 0, 31) | |
| 50 | 49 | - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) |
| 51 | 50 | - Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6) |
| 52 | 51 | = (c0 - c1) |
tests/coverage/assert.cov-map+3-7| ... | ... | @@ -29,18 +29,14 @@ Number of file 0 mappings: 12 |
| 29 | 29 | Highest counter ID seen: c3 |
| 30 | 30 | |
| 31 | 31 | Function name: assert::might_fail_assert |
| 32 | Raw 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] | |
| 32 | Raw 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] | |
| 33 | 33 | Number of files: 1 |
| 34 | 34 | - file 0 => $DIR/assert.rs |
| 35 | Number of expressions: 1 | |
| 36 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) | |
| 37 | Number of file 0 mappings: 6 | |
| 35 | Number of expressions: 0 | |
| 36 | Number of file 0 mappings: 4 | |
| 38 | 37 | - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40) |
| 39 | 38 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 40 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32) | |
| 41 | 39 | - 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) | |
| 44 | 40 | - Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) |
| 45 | 41 | Highest counter ID seen: c1 |
| 46 | 42 |
tests/coverage/assert.coverage-1| ... | ... | @@ -4,7 +4,6 @@ |
| 4 | 4 | LL| 4|fn might_fail_assert(one_plus_one: u32) { |
| 5 | 5 | LL| 4| println!("does 1 + 1 = {}?", one_plus_one); |
| 6 | 6 | LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); |
| 7 | ^1 | |
| 8 | 7 | LL| 3|} |
| 9 | 8 | LL| | |
| 10 | 9 | LL| 1|fn main() -> Result<(), u8> { |
tests/coverage/async2.cov-map+8-12| ... | ... | @@ -8,14 +8,13 @@ Number of file 0 mappings: 1 |
| 8 | 8 | Highest counter ID seen: c0 |
| 9 | 9 | |
| 10 | 10 | Function name: async2::async_func::{closure#0} |
| 11 | Raw 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] | |
| 11 | Raw 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] | |
| 12 | 12 | Number of files: 1 |
| 13 | 13 | - file 0 => $DIR/async2.rs |
| 14 | 14 | Number of expressions: 0 |
| 15 | Number of file 0 mappings: 9 | |
| 15 | Number of file 0 mappings: 8 | |
| 16 | 16 | - Code(Counter(0)) at (prev + 15, 23) to (start + 0, 24) |
| 17 | 17 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 18 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 38) | |
| 19 | 18 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) |
| 20 | 19 | - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17) |
| 21 | 20 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9) |
| ... | ... | @@ -34,26 +33,24 @@ Number of file 0 mappings: 1 |
| 34 | 33 | Highest counter ID seen: c0 |
| 35 | 34 | |
| 36 | 35 | Function name: async2::async_func_just_println::{closure#0} |
| 37 | Raw 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] | |
| 36 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 17, 24, 00, 25, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 38 | 37 | Number of files: 1 |
| 39 | 38 | - file 0 => $DIR/async2.rs |
| 40 | 39 | Number of expressions: 0 |
| 41 | Number of file 0 mappings: 4 | |
| 40 | Number of file 0 mappings: 3 | |
| 42 | 41 | - Code(Counter(0)) at (prev + 23, 36) to (start + 0, 37) |
| 43 | 42 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 44 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 51) | |
| 45 | 43 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 46 | 44 | Highest counter ID seen: c0 |
| 47 | 45 | |
| 48 | 46 | Function name: async2::main |
| 49 | Raw 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] | |
| 47 | Raw 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] | |
| 50 | 48 | Number of files: 1 |
| 51 | 49 | - file 0 => $DIR/async2.rs |
| 52 | 50 | Number of expressions: 0 |
| 53 | Number of file 0 mappings: 9 | |
| 51 | Number of file 0 mappings: 8 | |
| 54 | 52 | - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 10) |
| 55 | 53 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 56 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 35) | |
| 57 | 54 | - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 19) |
| 58 | 55 | - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 23) |
| 59 | 56 | - Code(Counter(0)) at (prev + 0, 24) to (start + 0, 34) |
| ... | ... | @@ -63,14 +60,13 @@ Number of file 0 mappings: 9 |
| 63 | 60 | Highest counter ID seen: c0 |
| 64 | 61 | |
| 65 | 62 | Function name: async2::non_async_func |
| 66 | Raw 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] | |
| 63 | Raw 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] | |
| 67 | 64 | Number of files: 1 |
| 68 | 65 | - file 0 => $DIR/async2.rs |
| 69 | 66 | Number of expressions: 0 |
| 70 | Number of file 0 mappings: 9 | |
| 67 | Number of file 0 mappings: 8 | |
| 71 | 68 | - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 20) |
| 72 | 69 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 73 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 42) | |
| 74 | 70 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) |
| 75 | 71 | - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17) |
| 76 | 72 | - 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 @@ |
| 1 | 1 | Function name: <trait_impl_inherit::S as trait_impl_inherit::T>::f |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/trait-impl-inherit.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 16) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 9 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 |
tests/coverage/bad_counter_ids.cov-map+16-28| ... | ... | @@ -1,108 +1,96 @@ |
| 1 | 1 | Function name: bad_counter_ids::eq_bad |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/bad_counter_ids.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 5 | |
| 6 | Number of file 0 mappings: 4 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 36, 1) to (start + 0, 12) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 11 | 10 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 12 | 11 | Highest counter ID seen: c0 |
| 13 | 12 | |
| 14 | 13 | Function name: bad_counter_ids::eq_bad_message |
| 15 | Raw 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] | |
| 14 | Raw 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] | |
| 16 | 15 | Number of files: 1 |
| 17 | 16 | - file 0 => $DIR/bad_counter_ids.rs |
| 18 | 17 | Number of expressions: 0 |
| 19 | Number of file 0 mappings: 6 | |
| 18 | Number of file 0 mappings: 4 | |
| 20 | 19 | - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 20) |
| 21 | 20 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 22 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 23 | 21 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 24 | - Code(Counter(0)) at (prev + 0, 32) to (start + 0, 43) | |
| 25 | 22 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 26 | 23 | Highest counter ID seen: c0 |
| 27 | 24 | |
| 28 | 25 | Function name: bad_counter_ids::eq_good |
| 29 | Raw 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] | |
| 26 | Raw 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] | |
| 30 | 27 | Number of files: 1 |
| 31 | 28 | - file 0 => $DIR/bad_counter_ids.rs |
| 32 | 29 | Number of expressions: 0 |
| 33 | Number of file 0 mappings: 5 | |
| 30 | Number of file 0 mappings: 4 | |
| 34 | 31 | - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 13) |
| 35 | 32 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 36 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 37 | 33 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 38 | 34 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 39 | 35 | Highest counter ID seen: c0 |
| 40 | 36 | |
| 41 | 37 | Function name: bad_counter_ids::eq_good_message |
| 42 | Raw 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] | |
| 38 | Raw 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] | |
| 43 | 39 | Number of files: 1 |
| 44 | 40 | - file 0 => $DIR/bad_counter_ids.rs |
| 45 | 41 | Number of expressions: 0 |
| 46 | Number of file 0 mappings: 6 | |
| 42 | Number of file 0 mappings: 4 | |
| 47 | 43 | - Code(Counter(0)) at (prev + 21, 1) to (start + 0, 21) |
| 48 | 44 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 49 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 50 | 45 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 51 | - Code(Zero) at (prev + 0, 32) to (start + 0, 43) | |
| 52 | 46 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 53 | 47 | Highest counter ID seen: c0 |
| 54 | 48 | |
| 55 | 49 | Function name: bad_counter_ids::ne_bad |
| 56 | Raw 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] | |
| 50 | Raw 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] | |
| 57 | 51 | Number of files: 1 |
| 58 | 52 | - file 0 => $DIR/bad_counter_ids.rs |
| 59 | 53 | Number of expressions: 0 |
| 60 | Number of file 0 mappings: 5 | |
| 54 | Number of file 0 mappings: 4 | |
| 61 | 55 | - Code(Counter(0)) at (prev + 46, 1) to (start + 0, 12) |
| 62 | 56 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 63 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 64 | 57 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 65 | 58 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 66 | 59 | Highest counter ID seen: c0 |
| 67 | 60 | |
| 68 | 61 | Function name: bad_counter_ids::ne_bad_message |
| 69 | Raw 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] | |
| 62 | Raw 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] | |
| 70 | 63 | Number of files: 1 |
| 71 | 64 | - file 0 => $DIR/bad_counter_ids.rs |
| 72 | 65 | Number of expressions: 0 |
| 73 | Number of file 0 mappings: 6 | |
| 66 | Number of file 0 mappings: 4 | |
| 74 | 67 | - Code(Counter(0)) at (prev + 51, 1) to (start + 0, 20) |
| 75 | 68 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 76 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 77 | 69 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 78 | - Code(Counter(0)) at (prev + 0, 32) to (start + 0, 43) | |
| 79 | 70 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 80 | 71 | Highest counter ID seen: c0 |
| 81 | 72 | |
| 82 | 73 | Function name: bad_counter_ids::ne_good |
| 83 | Raw 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] | |
| 74 | Raw 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] | |
| 84 | 75 | Number of files: 1 |
| 85 | 76 | - file 0 => $DIR/bad_counter_ids.rs |
| 86 | 77 | Number of expressions: 0 |
| 87 | Number of file 0 mappings: 5 | |
| 78 | Number of file 0 mappings: 4 | |
| 88 | 79 | - Code(Counter(0)) at (prev + 26, 1) to (start + 0, 13) |
| 89 | 80 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 90 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 91 | 81 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 92 | 82 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 93 | 83 | Highest counter ID seen: c0 |
| 94 | 84 | |
| 95 | 85 | Function name: bad_counter_ids::ne_good_message |
| 96 | Raw 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] | |
| 86 | Raw 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] | |
| 97 | 87 | Number of files: 1 |
| 98 | 88 | - file 0 => $DIR/bad_counter_ids.rs |
| 99 | 89 | Number of expressions: 0 |
| 100 | Number of file 0 mappings: 6 | |
| 90 | Number of file 0 mappings: 4 | |
| 101 | 91 | - Code(Counter(0)) at (prev + 31, 1) to (start + 0, 21) |
| 102 | 92 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 103 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) | |
| 104 | 93 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 105 | - Code(Zero) at (prev + 0, 32) to (start + 0, 43) | |
| 106 | 94 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 107 | 95 | Highest counter ID seen: c0 |
| 108 | 96 |
tests/coverage/bad_counter_ids.coverage-2| ... | ... | @@ -21,7 +21,6 @@ |
| 21 | 21 | LL| 1|fn eq_good_message() { |
| 22 | 22 | LL| 1| println!("b"); |
| 23 | 23 | LL| 1| assert_eq!(Foo(1), Foo(1), "message b"); |
| 24 | ^0 | |
| 25 | 24 | LL| 1|} |
| 26 | 25 | LL| | |
| 27 | 26 | LL| 1|fn ne_good() { |
| ... | ... | @@ -32,7 +31,6 @@ |
| 32 | 31 | LL| 1|fn ne_good_message() { |
| 33 | 32 | LL| 1| println!("d"); |
| 34 | 33 | LL| 1| assert_ne!(Foo(1), Foo(3), "message d"); |
| 35 | ^0 | |
| 36 | 34 | LL| 1|} |
| 37 | 35 | LL| | |
| 38 | 36 | LL| 1|fn eq_bad() { |
tests/coverage/closure.cov-map+39-58| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | Function name: closure::main |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/closure.rs |
| 5 | 5 | Number of expressions: 1 |
| 6 | 6 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 7 | Number of file 0 mappings: 66 | |
| 7 | Number of file 0 mappings: 61 | |
| 8 | 8 | - Code(Counter(0)) at (prev + 9, 1) to (start + 0, 10) |
| 9 | 9 | - Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) |
| 10 | 10 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) |
| ... | ... | @@ -13,35 +13,30 @@ Number of file 0 mappings: 66 |
| 13 | 13 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 24) |
| 14 | 14 | - Code(Counter(0)) at (prev + 0, 27) to (start + 0, 67) |
| 15 | 15 | - 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) | |
| 18 | 17 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) |
| 19 | 18 | - Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16) |
| 20 | 19 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 59) |
| 21 | 20 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) |
| 22 | 21 | - 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) | |
| 25 | 23 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) |
| 26 | 24 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14) |
| 27 | 25 | - Code(Counter(0)) at (prev + 4, 5) to (start + 0, 16) |
| 28 | 26 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23) |
| 29 | 27 | - 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) | |
| 32 | 29 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) |
| 33 | 30 | - Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16) |
| 34 | 31 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23) |
| 35 | 32 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) |
| 36 | 33 | - 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) | |
| 39 | 35 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) |
| 40 | 36 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14) |
| 41 | 37 | - Code(Counter(0)) at (prev + 5, 9) to (start + 0, 22) |
| 42 | 38 | - 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) | |
| 45 | 40 | - Code(Counter(0)) at (prev + 1, 14) to (start + 0, 18) |
| 46 | 41 | - Code(Counter(0)) at (prev + 1, 14) to (start + 0, 17) |
| 47 | 42 | - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 26) |
| ... | ... | @@ -94,74 +89,68 @@ Number of file 0 mappings: 9 |
| 94 | 89 | Highest counter ID seen: c1 |
| 95 | 90 | |
| 96 | 91 | Function name: closure::main::{closure#10} (unused) |
| 97 | Raw 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] | |
| 92 | Raw bytes (20): 0x[01, 01, 00, 03, 00, 9b, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21] | |
| 98 | 93 | Number of files: 1 |
| 99 | 94 | - file 0 => $DIR/closure.rs |
| 100 | 95 | Number of expressions: 0 |
| 101 | Number of file 0 mappings: 4 | |
| 96 | Number of file 0 mappings: 3 | |
| 102 | 97 | - Code(Zero) at (prev + 155, 7) to (start + 0, 8) |
| 103 | 98 | - Code(Zero) at (prev + 0, 9) to (start + 0, 17) |
| 104 | - Code(Zero) at (prev + 0, 18) to (start + 0, 30) | |
| 105 | 99 | - Code(Zero) at (prev + 0, 32) to (start + 0, 33) |
| 106 | 100 | Highest counter ID seen: (none) |
| 107 | 101 | |
| 108 | 102 | Function name: closure::main::{closure#11} (unused) |
| 109 | Raw 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] | |
| 103 | Raw bytes (20): 0x[01, 01, 00, 03, 00, 9f, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21] | |
| 110 | 104 | Number of files: 1 |
| 111 | 105 | - file 0 => $DIR/closure.rs |
| 112 | 106 | Number of expressions: 0 |
| 113 | Number of file 0 mappings: 4 | |
| 107 | Number of file 0 mappings: 3 | |
| 114 | 108 | - Code(Zero) at (prev + 159, 7) to (start + 0, 8) |
| 115 | 109 | - Code(Zero) at (prev + 0, 9) to (start + 0, 17) |
| 116 | - Code(Zero) at (prev + 0, 18) to (start + 0, 30) | |
| 117 | 110 | - Code(Zero) at (prev + 0, 32) to (start + 0, 33) |
| 118 | 111 | Highest counter ID seen: (none) |
| 119 | 112 | |
| 120 | 113 | Function name: closure::main::{closure#12} (unused) |
| 121 | Raw bytes (15): 0x[01, 01, 00, 02, 00, a7, 01, 01, 00, 09, 00, 00, 0a, 00, 16] | |
| 114 | Raw bytes (10): 0x[01, 01, 00, 01, 00, a7, 01, 01, 00, 09] | |
| 122 | 115 | Number of files: 1 |
| 123 | 116 | - file 0 => $DIR/closure.rs |
| 124 | 117 | Number of expressions: 0 |
| 125 | Number of file 0 mappings: 2 | |
| 118 | Number of file 0 mappings: 1 | |
| 126 | 119 | - Code(Zero) at (prev + 167, 1) to (start + 0, 9) |
| 127 | - Code(Zero) at (prev + 0, 10) to (start + 0, 22) | |
| 128 | 120 | Highest counter ID seen: (none) |
| 129 | 121 | |
| 130 | 122 | Function name: closure::main::{closure#13} (unused) |
| 131 | Raw bytes (15): 0x[01, 01, 00, 02, 00, ac, 01, 0d, 00, 15, 00, 01, 11, 00, 1d] | |
| 123 | Raw bytes (10): 0x[01, 01, 00, 01, 00, ac, 01, 0d, 00, 15] | |
| 132 | 124 | Number of files: 1 |
| 133 | 125 | - file 0 => $DIR/closure.rs |
| 134 | 126 | Number of expressions: 0 |
| 135 | Number of file 0 mappings: 2 | |
| 127 | Number of file 0 mappings: 1 | |
| 136 | 128 | - Code(Zero) at (prev + 172, 13) to (start + 0, 21) |
| 137 | - Code(Zero) at (prev + 1, 17) to (start + 0, 29) | |
| 138 | 129 | Highest counter ID seen: (none) |
| 139 | 130 | |
| 140 | 131 | Function name: closure::main::{closure#14} |
| 141 | Raw 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] | |
| 132 | Raw 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] | |
| 142 | 133 | Number of files: 1 |
| 143 | 134 | - file 0 => $DIR/closure.rs |
| 144 | 135 | Number of expressions: 1 |
| 145 | 136 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 146 | Number 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) | |
| 137 | Number of file 0 mappings: 3 | |
| 138 | - Code(Counter(0)) at (prev + 181, 20) to (start + 0, 27) | |
| 149 | 139 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) |
| 150 | 140 | - Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) |
| 151 | 141 | = (c0 - c1) |
| 152 | 142 | Highest counter ID seen: c1 |
| 153 | 143 | |
| 154 | 144 | Function name: closure::main::{closure#15} |
| 155 | Raw 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] | |
| 145 | Raw 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] | |
| 156 | 146 | Number of files: 1 |
| 157 | 147 | - file 0 => $DIR/closure.rs |
| 158 | 148 | Number of expressions: 1 |
| 159 | 149 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 160 | Number of file 0 mappings: 7 | |
| 150 | Number of file 0 mappings: 6 | |
| 161 | 151 | - Code(Counter(0)) at (prev + 187, 9) to (start + 0, 10) |
| 162 | 152 | - 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) | |
| 165 | 154 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) |
| 166 | 155 | - Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) |
| 167 | 156 | = (c0 - c1) |
| ... | ... | @@ -169,30 +158,28 @@ Number of file 0 mappings: 7 |
| 169 | 158 | Highest counter ID seen: c1 |
| 170 | 159 | |
| 171 | 160 | Function name: closure::main::{closure#16} |
| 172 | Raw 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] | |
| 161 | Raw 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] | |
| 173 | 162 | Number of files: 1 |
| 174 | 163 | - file 0 => $DIR/closure.rs |
| 175 | 164 | Number of expressions: 1 |
| 176 | 165 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 177 | Number 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) | |
| 166 | Number of file 0 mappings: 3 | |
| 167 | - Code(Counter(0)) at (prev + 199, 20) to (start + 0, 27) | |
| 180 | 168 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) |
| 181 | 169 | - Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) |
| 182 | 170 | = (c0 - c1) |
| 183 | 171 | Highest counter ID seen: c1 |
| 184 | 172 | |
| 185 | 173 | Function name: closure::main::{closure#17} |
| 186 | Raw 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] | |
| 174 | Raw 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] | |
| 187 | 175 | Number of files: 1 |
| 188 | 176 | - file 0 => $DIR/closure.rs |
| 189 | 177 | Number of expressions: 1 |
| 190 | 178 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 191 | Number of file 0 mappings: 7 | |
| 179 | Number of file 0 mappings: 6 | |
| 192 | 180 | - Code(Counter(0)) at (prev + 205, 9) to (start + 0, 10) |
| 193 | 181 | - 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) | |
| 196 | 183 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) |
| 197 | 184 | - Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) |
| 198 | 185 | = (c0 - c1) |
| ... | ... | @@ -257,12 +244,12 @@ Number of file 0 mappings: 9 |
| 257 | 244 | Highest counter ID seen: c1 |
| 258 | 245 | |
| 259 | 246 | Function name: closure::main::{closure#2} |
| 260 | Raw 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] | |
| 247 | Raw 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] | |
| 261 | 248 | Number of files: 1 |
| 262 | 249 | - file 0 => $DIR/closure.rs |
| 263 | 250 | Number of expressions: 1 |
| 264 | 251 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 265 | Number of file 0 mappings: 9 | |
| 252 | Number of file 0 mappings: 8 | |
| 266 | 253 | - Code(Counter(0)) at (prev + 104, 5) to (start + 0, 6) |
| 267 | 254 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 26) |
| 268 | 255 | - Code(Counter(0)) at (prev + 0, 29) to (start + 0, 30) |
| ... | ... | @@ -271,7 +258,6 @@ Number of file 0 mappings: 9 |
| 271 | 258 | - Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) |
| 272 | 259 | = (c0 - c1) |
| 273 | 260 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) |
| 274 | - Code(Counter(0)) at (prev + 0, 17) to (start + 0, 23) | |
| 275 | 261 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 276 | 262 | Highest counter ID seen: c1 |
| 277 | 263 | |
| ... | ... | @@ -291,56 +277,51 @@ Number of file 0 mappings: 7 |
| 291 | 277 | Highest counter ID seen: (none) |
| 292 | 278 | |
| 293 | 279 | Function name: closure::main::{closure#5} |
| 294 | Raw bytes (15): 0x[01, 01, 00, 02, 01, 8c, 01, 3d, 00, 45, 01, 00, 46, 00, 4e] | |
| 280 | Raw bytes (10): 0x[01, 01, 00, 01, 01, 8c, 01, 3d, 00, 45] | |
| 295 | 281 | Number of files: 1 |
| 296 | 282 | - file 0 => $DIR/closure.rs |
| 297 | 283 | Number of expressions: 0 |
| 298 | Number of file 0 mappings: 2 | |
| 284 | Number of file 0 mappings: 1 | |
| 299 | 285 | - Code(Counter(0)) at (prev + 140, 61) to (start + 0, 69) |
| 300 | - Code(Counter(0)) at (prev + 0, 70) to (start + 0, 78) | |
| 301 | 286 | Highest counter ID seen: c0 |
| 302 | 287 | |
| 303 | 288 | Function name: closure::main::{closure#6} |
| 304 | Raw bytes (15): 0x[01, 01, 00, 02, 01, 8d, 01, 41, 00, 49, 01, 00, 4a, 00, 56] | |
| 289 | Raw bytes (10): 0x[01, 01, 00, 01, 01, 8d, 01, 41, 00, 49] | |
| 305 | 290 | Number of files: 1 |
| 306 | 291 | - file 0 => $DIR/closure.rs |
| 307 | 292 | Number of expressions: 0 |
| 308 | Number of file 0 mappings: 2 | |
| 293 | Number of file 0 mappings: 1 | |
| 309 | 294 | - Code(Counter(0)) at (prev + 141, 65) to (start + 0, 73) |
| 310 | - Code(Counter(0)) at (prev + 0, 74) to (start + 0, 86) | |
| 311 | 295 | Highest counter ID seen: c0 |
| 312 | 296 | |
| 313 | 297 | Function name: closure::main::{closure#7} (unused) |
| 314 | Raw bytes (15): 0x[01, 01, 00, 02, 00, 8e, 01, 3b, 00, 43, 00, 00, 44, 00, 50] | |
| 298 | Raw bytes (10): 0x[01, 01, 00, 01, 00, 8e, 01, 3b, 00, 43] | |
| 315 | 299 | Number of files: 1 |
| 316 | 300 | - file 0 => $DIR/closure.rs |
| 317 | 301 | Number of expressions: 0 |
| 318 | Number of file 0 mappings: 2 | |
| 302 | Number of file 0 mappings: 1 | |
| 319 | 303 | - Code(Zero) at (prev + 142, 59) to (start + 0, 67) |
| 320 | - Code(Zero) at (prev + 0, 68) to (start + 0, 80) | |
| 321 | 304 | Highest counter ID seen: (none) |
| 322 | 305 | |
| 323 | 306 | Function name: closure::main::{closure#8} (unused) |
| 324 | Raw 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] | |
| 307 | Raw bytes (20): 0x[01, 01, 00, 03, 00, 93, 01, 3b, 00, 3c, 00, 00, 3d, 00, 45, 00, 00, 54, 00, 55] | |
| 325 | 308 | Number of files: 1 |
| 326 | 309 | - file 0 => $DIR/closure.rs |
| 327 | 310 | Number of expressions: 0 |
| 328 | Number of file 0 mappings: 4 | |
| 311 | Number of file 0 mappings: 3 | |
| 329 | 312 | - Code(Zero) at (prev + 147, 59) to (start + 0, 60) |
| 330 | 313 | - Code(Zero) at (prev + 0, 61) to (start + 0, 69) |
| 331 | - Code(Zero) at (prev + 0, 70) to (start + 0, 82) | |
| 332 | 314 | - Code(Zero) at (prev + 0, 84) to (start + 0, 85) |
| 333 | 315 | Highest counter ID seen: (none) |
| 334 | 316 | |
| 335 | 317 | Function name: closure::main::{closure#9} (unused) |
| 336 | Raw 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] | |
| 318 | Raw bytes (20): 0x[01, 01, 00, 03, 00, 95, 01, 38, 00, 39, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] | |
| 337 | 319 | Number of files: 1 |
| 338 | 320 | - file 0 => $DIR/closure.rs |
| 339 | 321 | Number of expressions: 0 |
| 340 | Number of file 0 mappings: 4 | |
| 322 | Number of file 0 mappings: 3 | |
| 341 | 323 | - Code(Zero) at (prev + 149, 56) to (start + 0, 57) |
| 342 | 324 | - Code(Zero) at (prev + 1, 9) to (start + 0, 17) |
| 343 | - Code(Zero) at (prev + 0, 18) to (start + 0, 30) | |
| 344 | 325 | - Code(Zero) at (prev + 1, 5) to (start + 0, 6) |
| 345 | 326 | Highest counter ID seen: (none) |
| 346 | 327 |
tests/coverage/closure.coverage+13-13| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | LL| | |
| 16 | 16 | LL| 1| let mut some_string = Some(String::from("the string content")); |
| 17 | 17 | LL| 1| println!( |
| 18 | LL| 1| "The string or alt: {}" | |
| 18 | LL| | "The string or alt: {}" | |
| 19 | 19 | LL| | , |
| 20 | 20 | LL| 1| some_string |
| 21 | 21 | LL| | . |
| ... | ... | @@ -45,7 +45,7 @@ |
| 45 | 45 | LL| 0| "alt string 2".to_owned() |
| 46 | 46 | LL| 0| }; |
| 47 | 47 | LL| 1| println!( |
| 48 | LL| 1| "The string or alt: {}" | |
| 48 | LL| | "The string or alt: {}" | |
| 49 | 49 | LL| | , |
| 50 | 50 | LL| 1| some_string |
| 51 | 51 | LL| | . |
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | LL| | |
| 58 | 58 | LL| 1| some_string = None; |
| 59 | 59 | LL| 1| println!( |
| 60 | LL| 1| "The string or alt: {}" | |
| 60 | LL| | "The string or alt: {}" | |
| 61 | 61 | LL| | , |
| 62 | 62 | LL| 1| some_string |
| 63 | 63 | LL| | . |
| ... | ... | @@ -87,7 +87,7 @@ |
| 87 | 87 | LL| 1| "alt string 4".to_owned() |
| 88 | 88 | LL| 1| }; |
| 89 | 89 | LL| 1| println!( |
| 90 | LL| 1| "The string or alt: {}" | |
| 90 | LL| | "The string or alt: {}" | |
| 91 | 91 | LL| | , |
| 92 | 92 | LL| 1| some_string |
| 93 | 93 | LL| | . |
| ... | ... | @@ -109,7 +109,7 @@ |
| 109 | 109 | LL| 5| format!("'{}'", val) |
| 110 | 110 | LL| 5| }; |
| 111 | 111 | LL| 1| println!( |
| 112 | LL| 1| "Repeated, quoted string: {:?}" | |
| 112 | LL| | "Repeated, quoted string: {:?}" | |
| 113 | 113 | LL| | , |
| 114 | 114 | LL| 1| std::iter::repeat("repeat me") |
| 115 | 115 | LL| 1| .take(5) |
| ... | ... | @@ -139,15 +139,15 @@ |
| 139 | 139 | LL| | |
| 140 | 140 | LL| 1| let short_used_covered_closure_macro = | used_arg: u8 | println!("called"); |
| 141 | 141 | LL| 1| let short_used_not_covered_closure_macro = | used_arg: u8 | println!("not called"); |
| 142 | ^0 ^0 | |
| 142 | ^0 | |
| 143 | 143 | LL| 1| let _short_unused_closure_macro = | _unused_arg: u8 | println!("not called"); |
| 144 | ^0 ^0 | |
| 144 | ^0 | |
| 145 | 145 | LL| | |
| 146 | 146 | LL| | |
| 147 | 147 | LL| | |
| 148 | 148 | LL| | |
| 149 | 149 | LL| 1| let _short_unused_closure_block = | _unused_arg: u8 | { println!("not called") }; |
| 150 | ^0^0 ^0 ^0 | |
| 150 | ^0^0 ^0 | |
| 151 | 151 | LL| | |
| 152 | 152 | LL| 1| let _shortish_unused_closure = | _unused_arg: u8 | { |
| 153 | 153 | ^0 |
| ... | ... | @@ -174,14 +174,14 @@ |
| 174 | 174 | LL| 1| let _short_unused_closure_line_break_no_block2 = |
| 175 | 175 | LL| | | _unused_arg: u8 | |
| 176 | 176 | LL| 0| println!( |
| 177 | LL| 0| "not called" | |
| 177 | LL| | "not called" | |
| 178 | 178 | LL| | ) |
| 179 | 179 | LL| | ; |
| 180 | 180 | LL| | |
| 181 | 181 | LL| 1| let short_used_not_covered_closure_line_break_no_block_embedded_branch = |
| 182 | 182 | LL| | | _unused_arg: u8 | |
| 183 | 183 | LL| | println!( |
| 184 | LL| 0| "not called: {}", | |
| 184 | LL| | "not called: {}", | |
| 185 | 185 | LL| 0| if is_true { "check" } else { "me" } |
| 186 | 186 | LL| | ) |
| 187 | 187 | LL| | ; |
| ... | ... | @@ -190,7 +190,7 @@ |
| 190 | 190 | LL| | | _unused_arg: u8 | |
| 191 | 191 | LL| 0| { |
| 192 | 192 | LL| 0| println!( |
| 193 | LL| 0| "not called: {}", | |
| 193 | LL| | "not called: {}", | |
| 194 | 194 | LL| 0| if is_true { "check" } else { "me" } |
| 195 | 195 | LL| | ) |
| 196 | 196 | LL| 0| } |
| ... | ... | @@ -199,7 +199,7 @@ |
| 199 | 199 | LL| 1| let short_used_covered_closure_line_break_no_block_embedded_branch = |
| 200 | 200 | LL| | | _unused_arg: u8 | |
| 201 | 201 | LL| | println!( |
| 202 | LL| 1| "not called: {}", | |
| 202 | LL| | "not called: {}", | |
| 203 | 203 | LL| 1| if is_true { "check" } else { "me" } |
| 204 | 204 | ^0 |
| 205 | 205 | LL| | ) |
| ... | ... | @@ -209,7 +209,7 @@ |
| 209 | 209 | LL| | | _unused_arg: u8 | |
| 210 | 210 | LL| 1| { |
| 211 | 211 | LL| 1| println!( |
| 212 | LL| 1| "not called: {}", | |
| 212 | LL| | "not called: {}", | |
| 213 | 213 | LL| 1| if is_true { "check" } else { "me" } |
| 214 | 214 | ^0 |
| 215 | 215 | LL| | ) |
tests/coverage/closure_macro.cov-map+7-11| ... | ... | @@ -10,15 +10,14 @@ Number of file 0 mappings: 3 |
| 10 | 10 | Highest counter ID seen: c0 |
| 11 | 11 | |
| 12 | 12 | Function name: closure_macro::main |
| 13 | Raw 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] | |
| 13 | Raw 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] | |
| 14 | 14 | Number of files: 1 |
| 15 | 15 | - file 0 => $DIR/closure_macro.rs |
| 16 | 16 | Number of expressions: 1 |
| 17 | 17 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 18 | Number of file 0 mappings: 12 | |
| 18 | Number of file 0 mappings: 11 | |
| 19 | 19 | - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 36) |
| 20 | 20 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 21 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32) | |
| 22 | 21 | - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) |
| 23 | 22 | = (c0 - c1) |
| 24 | 23 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27) |
| ... | ... | @@ -36,25 +35,22 @@ Number of file 0 mappings: 12 |
| 36 | 35 | Highest counter ID seen: c1 |
| 37 | 36 | |
| 38 | 37 | Function name: closure_macro::main::{closure#0} |
| 39 | Raw 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] | |
| 38 | Raw 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] | |
| 40 | 39 | Number of files: 1 |
| 41 | 40 | - file 0 => $DIR/closure_macro.rs |
| 42 | Number of expressions: 3 | |
| 41 | Number of expressions: 1 | |
| 43 | 42 | - 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) | |
| 46 | Number of file 0 mappings: 10 | |
| 43 | Number of file 0 mappings: 9 | |
| 47 | 44 | - Code(Counter(0)) at (prev + 16, 28) to (start + 0, 29) |
| 48 | 45 | - Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24) |
| 49 | 46 | - Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) |
| 50 | 47 | - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33) |
| 51 | 48 | - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) |
| 52 | - Code(Counter(1)) at (prev + 0, 26) to (start + 0, 30) | |
| 53 | 49 | - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39) |
| 54 | 50 | - Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22) |
| 55 | 51 | = (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) | |
| 58 | 54 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) |
| 59 | 55 | Highest counter ID seen: c1 |
| 60 | 56 |
tests/coverage/closure_macro_async.cov-map+7-11| ... | ... | @@ -19,15 +19,14 @@ Number of file 0 mappings: 1 |
| 19 | 19 | Highest counter ID seen: c0 |
| 20 | 20 | |
| 21 | 21 | Function name: closure_macro_async::test::{closure#0} |
| 22 | Raw 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] | |
| 22 | Raw 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] | |
| 23 | 23 | Number of files: 1 |
| 24 | 24 | - file 0 => $DIR/closure_macro_async.rs |
| 25 | 25 | Number of expressions: 1 |
| 26 | 26 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 27 | Number of file 0 mappings: 12 | |
| 27 | Number of file 0 mappings: 11 | |
| 28 | 28 | - Code(Counter(0)) at (prev + 37, 43) to (start + 0, 44) |
| 29 | 29 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 30 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32) | |
| 31 | 30 | - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) |
| 32 | 31 | = (c0 - c1) |
| 33 | 32 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27) |
| ... | ... | @@ -45,25 +44,22 @@ Number of file 0 mappings: 12 |
| 45 | 44 | Highest counter ID seen: c1 |
| 46 | 45 | |
| 47 | 46 | Function name: closure_macro_async::test::{closure#0}::{closure#0} |
| 48 | Raw 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] | |
| 47 | Raw 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] | |
| 49 | 48 | Number of files: 1 |
| 50 | 49 | - file 0 => $DIR/closure_macro_async.rs |
| 51 | Number of expressions: 3 | |
| 50 | Number of expressions: 1 | |
| 52 | 51 | - 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) | |
| 55 | Number of file 0 mappings: 10 | |
| 52 | Number of file 0 mappings: 9 | |
| 56 | 53 | - Code(Counter(0)) at (prev + 20, 28) to (start + 0, 29) |
| 57 | 54 | - Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24) |
| 58 | 55 | - Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) |
| 59 | 56 | - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33) |
| 60 | 57 | - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) |
| 61 | - Code(Counter(1)) at (prev + 0, 26) to (start + 0, 30) | |
| 62 | 58 | - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39) |
| 63 | 59 | - Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22) |
| 64 | 60 | = (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) | |
| 67 | 63 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) |
| 68 | 64 | Highest counter ID seen: c1 |
| 69 | 65 |
tests/coverage/conditions.cov-map+41-46| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | Function name: conditions::main |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/conditions.rs |
| 5 | Number of expressions: 87 | |
| 5 | Number of expressions: 84 | |
| 6 | 6 | - expression 0 operands: lhs = Counter(1), rhs = Counter(2) |
| 7 | 7 | - expression 1 operands: lhs = Counter(0), rhs = Counter(1) |
| 8 | 8 | - expression 2 operands: lhs = Counter(2), rhs = Counter(23) |
| ... | ... | @@ -41,7 +41,7 @@ Number of expressions: 87 |
| 41 | 41 | - expression 35 operands: lhs = Counter(6), rhs = Expression(36, Add) |
| 42 | 42 | - expression 36 operands: lhs = Expression(37, Add), rhs = Counter(19) |
| 43 | 43 | - 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) | |
| 45 | 45 | - expression 39 operands: lhs = Counter(3), rhs = Counter(4) |
| 46 | 46 | - expression 40 operands: lhs = Counter(5), rhs = Counter(6) |
| 47 | 47 | - expression 41 operands: lhs = Counter(5), rhs = Counter(6) |
| ... | ... | @@ -50,7 +50,7 @@ Number of expressions: 87 |
| 50 | 50 | - expression 44 operands: lhs = Counter(5), rhs = Counter(6) |
| 51 | 51 | - expression 45 operands: lhs = Counter(7), rhs = Counter(8) |
| 52 | 52 | - 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) | |
| 54 | 54 | - expression 48 operands: lhs = Counter(5), rhs = Counter(6) |
| 55 | 55 | - expression 49 operands: lhs = Counter(8), rhs = Counter(14) |
| 56 | 56 | - expression 50 operands: lhs = Counter(8), rhs = Expression(56, Add) |
| ... | ... | @@ -60,37 +60,34 @@ Number of expressions: 87 |
| 60 | 60 | - expression 54 operands: lhs = Counter(8), rhs = Expression(55, Add) |
| 61 | 61 | - expression 55 operands: lhs = Expression(56, Add), rhs = Counter(16) |
| 62 | 62 | - 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) | |
| 64 | 64 | - expression 58 operands: lhs = Counter(5), rhs = Counter(6) |
| 65 | 65 | - 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) | |
| 67 | 67 | - expression 61 operands: lhs = Counter(5), rhs = Counter(6) |
| 68 | 68 | - 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) | |
| 70 | 70 | - expression 64 operands: lhs = Counter(5), rhs = Counter(6) |
| 71 | 71 | - 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) | |
| 73 | 73 | - expression 67 operands: lhs = Counter(5), rhs = Counter(6) |
| 74 | 74 | - 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) | |
| 86 | 86 | - 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) | |
| 93 | Number 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) | |
| 90 | Number of file 0 mappings: 82 | |
| 94 | 91 | - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) |
| 95 | 92 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) |
| 96 | 93 | - Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) |
| ... | ... | @@ -172,18 +169,18 @@ Number of file 0 mappings: 83 |
| 172 | 169 | - Code(Expression(38, Sub)) at (prev + 2, 13) to (start + 0, 19) |
| 173 | 170 | = ((c3 + c4) - (c5 + c6)) |
| 174 | 171 | - 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) | |
| 176 | 173 | = (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) | |
| 178 | 175 | = (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) | |
| 180 | 177 | = (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) | |
| 182 | 179 | = (c5 + c6) |
| 183 | 180 | - 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) | |
| 185 | 182 | = (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) | |
| 187 | 184 | = (c5 + c6) |
| 188 | 185 | - Code(Counter(7)) at (prev + 0, 30) to (start + 2, 6) |
| 189 | 186 | - Code(Expression(47, Sub)) at (prev + 2, 15) to (start + 0, 28) |
| ... | ... | @@ -198,34 +195,32 @@ Number of file 0 mappings: 83 |
| 198 | 195 | - Code(Expression(54, Sub)) at (prev + 2, 9) to (start + 0, 10) |
| 199 | 196 | = (c8 - ((c14 + c15) + c16)) |
| 200 | 197 | - 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) | |
| 202 | 199 | = ((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) | |
| 204 | 201 | = ((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) | |
| 206 | 203 | = ((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) | |
| 208 | 205 | = ((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) | |
| 212 | 207 | = (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) | |
| 214 | 209 | = (c7 + c8) |
| 215 | 210 | - 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) | |
| 217 | 212 | = ((c7 + c8) - c9) |
| 218 | 213 | - 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) | |
| 220 | 215 | = (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) | |
| 222 | 217 | = (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) | |
| 224 | 219 | = ((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) | |
| 226 | 221 | = (c10 - ((c11 + c12) + c13)) |
| 227 | 222 | - 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) | |
| 229 | 224 | = ((c7 + c8) - (c9 + c10)) |
| 230 | 225 | - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) |
| 231 | 226 | Highest counter ID seen: c10 |
tests/coverage/coverage_attr_closure.cov-map+6-9| ... | ... | @@ -1,24 +1,22 @@ |
| 1 | 1 | Function name: coverage_attr_closure::GLOBAL_CLOSURE_ON::{closure#0} |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 06, 0f, 00, 10, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/coverage_attr_closure.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 6, 15) to (start + 0, 16) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 23) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| 13 | 12 | Function name: coverage_attr_closure::contains_closures_off::{closure#0} (unused) |
| 14 | Raw 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] | |
| 13 | Raw bytes (19): 0x[01, 01, 00, 03, 00, 1d, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] | |
| 15 | 14 | Number of files: 1 |
| 16 | 15 | - file 0 => $DIR/coverage_attr_closure.rs |
| 17 | 16 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 4 | |
| 17 | Number of file 0 mappings: 3 | |
| 19 | 18 | - Code(Zero) at (prev + 29, 19) to (start + 0, 20) |
| 20 | 19 | - Code(Zero) at (prev + 1, 9) to (start + 0, 17) |
| 21 | - Code(Zero) at (prev + 0, 18) to (start + 0, 27) | |
| 22 | 20 | - Code(Zero) at (prev + 1, 5) to (start + 0, 6) |
| 23 | 21 | Highest counter ID seen: (none) |
| 24 | 22 | |
| ... | ... | @@ -35,14 +33,13 @@ Number of file 0 mappings: 4 |
| 35 | 33 | Highest counter ID seen: c0 |
| 36 | 34 | |
| 37 | 35 | Function name: coverage_attr_closure::contains_closures_on::{closure#0} (unused) |
| 38 | Raw 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] | |
| 36 | Raw bytes (19): 0x[01, 01, 00, 03, 00, 11, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] | |
| 39 | 37 | Number of files: 1 |
| 40 | 38 | - file 0 => $DIR/coverage_attr_closure.rs |
| 41 | 39 | Number of expressions: 0 |
| 42 | Number of file 0 mappings: 4 | |
| 40 | Number of file 0 mappings: 3 | |
| 43 | 41 | - Code(Zero) at (prev + 17, 19) to (start + 0, 20) |
| 44 | 42 | - Code(Zero) at (prev + 1, 9) to (start + 0, 17) |
| 45 | - Code(Zero) at (prev + 0, 18) to (start + 0, 27) | |
| 46 | 43 | - Code(Zero) at (prev + 1, 5) to (start + 0, 6) |
| 47 | 44 | Highest counter ID seen: (none) |
| 48 | 45 |
tests/coverage/drop_trait.cov-map+4-6| ... | ... | @@ -1,21 +1,20 @@ |
| 1 | 1 | Function name: <drop_trait::Firework as core::ops::drop::Drop>::drop |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/drop_trait.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 23) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 9 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| 13 | 12 | Function name: drop_trait::main |
| 14 | Raw 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] | |
| 13 | Raw 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] | |
| 15 | 14 | Number of files: 1 |
| 16 | 15 | - file 0 => $DIR/drop_trait.rs |
| 17 | 16 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 13 | |
| 17 | Number of file 0 mappings: 12 | |
| 19 | 18 | - Code(Counter(0)) at (prev + 14, 1) to (start + 0, 28) |
| 20 | 19 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21) |
| 21 | 20 | - Code(Counter(0)) at (prev + 0, 24) to (start + 0, 48) |
| ... | ... | @@ -23,7 +22,6 @@ Number of file 0 mappings: 13 |
| 23 | 22 | - Code(Counter(0)) at (prev + 0, 16) to (start + 0, 42) |
| 24 | 23 | - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) |
| 25 | 24 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 26 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 41) | |
| 27 | 25 | - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22) |
| 28 | 26 | - Code(Zero) at (prev + 1, 5) to (start + 0, 6) |
| 29 | 27 | - Code(Zero) at (prev + 2, 13) to (start + 0, 40) |
tests/coverage/generics.cov-map+6-9| ... | ... | @@ -1,12 +1,11 @@ |
| 1 | 1 | Function name: <generics::Firework<f64> as core::ops::drop::Drop>::drop |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/generics.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 9 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| ... | ... | @@ -22,14 +21,13 @@ Number of file 0 mappings: 3 |
| 22 | 21 | Highest counter ID seen: c0 |
| 23 | 22 | |
| 24 | 23 | Function name: <generics::Firework<i32> as core::ops::drop::Drop>::drop |
| 25 | Raw 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] | |
| 24 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] | |
| 26 | 25 | Number of files: 1 |
| 27 | 26 | - file 0 => $DIR/generics.rs |
| 28 | 27 | Number of expressions: 0 |
| 29 | Number of file 0 mappings: 4 | |
| 28 | Number of file 0 mappings: 3 | |
| 30 | 29 | - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23) |
| 31 | 30 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 32 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 36) | |
| 33 | 31 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 34 | 32 | Highest counter ID seen: c0 |
| 35 | 33 | |
| ... | ... | @@ -45,11 +43,11 @@ Number of file 0 mappings: 3 |
| 45 | 43 | Highest counter ID seen: c0 |
| 46 | 44 | |
| 47 | 45 | Function name: generics::main |
| 48 | Raw 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] | |
| 46 | Raw 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] | |
| 49 | 47 | Number of files: 1 |
| 50 | 48 | - file 0 => $DIR/generics.rs |
| 51 | 49 | Number of expressions: 0 |
| 52 | Number of file 0 mappings: 19 | |
| 50 | Number of file 0 mappings: 18 | |
| 53 | 51 | - Code(Counter(0)) at (prev + 22, 1) to (start + 0, 28) |
| 54 | 52 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 24) |
| 55 | 53 | - Code(Counter(0)) at (prev + 0, 27) to (start + 0, 51) |
| ... | ... | @@ -63,7 +61,6 @@ Number of file 0 mappings: 19 |
| 63 | 61 | - Code(Counter(0)) at (prev + 0, 9) to (start + 0, 21) |
| 64 | 62 | - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) |
| 65 | 63 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 66 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 41) | |
| 67 | 64 | - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22) |
| 68 | 65 | - Code(Zero) at (prev + 1, 5) to (start + 0, 6) |
| 69 | 66 | - 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 |
| 25 | 25 | Highest counter ID seen: c1 |
| 26 | 26 | |
| 27 | 27 | Function name: inline_dead::main |
| 28 | Raw 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] | |
| 28 | Raw 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] | |
| 29 | 29 | Number of files: 1 |
| 30 | 30 | - file 0 => $DIR/inline-dead.rs |
| 31 | 31 | Number of expressions: 0 |
| 32 | Number of file 0 mappings: 7 | |
| 32 | Number of file 0 mappings: 6 | |
| 33 | 33 | - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) |
| 34 | 34 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 35 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18) | |
| 36 | 35 | - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 33) |
| 37 | 36 | - Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) |
| 38 | 37 | - 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 |
| 53 | 53 | Highest counter ID seen: c2 |
| 54 | 54 | |
| 55 | 55 | Function name: inner_items::main::in_func |
| 56 | Raw 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] | |
| 56 | Raw 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] | |
| 57 | 57 | Number of files: 1 |
| 58 | 58 | - file 0 => $DIR/inner_items.rs |
| 59 | 59 | Number of expressions: 0 |
| 60 | Number of file 0 mappings: 8 | |
| 60 | Number of file 0 mappings: 7 | |
| 61 | 61 | - Code(Counter(0)) at (prev + 18, 5) to (start + 0, 23) |
| 62 | 62 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) |
| 63 | 63 | - Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) |
| 64 | 64 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) |
| 65 | 65 | - Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) |
| 66 | 66 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 67 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) | |
| 68 | 67 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) |
| 69 | 68 | Highest counter ID seen: c0 |
| 70 | 69 |
tests/coverage/issue-83601.cov-map+2-5| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | Function name: issue_83601::main |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/issue-83601.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 14 | |
| 6 | Number of file 0 mappings: 11 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) |
| 9 | 9 | - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) |
| ... | ... | @@ -12,11 +12,8 @@ Number of file 0 mappings: 14 |
| 12 | 12 | - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) |
| 13 | 13 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 14 | 14 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 15 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 16 | 15 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 17 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 18 | 16 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 19 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 20 | 17 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 21 | 18 | Highest counter ID seen: c0 |
| 22 | 19 |
tests/coverage/issue-84561.cov-map+20-43| ... | ... | @@ -1,14 +1,13 @@ |
| 1 | 1 | Function name: <issue_84561::Foo as core::fmt::Debug>::fmt |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/issue-84561.rs |
| 5 | 5 | Number of expressions: 1 |
| 6 | 6 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 7 | Number of file 0 mappings: 7 | |
| 7 | Number of file 0 mappings: 6 | |
| 8 | 8 | - Code(Counter(0)) at (prev + 138, 5) to (start + 0, 67) |
| 9 | 9 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) |
| 10 | 10 | - Code(Counter(0)) at (prev + 0, 16) to (start + 0, 17) |
| 11 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 36) | |
| 12 | 11 | - Code(Counter(1)) at (prev + 0, 37) to (start + 0, 38) |
| 13 | 12 | - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) |
| 14 | 13 | = (c0 - c1) |
| ... | ... | @@ -29,54 +28,48 @@ Number of file 0 mappings: 5 |
| 29 | 28 | Highest counter ID seen: c0 |
| 30 | 29 | |
| 31 | 30 | Function name: issue_84561::test1 |
| 32 | Raw 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] | |
| 31 | Raw 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] | |
| 33 | 32 | Number of files: 1 |
| 34 | 33 | - file 0 => $DIR/issue-84561.rs |
| 35 | 34 | Number of expressions: 0 |
| 36 | Number of file 0 mappings: 12 | |
| 35 | Number of file 0 mappings: 8 | |
| 37 | 36 | - Code(Counter(0)) at (prev + 154, 1) to (start + 0, 11) |
| 38 | 37 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) |
| 39 | - Code(Counter(1)) at (prev + 0, 12) to (start + 0, 30) | |
| 40 | 38 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) |
| 41 | - Code(Counter(2)) at (prev + 0, 12) to (start + 0, 30) | |
| 42 | 39 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) |
| 43 | 40 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) |
| 44 | - Code(Counter(3)) at (prev + 0, 12) to (start + 0, 30) | |
| 45 | 41 | - Code(Counter(0)) at (prev + 1, 5) to (start + 2, 6) |
| 46 | 42 | - Code(Counter(0)) at (prev + 3, 5) to (start + 0, 11) |
| 47 | - Code(Counter(4)) at (prev + 0, 12) to (start + 0, 30) | |
| 48 | 43 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 49 | Highest counter ID seen: c4 | |
| 44 | Highest counter ID seen: c0 | |
| 50 | 45 | |
| 51 | 46 | Function name: issue_84561::test2 |
| 52 | Raw 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] | |
| 47 | Raw bytes (20): 0x[01, 01, 00, 03, 01, b0, 01, 01, 00, 0b, 01, 01, 05, 00, 10, 01, 01, 01, 00, 02] | |
| 53 | 48 | Number of files: 1 |
| 54 | 49 | - file 0 => $DIR/issue-84561.rs |
| 55 | 50 | Number of expressions: 0 |
| 56 | Number of file 0 mappings: 4 | |
| 51 | Number of file 0 mappings: 3 | |
| 57 | 52 | - Code(Counter(0)) at (prev + 176, 1) to (start + 0, 11) |
| 58 | 53 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16) |
| 59 | - Code(Counter(1)) at (prev + 0, 17) to (start + 0, 35) | |
| 60 | 54 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 61 | Highest counter ID seen: c1 | |
| 55 | Highest counter ID seen: c0 | |
| 62 | 56 | |
| 63 | 57 | Function name: issue_84561::test2::call_print |
| 64 | Raw 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] | |
| 58 | Raw bytes (20): 0x[01, 01, 00, 03, 01, a7, 01, 09, 00, 1f, 01, 01, 0d, 00, 13, 01, 01, 09, 00, 0a] | |
| 65 | 59 | Number of files: 1 |
| 66 | 60 | - file 0 => $DIR/issue-84561.rs |
| 67 | 61 | Number of expressions: 0 |
| 68 | Number of file 0 mappings: 4 | |
| 62 | Number of file 0 mappings: 3 | |
| 69 | 63 | - Code(Counter(0)) at (prev + 167, 9) to (start + 0, 31) |
| 70 | 64 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) |
| 71 | - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 24) | |
| 72 | 65 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) |
| 73 | 66 | Highest counter ID seen: c0 |
| 74 | 67 | |
| 75 | 68 | Function name: issue_84561::test3 |
| 76 | Raw 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] | |
| 69 | Raw 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] | |
| 77 | 70 | Number of files: 1 |
| 78 | 71 | - file 0 => $DIR/issue-84561.rs |
| 79 | Number of expressions: 10 | |
| 72 | Number of expressions: 8 | |
| 80 | 73 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 81 | 74 | - expression 1 operands: lhs = Counter(0), rhs = Counter(2) |
| 82 | 75 | - expression 2 operands: lhs = Counter(0), rhs = Counter(3) |
| ... | ... | @@ -85,9 +78,7 @@ Number of expressions: 10 |
| 85 | 78 | - expression 5 operands: lhs = Counter(6), rhs = Counter(7) |
| 86 | 79 | - expression 6 operands: lhs = Counter(6), rhs = Counter(7) |
| 87 | 80 | - 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) | |
| 90 | Number of file 0 mappings: 77 | |
| 81 | Number of file 0 mappings: 64 | |
| 91 | 82 | - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11) |
| 92 | 83 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) |
| 93 | 84 | - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) |
| ... | ... | @@ -98,11 +89,8 @@ Number of file 0 mappings: 77 |
| 98 | 89 | - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) |
| 99 | 90 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 100 | 91 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 101 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 102 | 92 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 103 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 104 | 93 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 105 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 106 | 94 | - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) |
| 107 | 95 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 108 | 96 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| ... | ... | @@ -111,19 +99,14 @@ Number of file 0 mappings: 77 |
| 111 | 99 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 112 | 100 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 113 | 101 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) |
| 114 | - Code(Zero) at (prev + 0, 32) to (start + 0, 48) | |
| 115 | 102 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 116 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 117 | 103 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 118 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 119 | 104 | - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) |
| 120 | - Code(Zero) at (prev + 0, 32) to (start + 0, 36) | |
| 121 | 105 | - Code(Zero) at (prev + 0, 41) to (start + 0, 48) |
| 122 | 106 | - Code(Zero) at (prev + 0, 51) to (start + 0, 65) |
| 123 | 107 | - Code(Zero) at (prev + 0, 75) to (start + 0, 90) |
| 124 | 108 | - 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) | |
| 127 | 110 | - Code(Zero) at (prev + 2, 13) to (start + 0, 27) |
| 128 | 111 | - Code(Zero) at (prev + 2, 13) to (start + 0, 28) |
| 129 | 112 | - Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) |
| ... | ... | @@ -140,11 +123,9 @@ Number of file 0 mappings: 77 |
| 140 | 123 | = (c0 - c1) |
| 141 | 124 | - Code(Counter(0)) at (prev + 5, 8) to (start + 0, 15) |
| 142 | 125 | - 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) | |
| 145 | 127 | = (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) | |
| 148 | 129 | - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 19) |
| 149 | 130 | - Code(Counter(3)) at (prev + 1, 13) to (start + 0, 19) |
| 150 | 131 | - Code(Expression(2, Sub)) at (prev + 2, 13) to (start + 0, 19) |
| ... | ... | @@ -154,7 +135,7 @@ Number of file 0 mappings: 77 |
| 154 | 135 | - Code(Counter(5)) at (prev + 1, 13) to (start + 0, 19) |
| 155 | 136 | - Code(Expression(3, Sub)) at (prev + 2, 13) to (start + 0, 19) |
| 156 | 137 | = (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) | |
| 158 | 139 | = (c7 + c8) |
| 159 | 140 | - Code(Counter(6)) at (prev + 1, 12) to (start + 0, 19) |
| 160 | 141 | - Code(Counter(7)) at (prev + 1, 13) to (start + 0, 23) |
| ... | ... | @@ -167,12 +148,8 @@ Number of file 0 mappings: 77 |
| 167 | 148 | - Code(Expression(7, Sub)) at (prev + 2, 21) to (start + 0, 27) |
| 168 | 149 | = (c6 - c7) |
| 169 | 150 | - 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) | |
| 177 | 154 | Highest counter ID seen: c9 |
| 178 | 155 |
tests/coverage/issue-84561.coverage+7-11| ... | ... | @@ -22,18 +22,17 @@ |
| 22 | 22 | LL| 1| assert_ne!(bar, Foo(3)); |
| 23 | 23 | LL| 1| assert_ne!(Foo(0), Foo(4)); |
| 24 | 24 | LL| 1| assert_eq!(Foo(3), Foo(3), "with a message"); |
| 25 | ^0 | |
| 26 | 25 | LL| 1| println!("{:?}", bar); |
| 27 | 26 | LL| 1| println!("{:?}", Foo(1)); |
| 28 | 27 | LL| | |
| 29 | 28 | 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 | |
| 31 | 30 | LL| 1| assert_ne!( |
| 32 | 31 | LL| | Foo(0) |
| 33 | 32 | LL| | , |
| 34 | 33 | LL| | Foo(5) |
| 35 | 34 | LL| | , |
| 36 | LL| 0| "{}" | |
| 35 | LL| | "{}" | |
| 37 | 36 | LL| | , |
| 38 | 37 | LL| | if |
| 39 | 38 | LL| 0| is_true |
| ... | ... | @@ -78,13 +77,13 @@ |
| 78 | 77 | LL| 1| assert_ne!( |
| 79 | 78 | LL| | Foo(0), |
| 80 | 79 | LL| | Foo(4), |
| 81 | LL| 0| "with a message" | |
| 80 | LL| | "with a message" | |
| 82 | 81 | LL| | ); |
| 83 | 82 | LL| | } else { |
| 84 | 83 | LL| 0| assert_eq!( |
| 85 | 84 | LL| | Foo(3), |
| 86 | 85 | LL| | Foo(3), |
| 87 | LL| 0| "with a message" | |
| 86 | LL| | "with a message" | |
| 88 | 87 | LL| | ); |
| 89 | 88 | LL| | } |
| 90 | 89 | LL| 1| assert_ne!( |
| ... | ... | @@ -122,17 +121,17 @@ |
| 122 | 121 | LL| 0| Foo(1) |
| 123 | 122 | LL| | }, |
| 124 | 123 | LL| | Foo(5), |
| 125 | LL| 0| "with a message" | |
| 124 | LL| | "with a message" | |
| 126 | 125 | LL| | ); |
| 127 | 126 | LL| 1| assert_eq!( |
| 128 | 127 | LL| | Foo(1), |
| 129 | 128 | LL| | Foo(3), |
| 130 | LL| 1| "this assert should fail" | |
| 129 | LL| | "this assert should fail" | |
| 131 | 130 | LL| | ); |
| 132 | 131 | LL| 0| assert_eq!( |
| 133 | 132 | LL| | Foo(3), |
| 134 | 133 | LL| | Foo(3), |
| 135 | LL| 0| "this assert should not be reached" | |
| 134 | LL| | "this assert should not be reached" | |
| 136 | 135 | LL| | ); |
| 137 | 136 | LL| 0|} |
| 138 | 137 | LL| | |
| ... | ... | @@ -156,12 +155,9 @@ |
| 156 | 155 | LL| | |
| 157 | 156 | LL| 1|fn test1() { |
| 158 | 157 | LL| 1| debug!("debug is enabled"); |
| 159 | ^0 | |
| 160 | 158 | LL| 1| debug!("debug is enabled"); |
| 161 | ^0 | |
| 162 | 159 | LL| 1| let _ = 0; |
| 163 | 160 | LL| 1| debug!("debug is enabled"); |
| 164 | ^0 | |
| 165 | 161 | LL| 1| unsafe { |
| 166 | 162 | LL| 1| DEBUG_LEVEL_ENABLED = true; |
| 167 | 163 | LL| 1| } |
tests/coverage/loops_branches.cov-map+6-12| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | Function name: <loops_branches::DebugTest as core::fmt::Debug>::fmt |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/loops_branches.rs |
| 5 | 5 | Number of expressions: 5 |
| ... | ... | @@ -8,7 +8,7 @@ Number of expressions: 5 |
| 8 | 8 | - expression 2 operands: lhs = Counter(0), rhs = Counter(2) |
| 9 | 9 | - expression 3 operands: lhs = Counter(1), rhs = Counter(3) |
| 10 | 10 | - expression 4 operands: lhs = Counter(3), rhs = Counter(2) |
| 11 | Number of file 0 mappings: 25 | |
| 11 | Number of file 0 mappings: 23 | |
| 12 | 12 | - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 67) |
| 13 | 13 | - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 16) |
| 14 | 14 | - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 21) |
| ... | ... | @@ -17,7 +17,6 @@ Number of file 0 mappings: 25 |
| 17 | 17 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) |
| 18 | 18 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) |
| 19 | 19 | - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21) |
| 20 | - Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29) | |
| 21 | 20 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31) |
| 22 | 21 | - Code(Zero) at (prev + 1, 16) to (start + 1, 10) |
| 23 | 22 | - Code(Counter(2)) at (prev + 3, 13) to (start + 0, 14) |
| ... | ... | @@ -30,7 +29,6 @@ Number of file 0 mappings: 25 |
| 30 | 29 | - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) |
| 31 | 30 | - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) |
| 32 | 31 | - Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25) |
| 33 | - Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33) | |
| 34 | 32 | - Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35) |
| 35 | 33 | = ((c0 + c2) - (c1 + c3)) |
| 36 | 34 | - Code(Zero) at (prev + 1, 20) to (start + 1, 14) |
| ... | ... | @@ -40,7 +38,7 @@ Number of file 0 mappings: 25 |
| 40 | 38 | Highest counter ID seen: c2 |
| 41 | 39 | |
| 42 | 40 | Function name: <loops_branches::DisplayTest as core::fmt::Display>::fmt |
| 43 | Raw 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] | |
| 41 | Raw 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] | |
| 44 | 42 | Number of files: 1 |
| 45 | 43 | - file 0 => $DIR/loops_branches.rs |
| 46 | 44 | Number of expressions: 5 |
| ... | ... | @@ -49,7 +47,7 @@ Number of expressions: 5 |
| 49 | 47 | - expression 2 operands: lhs = Counter(0), rhs = Counter(2) |
| 50 | 48 | - expression 3 operands: lhs = Counter(3), rhs = Counter(1) |
| 51 | 49 | - expression 4 operands: lhs = Counter(3), rhs = Counter(2) |
| 52 | Number of file 0 mappings: 25 | |
| 50 | Number of file 0 mappings: 23 | |
| 53 | 51 | - Code(Counter(0)) at (prev + 34, 5) to (start + 0, 67) |
| 54 | 52 | - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 17) |
| 55 | 53 | - Code(Zero) at (prev + 0, 18) to (start + 1, 10) |
| ... | ... | @@ -59,7 +57,6 @@ Number of file 0 mappings: 25 |
| 59 | 57 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) |
| 60 | 58 | - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) |
| 61 | 59 | - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21) |
| 62 | - Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29) | |
| 63 | 60 | - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31) |
| 64 | 61 | - Code(Counter(2)) at (prev + 2, 13) to (start + 0, 14) |
| 65 | 62 | - Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 23) |
| ... | ... | @@ -72,7 +69,6 @@ Number of file 0 mappings: 25 |
| 72 | 69 | - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) |
| 73 | 70 | - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) |
| 74 | 71 | - Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25) |
| 75 | - Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33) | |
| 76 | 72 | - Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35) |
| 77 | 73 | = ((c0 + c2) - (c3 + c1)) |
| 78 | 74 | - Code(Expression(4, Sub)) at (prev + 3, 9) to (start + 0, 15) |
| ... | ... | @@ -81,20 +77,18 @@ Number of file 0 mappings: 25 |
| 81 | 77 | Highest counter ID seen: c2 |
| 82 | 78 | |
| 83 | 79 | Function name: loops_branches::main |
| 84 | Raw 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] | |
| 80 | Raw 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] | |
| 85 | 81 | Number of files: 1 |
| 86 | 82 | - file 0 => $DIR/loops_branches.rs |
| 87 | 83 | Number of expressions: 0 |
| 88 | Number of file 0 mappings: 10 | |
| 84 | Number of file 0 mappings: 8 | |
| 89 | 85 | - Code(Counter(0)) at (prev + 55, 1) to (start + 0, 10) |
| 90 | 86 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19) |
| 91 | 87 | - Code(Counter(0)) at (prev + 0, 22) to (start + 0, 31) |
| 92 | 88 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 93 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20) | |
| 94 | 89 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21) |
| 95 | 90 | - Code(Counter(0)) at (prev + 0, 24) to (start + 0, 35) |
| 96 | 91 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 97 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18) | |
| 98 | 92 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 99 | 93 | Highest counter ID seen: c0 |
| 100 | 94 |
tests/coverage/macro_in_closure.cov-map+4-6| ... | ... | @@ -1,22 +1,20 @@ |
| 1 | 1 | Function name: macro_in_closure::NO_BLOCK::{closure#0} |
| 2 | Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 1c, 00, 24, 01, 00, 25, 00, 2c] | |
| 2 | Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 1c, 00, 24] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/macro_in_closure.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 2 | |
| 6 | Number of file 0 mappings: 1 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 7, 28) to (start + 0, 36) |
| 8 | - Code(Counter(0)) at (prev + 0, 37) to (start + 0, 44) | |
| 9 | 8 | Highest counter ID seen: c0 |
| 10 | 9 | |
| 11 | 10 | Function name: macro_in_closure::WITH_BLOCK::{closure#0} |
| 12 | Raw 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] | |
| 11 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 1e, 00, 1f, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 13 | 12 | Number of files: 1 |
| 14 | 13 | - file 0 => $DIR/macro_in_closure.rs |
| 15 | 14 | Number of expressions: 0 |
| 16 | Number of file 0 mappings: 4 | |
| 15 | Number of file 0 mappings: 3 | |
| 17 | 16 | - Code(Counter(0)) at (prev + 9, 30) to (start + 0, 31) |
| 18 | 17 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 19 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 21) | |
| 20 | 18 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 21 | 19 | Highest counter ID seen: c0 |
| 22 | 20 |
tests/coverage/no_cov_crate.cov-map+10-15| ... | ... | @@ -1,36 +1,33 @@ |
| 1 | 1 | Function name: no_cov_crate::add_coverage_1 |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/no_cov_crate.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 22, 1) to (start + 0, 20) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| 13 | 12 | Function name: no_cov_crate::add_coverage_2 |
| 14 | Raw 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] | |
| 13 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 15 | 14 | Number of files: 1 |
| 16 | 15 | - file 0 => $DIR/no_cov_crate.rs |
| 17 | 16 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 4 | |
| 17 | Number of file 0 mappings: 3 | |
| 19 | 18 | - Code(Counter(0)) at (prev + 26, 1) to (start + 0, 20) |
| 20 | 19 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 21 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) | |
| 22 | 20 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 23 | 21 | Highest counter ID seen: c0 |
| 24 | 22 | |
| 25 | 23 | Function name: no_cov_crate::add_coverage_not_called (unused) |
| 26 | Raw 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] | |
| 24 | Raw bytes (19): 0x[01, 01, 00, 03, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02] | |
| 27 | 25 | Number of files: 1 |
| 28 | 26 | - file 0 => $DIR/no_cov_crate.rs |
| 29 | 27 | Number of expressions: 0 |
| 30 | Number of file 0 mappings: 4 | |
| 28 | Number of file 0 mappings: 3 | |
| 31 | 29 | - Code(Zero) at (prev + 31, 1) to (start + 0, 29) |
| 32 | 30 | - Code(Zero) at (prev + 1, 5) to (start + 0, 13) |
| 33 | - Code(Zero) at (prev + 0, 14) to (start + 0, 38) | |
| 34 | 31 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 35 | 32 | Highest counter ID seen: (none) |
| 36 | 33 | |
| ... | ... | @@ -57,28 +54,26 @@ Number of file 0 mappings: 14 |
| 57 | 54 | Highest counter ID seen: c0 |
| 58 | 55 | |
| 59 | 56 | Function name: no_cov_crate::nested_fns::outer |
| 60 | Raw 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] | |
| 57 | Raw 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] | |
| 61 | 58 | Number of files: 1 |
| 62 | 59 | - file 0 => $DIR/no_cov_crate.rs |
| 63 | 60 | Number of expressions: 0 |
| 64 | Number of file 0 mappings: 6 | |
| 61 | Number of file 0 mappings: 5 | |
| 65 | 62 | - Code(Counter(0)) at (prev + 51, 5) to (start + 0, 32) |
| 66 | 63 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 67 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) | |
| 68 | 64 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 26) |
| 69 | 65 | - Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) |
| 70 | 66 | - Code(Counter(0)) at (prev + 10, 5) to (start + 0, 6) |
| 71 | 67 | Highest counter ID seen: c0 |
| 72 | 68 | |
| 73 | 69 | Function name: no_cov_crate::nested_fns::outer_both_covered |
| 74 | Raw 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] | |
| 70 | Raw 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] | |
| 75 | 71 | Number of files: 1 |
| 76 | 72 | - file 0 => $DIR/no_cov_crate.rs |
| 77 | 73 | Number of expressions: 0 |
| 78 | Number of file 0 mappings: 6 | |
| 74 | Number of file 0 mappings: 5 | |
| 79 | 75 | - Code(Counter(0)) at (prev + 65, 5) to (start + 0, 45) |
| 80 | 76 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) |
| 81 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) | |
| 82 | 77 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) |
| 83 | 78 | - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 22) |
| 84 | 79 | - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 6) |
tests/coverage/overflow.cov-map+4-8| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | Function name: overflow::main |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/overflow.rs |
| 5 | 5 | Number of expressions: 6 |
| ... | ... | @@ -9,7 +9,7 @@ Number of expressions: 6 |
| 9 | 9 | - expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) |
| 10 | 10 | - expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) |
| 11 | 11 | - expression 5 operands: lhs = Counter(0), rhs = Counter(2) |
| 12 | Number of file 0 mappings: 16 | |
| 12 | Number of file 0 mappings: 14 | |
| 13 | 13 | - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 28) |
| 14 | 14 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) |
| 15 | 15 | - Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) |
| ... | ... | @@ -18,12 +18,10 @@ Number of file 0 mappings: 16 |
| 18 | 18 | = (c1 - c0) |
| 19 | 19 | - Code(Counter(2)) at (prev + 0, 27) to (start + 3, 10) |
| 20 | 20 | - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) |
| 21 | - Code(Counter(2)) at (prev + 0, 26) to (start + 0, 40) | |
| 22 | 21 | - Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) |
| 23 | 22 | = (c1 - (c0 + c2)) |
| 24 | 23 | - Code(Counter(3)) at (prev + 0, 33) to (start + 3, 10) |
| 25 | 24 | - Code(Counter(3)) at (prev + 1, 17) to (start + 0, 23) |
| 26 | - Code(Counter(3)) at (prev + 0, 26) to (start + 0, 40) | |
| 27 | 25 | - Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) |
| 28 | 26 | = (c1 - ((c0 + c2) + c3)) |
| 29 | 27 | - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) |
| ... | ... | @@ -33,12 +31,12 @@ Number of file 0 mappings: 16 |
| 33 | 31 | Highest counter ID seen: c3 |
| 34 | 32 | |
| 35 | 33 | Function name: overflow::might_overflow |
| 36 | Raw 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] | |
| 34 | Raw 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] | |
| 37 | 35 | Number of files: 1 |
| 38 | 36 | - file 0 => $DIR/overflow.rs |
| 39 | 37 | Number of expressions: 1 |
| 40 | 38 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 41 | Number of file 0 mappings: 14 | |
| 39 | Number of file 0 mappings: 12 | |
| 42 | 40 | - Code(Counter(0)) at (prev + 5, 1) to (start + 0, 38) |
| 43 | 41 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 18) |
| 44 | 42 | - Code(Counter(1)) at (prev + 0, 19) to (start + 2, 6) |
| ... | ... | @@ -47,11 +45,9 @@ Number of file 0 mappings: 14 |
| 47 | 45 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) |
| 48 | 46 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 30) |
| 49 | 47 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 50 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 38) | |
| 51 | 48 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) |
| 52 | 49 | - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 33) |
| 53 | 50 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 54 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 47) | |
| 55 | 51 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) |
| 56 | 52 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 57 | 53 | Highest counter ID seen: c1 |
tests/coverage/panic_unwind.cov-map+2-3| ... | ... | @@ -29,16 +29,15 @@ Number of file 0 mappings: 12 |
| 29 | 29 | Highest counter ID seen: c3 |
| 30 | 30 | |
| 31 | 31 | Function name: panic_unwind::might_panic |
| 32 | Raw 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] | |
| 32 | Raw 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] | |
| 33 | 33 | Number of files: 1 |
| 34 | 34 | - file 0 => $DIR/panic_unwind.rs |
| 35 | 35 | Number of expressions: 1 |
| 36 | 36 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 37 | Number of file 0 mappings: 7 | |
| 37 | Number of file 0 mappings: 6 | |
| 38 | 38 | - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 35) |
| 39 | 39 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20) |
| 40 | 40 | - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17) |
| 41 | - Code(Counter(1)) at (prev + 0, 18) to (start + 0, 32) | |
| 42 | 41 | - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) |
| 43 | 42 | - Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6) |
| 44 | 43 | = (c0 - c1) |
tests/coverage/partial_eq.cov-map+3-4| ... | ... | @@ -11,19 +11,18 @@ Number of file 0 mappings: 4 |
| 11 | 11 | Highest counter ID seen: c0 |
| 12 | 12 | |
| 13 | 13 | Function name: partial_eq::main |
| 14 | Raw 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] | |
| 14 | Raw 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] | |
| 15 | 15 | Number of files: 1 |
| 16 | 16 | - file 0 => $DIR/partial_eq.rs |
| 17 | 17 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 9 | |
| 18 | Number of file 0 mappings: 8 | |
| 19 | 19 | - Code(Counter(0)) at (prev + 17, 1) to (start + 0, 10) |
| 20 | 20 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) |
| 21 | 21 | - Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) |
| 22 | 22 | - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) |
| 23 | 23 | - Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) |
| 24 | 24 | - 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) | |
| 27 | 26 | - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) |
| 28 | 27 | Highest counter ID seen: c0 |
| 29 | 28 |
tests/coverage/partial_eq.coverage+1-1| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | LL| 1| let version_3_3_0 = Version::new(3, 3, 0); |
| 20 | 20 | LL| | |
| 21 | 21 | LL| 1| println!( |
| 22 | LL| 1| "{:?} < {:?} = {}", | |
| 22 | LL| | "{:?} < {:?} = {}", | |
| 23 | 23 | LL| | version_3_2_1, |
| 24 | 24 | LL| | version_3_3_0, |
| 25 | 25 | LL| 1| version_3_2_1 < version_3_3_0, // |
tests/coverage/rustfmt-skip.cov-map+3-4| ... | ... | @@ -1,12 +1,11 @@ |
| 1 | 1 | Function name: rustfmt_skip::main |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 0a, 01, 00, 0a, 01, 02, 05, 00, 0d, 01, 05, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/rustfmt-skip.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 10, 1) to (start + 0, 10) |
| 8 | 8 | - 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) | |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 |
tests/coverage/rustfmt-skip.coverage+1-1| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | LL| 1| println!( |
| 13 | 13 | LL| | // Keep this on a separate line, to distinguish instrumentation of |
| 14 | 14 | LL| | // `println!` from instrumentation of its arguments. |
| 15 | LL| 1| "hello" | |
| 15 | LL| | "hello" | |
| 16 | 16 | LL| | ); |
| 17 | 17 | LL| 1|} |
| 18 | 18 |
tests/coverage/sort_groups.cov-map+12-16| ... | ... | @@ -1,63 +1,59 @@ |
| 1 | 1 | Function name: sort_groups::generic_fn::<&str> |
| 2 | Raw 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] | |
| 2 | Raw 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] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/sort_groups.rs |
| 5 | 5 | Number of expressions: 1 |
| 6 | 6 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 7 | Number of file 0 mappings: 6 | |
| 7 | Number of file 0 mappings: 5 | |
| 8 | 8 | - Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29) |
| 9 | 9 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) |
| 10 | 10 | - 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) | |
| 13 | 12 | = (c0 - c1) |
| 14 | 13 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 15 | 14 | Highest counter ID seen: c1 |
| 16 | 15 | |
| 17 | 16 | Function name: sort_groups::generic_fn::<()> |
| 18 | Raw 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] | |
| 17 | Raw 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] | |
| 19 | 18 | Number of files: 1 |
| 20 | 19 | - file 0 => $DIR/sort_groups.rs |
| 21 | 20 | Number of expressions: 1 |
| 22 | 21 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 23 | Number of file 0 mappings: 6 | |
| 22 | Number of file 0 mappings: 5 | |
| 24 | 23 | - Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29) |
| 25 | 24 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) |
| 26 | 25 | - 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) | |
| 29 | 27 | = (c0 - c1) |
| 30 | 28 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 31 | 29 | Highest counter ID seen: c1 |
| 32 | 30 | |
| 33 | 31 | Function name: sort_groups::generic_fn::<char> |
| 34 | Raw 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] | |
| 32 | Raw 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] | |
| 35 | 33 | Number of files: 1 |
| 36 | 34 | - file 0 => $DIR/sort_groups.rs |
| 37 | 35 | Number of expressions: 1 |
| 38 | 36 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 39 | Number of file 0 mappings: 6 | |
| 37 | Number of file 0 mappings: 5 | |
| 40 | 38 | - Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29) |
| 41 | 39 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) |
| 42 | 40 | - 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) | |
| 45 | 42 | = (c0 - c1) |
| 46 | 43 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 47 | 44 | Highest counter ID seen: c1 |
| 48 | 45 | |
| 49 | 46 | Function name: sort_groups::generic_fn::<i32> |
| 50 | Raw 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] | |
| 47 | Raw 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] | |
| 51 | 48 | Number of files: 1 |
| 52 | 49 | - file 0 => $DIR/sort_groups.rs |
| 53 | 50 | Number of expressions: 1 |
| 54 | 51 | - expression 0 operands: lhs = Counter(0), rhs = Counter(1) |
| 55 | Number of file 0 mappings: 6 | |
| 52 | Number of file 0 mappings: 5 | |
| 56 | 53 | - Code(Counter(0)) at (prev + 17, 1) to (start + 0, 29) |
| 57 | 54 | - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) |
| 58 | 55 | - 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) | |
| 61 | 57 | = (c0 - c1) |
| 62 | 58 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 63 | 59 | Highest counter ID seen: c1 |
tests/coverage/unused_mod.cov-map+4-6| ... | ... | @@ -1,24 +1,22 @@ |
| 1 | 1 | Function name: unused_mod::main |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/unused_mod.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 28) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| 13 | 12 | Function name: unused_mod::unused_module::never_called_function (unused) |
| 14 | Raw 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] | |
| 13 | Raw bytes (19): 0x[01, 02, 00, 03, 00, 02, 01, 00, 1f, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02] | |
| 15 | 14 | Number of files: 1 |
| 16 | 15 | - file 0 => $DIR/auxiliary/unused_mod_helper.rs |
| 17 | 16 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 4 | |
| 17 | Number of file 0 mappings: 3 | |
| 19 | 18 | - Code(Zero) at (prev + 2, 1) to (start + 0, 31) |
| 20 | 19 | - Code(Zero) at (prev + 1, 5) to (start + 0, 13) |
| 21 | - Code(Zero) at (prev + 0, 14) to (start + 0, 33) | |
| 22 | 20 | - Code(Zero) at (prev + 1, 1) to (start + 0, 2) |
| 23 | 21 | Highest counter ID seen: (none) |
| 24 | 22 |
tests/coverage/uses_crate.cov-map+8-12| ... | ... | @@ -1,48 +1,44 @@ |
| 1 | 1 | Function name: used_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>> |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 1b, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/auxiliary/used_crate.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 76) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 79) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| 13 | 12 | Function name: used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>> |
| 14 | Raw 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] | |
| 13 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 15 | 14 | Number of files: 1 |
| 16 | 15 | - file 0 => $DIR/auxiliary/used_crate.rs |
| 17 | 16 | Number of expressions: 0 |
| 18 | Number of file 0 mappings: 4 | |
| 17 | Number of file 0 mappings: 3 | |
| 19 | 18 | - Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67) |
| 20 | 19 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 21 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70) | |
| 22 | 20 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 23 | 21 | Highest counter ID seen: c0 |
| 24 | 22 | |
| 25 | 23 | Function name: used_crate::used_only_from_bin_crate_generic_function::<&str> |
| 26 | Raw 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] | |
| 24 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 27 | 25 | Number of files: 1 |
| 28 | 26 | - file 0 => $DIR/auxiliary/used_crate.rs |
| 29 | 27 | Number of expressions: 0 |
| 30 | Number of file 0 mappings: 4 | |
| 28 | Number of file 0 mappings: 3 | |
| 31 | 29 | - Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67) |
| 32 | 30 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 33 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70) | |
| 34 | 31 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 35 | 32 | Highest counter ID seen: c0 |
| 36 | 33 | |
| 37 | 34 | Function name: used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str> |
| 38 | Raw 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] | |
| 35 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 39 | 36 | Number of files: 1 |
| 40 | 37 | - file 0 => $DIR/auxiliary/used_crate.rs |
| 41 | 38 | Number of expressions: 0 |
| 42 | Number of file 0 mappings: 4 | |
| 39 | Number of file 0 mappings: 3 | |
| 43 | 40 | - Code(Counter(0)) at (prev + 31, 1) to (start + 0, 91) |
| 44 | 41 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 45 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 94) | |
| 46 | 42 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 47 | 43 | Highest counter ID seen: c0 |
| 48 | 44 |
tests/coverage/uses_inline_crate.cov-map+8-12| ... | ... | @@ -1,12 +1,11 @@ |
| 1 | 1 | Function name: used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::<alloc::vec::Vec<i32>> |
| 2 | Raw 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] | |
| 2 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 2c, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 3 | 3 | Number of files: 1 |
| 4 | 4 | - file 0 => $DIR/auxiliary/used_inline_crate.rs |
| 5 | 5 | Number of expressions: 0 |
| 6 | Number of file 0 mappings: 4 | |
| 6 | Number of file 0 mappings: 3 | |
| 7 | 7 | - Code(Counter(0)) at (prev + 44, 1) to (start + 0, 76) |
| 8 | 8 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 9 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 79) | |
| 10 | 9 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 11 | 10 | Highest counter ID seen: c0 |
| 12 | 11 | |
| ... | ... | @@ -31,38 +30,35 @@ Number of file 0 mappings: 10 |
| 31 | 30 | Highest counter ID seen: c1 |
| 32 | 31 | |
| 33 | 32 | Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>> |
| 34 | Raw 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] | |
| 33 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 35 | 34 | Number of files: 1 |
| 36 | 35 | - file 0 => $DIR/auxiliary/used_inline_crate.rs |
| 37 | 36 | Number of expressions: 0 |
| 38 | Number of file 0 mappings: 4 | |
| 37 | Number of file 0 mappings: 3 | |
| 39 | 38 | - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67) |
| 40 | 39 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 41 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70) | |
| 42 | 40 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 43 | 41 | Highest counter ID seen: c0 |
| 44 | 42 | |
| 45 | 43 | Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&str> |
| 46 | Raw 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] | |
| 44 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 47 | 45 | Number of files: 1 |
| 48 | 46 | - file 0 => $DIR/auxiliary/used_inline_crate.rs |
| 49 | 47 | Number of expressions: 0 |
| 50 | Number of file 0 mappings: 4 | |
| 48 | Number of file 0 mappings: 3 | |
| 51 | 49 | - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67) |
| 52 | 50 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 53 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 70) | |
| 54 | 51 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 55 | 52 | Highest counter ID seen: c0 |
| 56 | 53 | |
| 57 | 54 | Function name: used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str> |
| 58 | Raw 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] | |
| 55 | Raw bytes (19): 0x[01, 01, 00, 03, 01, 31, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] | |
| 59 | 56 | Number of files: 1 |
| 60 | 57 | - file 0 => $DIR/auxiliary/used_inline_crate.rs |
| 61 | 58 | Number of expressions: 0 |
| 62 | Number of file 0 mappings: 4 | |
| 59 | Number of file 0 mappings: 3 | |
| 63 | 60 | - Code(Counter(0)) at (prev + 49, 1) to (start + 0, 91) |
| 64 | 61 | - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) |
| 65 | - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 94) | |
| 66 | 62 | - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) |
| 67 | 63 | Highest counter ID seen: c0 |
| 68 | 64 |
tests/incremental/hashes/inherent_impls.rs+4-16| ... | ... | @@ -72,15 +72,9 @@ impl Foo { |
| 72 | 72 | // This should affect the method itself, but not the impl. |
| 73 | 73 | #[cfg(any(cfail1,cfail4))] |
| 74 | 74 | impl Foo { |
| 75 | //------------ | |
| 76 | //--------------- | |
| 77 | //---------------------------------------------------------------- | |
| 78 | // | |
| 75 | //----------------------------------------------------------------------------- | |
| 79 | 76 | //-------------------------- |
| 80 | //------------ | |
| 81 | //--------------- | |
| 82 | //---------------------------------------------------------------- | |
| 83 | // | |
| 77 | //----------------------------------------------------------------------------- | |
| 84 | 78 | //-------------------------- |
| 85 | 79 | #[inline] |
| 86 | 80 | pub fn method_body_inlined() { |
| ... | ... | @@ -94,15 +88,9 @@ impl Foo { |
| 94 | 88 | #[rustc_clean(cfg="cfail5")] |
| 95 | 89 | #[rustc_clean(cfg="cfail6")] |
| 96 | 90 | impl 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")] | |
| 101 | 92 | #[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")] | |
| 106 | 94 | #[rustc_clean(cfg="cfail6")] |
| 107 | 95 | #[inline] |
| 108 | 96 | pub fn method_body_inlined() { |
tests/incremental/hygiene/auxiliary/cached_hygiene.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ macro_rules! first_macro { |
| 13 | 13 | } |
| 14 | 14 | } |
| 15 | 15 | |
| 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")] | |
| 17 | 17 | #[inline(always)] |
| 18 | 18 | pub fn changed_fn() { |
| 19 | 19 | // This will cause additional hygiene to be generate, |
tests/incremental/string_constant.rs+1-1| ... | ... | @@ -17,7 +17,7 @@ pub mod x { |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | #[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")] | |
| 21 | 21 | pub fn x() { |
| 22 | 22 | println!("{}", "2"); |
| 23 | 23 | } |
tests/mir-opt/gvn.slices.GVN.panic-abort.diff+10-5| ... | ... | @@ -209,9 +209,10 @@ |
| 209 | 209 | + _27 = &(*_12); |
| 210 | 210 | _26 = &(*_27); |
| 211 | 211 | StorageLive(_28); |
| 212 | _28 = Option::<Arguments<'_>>::None; | |
| 212 | - _28 = Option::<Arguments<'_>>::None; | |
| 213 | 213 | - _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; | |
| 215 | 216 | } |
| 216 | 217 | |
| 217 | 218 | bb7: { |
| ... | ... | @@ -311,11 +312,15 @@ |
| 311 | 312 | + _53 = &(*_38); |
| 312 | 313 | _52 = &(*_53); |
| 313 | 314 | StorageLive(_54); |
| 314 | _54 = Option::<Arguments<'_>>::None; | |
| 315 | - _54 = Option::<Arguments<'_>>::None; | |
| 315 | 316 | - _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; | |
| 317 | 319 | } |
| 318 | 320 | } |
| 319 | 321 | |
| 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) { .. } | |
| 321 | 326 |
tests/mir-opt/gvn.slices.GVN.panic-unwind.diff+10-5| ... | ... | @@ -209,9 +209,10 @@ |
| 209 | 209 | + _27 = &(*_12); |
| 210 | 210 | _26 = &(*_27); |
| 211 | 211 | StorageLive(_28); |
| 212 | _28 = Option::<Arguments<'_>>::None; | |
| 212 | - _28 = Option::<Arguments<'_>>::None; | |
| 213 | 213 | - _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; | |
| 215 | 216 | } |
| 216 | 217 | |
| 217 | 218 | bb7: { |
| ... | ... | @@ -311,11 +312,15 @@ |
| 311 | 312 | + _53 = &(*_38); |
| 312 | 313 | _52 = &(*_53); |
| 313 | 314 | StorageLive(_54); |
| 314 | _54 = Option::<Arguments<'_>>::None; | |
| 315 | - _54 = Option::<Arguments<'_>>::None; | |
| 315 | 316 | - _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; | |
| 317 | 319 | } |
| 318 | 320 | } |
| 319 | 321 | |
| 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) { .. } | |
| 321 | 326 |
tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir-1| ... | ... | @@ -164,7 +164,6 @@ fn array_casts() -> () { |
| 164 | 164 | _31 = &(*_32); |
| 165 | 165 | StorageLive(_33); |
| 166 | 166 | _33 = Option::<Arguments<'_>>::None; |
| 167 | Retag(_33); | |
| 168 | 167 | _27 = core::panicking::assert_failed::<usize, usize>(move _28, move _29, move _31, move _33) -> unwind unreachable; |
| 169 | 168 | } |
| 170 | 169 | } |
tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir-1| ... | ... | @@ -164,7 +164,6 @@ fn array_casts() -> () { |
| 164 | 164 | _31 = &(*_32); |
| 165 | 165 | StorageLive(_33); |
| 166 | 166 | _33 = Option::<Arguments<'_>>::None; |
| 167 | Retag(_33); | |
| 168 | 167 | _27 = core::panicking::assert_failed::<usize, usize>(move _28, move _29, move _31, move _33) -> unwind continue; |
| 169 | 168 | } |
| 170 | 169 | } |
tests/mir-opt/sroa/lifetimes.foo.ScalarReplacementOfAggregates.diff+52-51| ... | ... | @@ -17,23 +17,22 @@ |
| 17 | 17 | let mut _17: &std::boxed::Box<dyn std::fmt::Display>; |
| 18 | 18 | let mut _18: core::fmt::rt::Argument<'_>; |
| 19 | 19 | 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; | |
| 28 | 29 | 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; | |
| 33 | 32 | scope 1 { |
| 34 | 33 | - 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; | |
| 37 | 36 | let _5: std::result::Result<std::boxed::Box<dyn std::fmt::Display>, <T as Err>::Err>; |
| 38 | 37 | scope 2 { |
| 39 | 38 | debug x => _5; |
| ... | ... | @@ -44,16 +43,15 @@ |
| 44 | 43 | debug x => _8; |
| 45 | 44 | let _8: std::boxed::Box<dyn std::fmt::Display>; |
| 46 | 45 | 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; | |
| 49 | 48 | scope 5 { |
| 50 | 49 | - 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; | |
| 53 | 52 | let _15: [core::fmt::rt::Argument<'_>; 2]; |
| 54 | 53 | scope 6 { |
| 55 | 54 | debug args => _15; |
| 56 | let mut _25: &[&str; 3]; | |
| 57 | 55 | } |
| 58 | 56 | } |
| 59 | 57 | } |
| ... | ... | @@ -62,10 +60,10 @@ |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | 62 | bb0: { |
| 65 | _28 = const false; | |
| 63 | _26 = const false; | |
| 66 | 64 | - StorageLive(_1); |
| 67 | + StorageLive(_32); | |
| 68 | + StorageLive(_33); | |
| 65 | + StorageLive(_30); | |
| 66 | + StorageLive(_31); | |
| 69 | 67 | + nop; |
| 70 | 68 | StorageLive(_2); |
| 71 | 69 | StorageLive(_3); |
| ... | ... | @@ -79,17 +77,17 @@ |
| 79 | 77 | _2 = Result::<Box<dyn std::fmt::Display>, <T as Err>::Err>::Ok(move _3); |
| 80 | 78 | StorageDead(_3); |
| 81 | 79 | - _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; | |
| 84 | 82 | + nop; |
| 85 | 83 | StorageDead(_2); |
| 86 | 84 | StorageLive(_5); |
| 87 | _28 = const true; | |
| 85 | _26 = const true; | |
| 88 | 86 | - _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; | |
| 90 | 88 | StorageLive(_6); |
| 91 | 89 | - _6 = copy (_1.1: u32); |
| 92 | + _6 = copy _33; | |
| 90 | + _6 = copy _31; | |
| 93 | 91 | _7 = discriminant(_5); |
| 94 | 92 | switchInt(move _7) -> [0: bb2, otherwise: bb7]; |
| 95 | 93 | } |
| ... | ... | @@ -101,25 +99,25 @@ |
| 101 | 99 | StorageLive(_10); |
| 102 | 100 | StorageLive(_11); |
| 103 | 101 | - StorageLive(_12); |
| 104 | + StorageLive(_34); | |
| 105 | + StorageLive(_35); | |
| 102 | + StorageLive(_32); | |
| 103 | + StorageLive(_33); | |
| 106 | 104 | + nop; |
| 107 | 105 | StorageLive(_13); |
| 108 | 106 | _13 = &_8; |
| 109 | 107 | StorageLive(_14); |
| 110 | 108 | _14 = &_6; |
| 111 | 109 | - _12 = (move _13, move _14); |
| 112 | + _34 = move _13; | |
| 113 | + _35 = move _14; | |
| 110 | + _32 = move _13; | |
| 111 | + _33 = move _14; | |
| 114 | 112 | + nop; |
| 115 | 113 | StorageDead(_14); |
| 116 | 114 | StorageDead(_13); |
| 117 | 115 | StorageLive(_15); |
| 118 | 116 | StorageLive(_16); |
| 119 | 117 | 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); | |
| 123 | 121 | _16 = core::fmt::rt::Argument::<'_>::new_display::<Box<dyn std::fmt::Display>>(move _17) -> [return: bb3, unwind unreachable]; |
| 124 | 122 | } |
| 125 | 123 | |
| ... | ... | @@ -127,9 +125,9 @@ |
| 127 | 125 | StorageDead(_17); |
| 128 | 126 | StorageLive(_18); |
| 129 | 127 | 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); | |
| 133 | 131 | _18 = core::fmt::rt::Argument::<'_>::new_display::<u32>(move _19) -> [return: bb4, unwind unreachable]; |
| 134 | 132 | } |
| 135 | 133 | |
| ... | ... | @@ -140,19 +138,18 @@ |
| 140 | 138 | StorageDead(_16); |
| 141 | 139 | StorageLive(_20); |
| 142 | 140 | StorageLive(_21); |
| 143 | _25 = const foo::<T>::promoted[0]; | |
| 144 | _21 = &(*_25); | |
| 141 | _21 = const b"\xc0\x01 \xc0\x01\n\x00"; | |
| 145 | 142 | _20 = &(*_21); |
| 143 | StorageLive(_22); | |
| 146 | 144 | 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]; | |
| 151 | 148 | } |
| 152 | 149 | |
| 153 | 150 | bb5: { |
| 154 | StorageDead(_24); | |
| 155 | 151 | StorageDead(_23); |
| 152 | StorageDead(_22); | |
| 156 | 153 | StorageDead(_21); |
| 157 | 154 | StorageDead(_20); |
| 158 | 155 | _10 = _eprint(move _11) -> [return: bb6, unwind unreachable]; |
| ... | ... | @@ -162,8 +159,8 @@ |
| 162 | 159 | StorageDead(_11); |
| 163 | 160 | StorageDead(_15); |
| 164 | 161 | - StorageDead(_12); |
| 165 | + StorageDead(_34); | |
| 166 | + StorageDead(_35); | |
| 162 | + StorageDead(_32); | |
| 163 | + StorageDead(_33); | |
| 167 | 164 | + nop; |
| 168 | 165 | StorageDead(_10); |
| 169 | 166 | _9 = const (); |
| ... | ... | @@ -184,16 +181,16 @@ |
| 184 | 181 | |
| 185 | 182 | bb9: { |
| 186 | 183 | 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]; | |
| 189 | 186 | } |
| 190 | 187 | |
| 191 | 188 | bb10: { |
| 192 | _28 = const false; | |
| 189 | _26 = const false; | |
| 193 | 190 | StorageDead(_5); |
| 194 | 191 | - StorageDead(_1); |
| 195 | + StorageDead(_32); | |
| 196 | + StorageDead(_33); | |
| 192 | + StorageDead(_30); | |
| 193 | + StorageDead(_31); | |
| 197 | 194 | + nop; |
| 198 | 195 | return; |
| 199 | 196 | } |
| ... | ... | @@ -203,3 +200,7 @@ |
| 203 | 200 | } |
| 204 | 201 | } |
| 205 | 202 | |
| 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() ({ |
| 32 | 32 | ((::alloc::__export::must_use as |
| 33 | 33 | fn(String) -> String {must_use::<String>})(({ |
| 34 | 34 | ((::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 | |
| 36 | 36 | 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) | |
| 40 | 39 | } as String)) as String); |
| 41 | 40 | } as ()) |
| 42 | 41 | type Foo = [i32; (3 as usize)]; |
tests/run-make/symbol-mangling-hashed/rmake.rs+2-2| ... | ... | @@ -61,7 +61,7 @@ fn main() { |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | 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 { | |
| 65 | 65 | eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols); |
| 66 | 66 | panic!("expected two dynamic symbols starting with `{expected_prefix}`"); |
| 67 | 67 | } |
| ... | ... | @@ -88,7 +88,7 @@ fn main() { |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | 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 { | |
| 92 | 92 | eprintln!("exported dynamic symbols: {:#?}", dynamic_symbols); |
| 93 | 93 | panic!("expected two exported symbols starting with `{expected_rlib_prefix}`"); |
| 94 | 94 | } |
tests/ui/consts/recursive-const-in-impl.stderr+1-1| ... | ... | @@ -5,7 +5,7 @@ LL | println!("{}", Thing::<i32>::X); |
| 5 | 5 | | ^^^^^^^^^^^^^^^ |
| 6 | 6 | | |
| 7 | 7 | = 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]` | |
| 9 | 9 | = 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) |
| 10 | 10 | |
| 11 | 11 | error: aborting due to 1 previous error |
tests/ui/unpretty/exhaustive.hir.stdout+2-2| ... | ... | @@ -390,11 +390,11 @@ mod expressions { |
| 390 | 390 | /// ExprKind::FormatArgs |
| 391 | 391 | fn expr_format_args() { |
| 392 | 392 | let expr; |
| 393 | format_arguments::new_const(&[]); | |
| 393 | format_arguments::from_str(""); | |
| 394 | 394 | { |
| 395 | 395 | super let args = (&expr,); |
| 396 | 396 | super let args = [format_argument::new_display(args.0)]; |
| 397 | format_arguments::new_v1(&[""], &args) | |
| 397 | unsafe { format_arguments::new(b"\xc0\x00", &args) } | |
| 398 | 398 | }; |
| 399 | 399 | } |
| 400 | 400 | } |
tests/ui/unpretty/flattened-format-args.stdout+4-1| ... | ... | @@ -13,7 +13,10 @@ fn main() { |
| 13 | 13 | ::std::io::_print({ |
| 14 | 14 | super let args = (&x,); |
| 15 | 15 | 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 | } | |
| 17 | 20 | }); |
| 18 | 21 | }; |
| 19 | 22 | } |