From 6ffc18f9b3ec2a122c0da4947ec0ed98630f397c Mon Sep 17 00:00:00 2001 From: Zack Maril Date: Wed, 7 Oct 2026 01:38:36 +0000 Subject: [PATCH 1/2] Look for new bugs with a wider fixture fixtures/wide adds a proc-macro crate, a build script, derives, const generics, a GAT, impl Trait and async fn in traits and an exported macro, with ten edits. rustc/hunt.sh builds a fixture repeatedly with -Zthreads=8 and checks P6 after each edit, with -Zincremental-verify-ich, single-threaded and threaded. docs/hunt.md has what it found in the unmodified compiler, each reduced and reproducible with the official nightly by docs/hunt/repro.sh: incremental rebuilds encode Generics::param_def_id_to_index in a different order from clean builds (docs/hunt/generics-index-map.patch fixes it); incremental rebuilds of a crate using a proc-macro derive encode hygiene data clean builds do not (not root-caused); and two RPITIT traits are not reproducible under -Zthreads (known, #162202). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018Mnrg9JXj9X1ht6Qkz2ybh --- README.md | 7 + docs/hunt.md | 119 ++++ docs/hunt/generics-index-map.patch | 20 + docs/hunt/p6-expansions/core-after.rs | 58 ++ docs/hunt/p6-expansions/core-before.rs | 56 ++ docs/hunt/p6-expansions/derive.rs | 36 + docs/hunt/p6-expansions/user-after.rs | 17 + docs/hunt/p6-expansions/user-before.rs | 16 + docs/hunt/p6-generics/lib.rs | 2 + docs/hunt/repro.sh | 40 ++ docs/hunt/threads-rpitit/lib.rs | 2 + fixtures/wide/Cargo.lock | 27 + fixtures/wide/Cargo.toml | 11 + fixtures/wide/core/Cargo.toml | 6 + fixtures/wide/core/build.rs | 13 + fixtures/wide/core/src/lib.rs | 120 ++++ fixtures/wide/derive/Cargo.toml | 8 + fixtures/wide/derive/src/lib.rs | 36 + fixtures/wide/edits/01-private-body | 4 + fixtures/wide/edits/02-new-variant | 6 + fixtures/wide/edits/03-doc-only | 4 + fixtures/wide/edits/04-spans-only | 4 + fixtures/wide/edits/05-reorder | 12 + fixtures/wide/edits/06-derive-output | 4 + fixtures/wide/edits/07-build-script | 4 + fixtures/wide/edits/08-const-generic | 4 + fixtures/wide/edits/09-macro-rules | 4 + fixtures/wide/edits/10-private-fn | 4 + fixtures/wide/src/main.rs | 35 + fixtures/wide/user/Cargo.toml | 9 + fixtures/wide/user/src/lib.rs | 58 ++ rustc/hunt.sh | 108 +++ tests/rmeta/wide.touch.txt | 503 +++++++++++++ tests/rmeta/wide.txt | 943 +++++++++++++++++++++++++ 34 files changed, 2300 insertions(+) create mode 100644 docs/hunt.md create mode 100644 docs/hunt/generics-index-map.patch create mode 100644 docs/hunt/p6-expansions/core-after.rs create mode 100644 docs/hunt/p6-expansions/core-before.rs create mode 100644 docs/hunt/p6-expansions/derive.rs create mode 100644 docs/hunt/p6-expansions/user-after.rs create mode 100644 docs/hunt/p6-expansions/user-before.rs create mode 100644 docs/hunt/p6-generics/lib.rs create mode 100755 docs/hunt/repro.sh create mode 100644 docs/hunt/threads-rpitit/lib.rs create mode 100644 fixtures/wide/Cargo.lock create mode 100644 fixtures/wide/Cargo.toml create mode 100644 fixtures/wide/core/Cargo.toml create mode 100644 fixtures/wide/core/build.rs create mode 100644 fixtures/wide/core/src/lib.rs create mode 100644 fixtures/wide/derive/Cargo.toml create mode 100644 fixtures/wide/derive/src/lib.rs create mode 100755 fixtures/wide/edits/01-private-body create mode 100755 fixtures/wide/edits/02-new-variant create mode 100755 fixtures/wide/edits/03-doc-only create mode 100755 fixtures/wide/edits/04-spans-only create mode 100755 fixtures/wide/edits/05-reorder create mode 100755 fixtures/wide/edits/06-derive-output create mode 100755 fixtures/wide/edits/07-build-script create mode 100755 fixtures/wide/edits/08-const-generic create mode 100755 fixtures/wide/edits/09-macro-rules create mode 100755 fixtures/wide/edits/10-private-fn create mode 100644 fixtures/wide/src/main.rs create mode 100644 fixtures/wide/user/Cargo.toml create mode 100644 fixtures/wide/user/src/lib.rs create mode 100755 rustc/hunt.sh create mode 100644 tests/rmeta/wide.touch.txt create mode 100644 tests/rmeta/wide.txt diff --git a/README.md b/README.md index 2c59247..1042db7 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,15 @@ Seven real bugs from rustc's history were then replayed by reverting their fixes. mirth catches five; three of those needed a fixture addition or a new step, made knowing the bug. +Pointed at the unmodified compiler with a wider fixture, it found two +incremental bugs that look new, where a rebuild after an edit encodes +different metadata from a clean build, and one known parallel-front-end +bug. + - [`docs/report.md`](docs/report.md): the experiment, for readers new to it - [`docs/results.md`](docs/results.md): each edit and the output that caught it - [`docs/regressions.md`](docs/regressions.md): the replayed bugs, caught and missed +- [`docs/hunt.md`](docs/hunt.md): bugs found in the unmodified compiler - [`docs/plan.md`](docs/plan.md): the plan the work followed, with the properties ## An instrumented compiler @@ -39,6 +45,7 @@ rustc/build.sh # build stage 1 through mirth-watch, then rustc/check.sh chain # check fixtures/chain rustc/edits.sh chain # apply, check and revert each edit in rustc/edits EDITS=regressions rustc/edits.sh chain # the same for the past bugs in rustc/regressions +rustc/hunt.sh wide # repeated threaded builds, and P6 for each of fixtures/wide/edits ``` The build takes about an hour on 16 cores. `rustc/rmeta.toml` says what is diff --git a/docs/hunt.md b/docs/hunt.md new file mode 100644 index 0000000..89f0b8d --- /dev/null +++ b/docs/hunt.md @@ -0,0 +1,119 @@ +# Looking for new bugs + +The edits and the replayed regressions test whether mirth catches bugs that +someone put in. This tests whether it finds bugs nobody knew were there: the +unmodified pinned compiler (`ea137335b`), a wider fixture, and more +incremental edits. + +`fixtures/wide` has a proc-macro crate (a derive and an attribute macro), a +library with a build script that generates code, built-in derives, const +generics, a generic associated type, `impl Trait` and `async fn` in traits, +and an exported `macro_rules!`, used by a second library and a binary. +`fixtures/wide/edits` has ten changes: a private body, a new enum variant, +a doc comment, spans only, two items swapped, the derive's output, the +build script's output, a const generic argument, a macro's expansion, and +a new private function. + +`rustc/hunt.sh ` builds the fixture eight times with +`-Zthreads=8` and compares the `.rmeta` files (P5). Then, for each edit, it +compares an incremental rebuild after the edit with a clean build of the +edited source (P6), with `-Zincremental-verify-ich`, single-threaded and +with `-Zthreads=8`. `rustc/check.sh wide` runs the ordinary checks. + +## Findings + +| | what | status | +|---|---|---| +| 1 | single-threaded incremental rebuilds encode `Generics::param_def_id_to_index` in a different order from clean builds | **looks new**; reduced to 2 lines; a one-line change fixes it | +| 2 | single-threaded incremental rebuilds of a crate using a proc-macro derive encode hygiene data that clean builds do not | **looks new**; reduced, not root-caused | +| 3 | with `-Zthreads=8`, two traits with `-> impl Trait` methods give different metadata from run to run | known: [#162202](https://github.com/rust-lang/rust/issues/162202) | + +All three reproduce with the official `nightly-2026-10-06`, without mirth: +`docs/hunt/repro.sh` runs them. None of them was searched for; P5 and P6 +reported them on the first run of the new fixture. + +Everything else held: P1, P2, P4 and P7 on the recorded clean build; the +touch-only rebuild reused every crate's metadata; and +`-Zincremental-verify-ich` found no unstable fingerprint in 20 incremental +rebuilds. + +### 1. `param_def_id_to_index` order after an incremental rebuild + +```rust +pub struct Grid(A, B, C); +impl Grid { pub const AREA: usize = 1; } +``` + +Build this with `-C incremental`, add a comment line at the top, build +again, and compare the `.rmeta` with a clean build of the same source: they +differ. Two clean builds agree, and so do an incremental rebuild with no +change and a clean build. + +Apart from the 16-byte hash in the header, only a few bytes differ, and they +are the same `(DefIndex, u32)` pairs in a different order: +`Generics::param_def_id_to_index`, an `FxHashMap` that +`TyEncodable` writes in iteration order. In the incremental session the +`generics_of` result is loaded from the incremental cache. The likely +mechanism, not verified: decoding builds the map by inserting in the +encoded order, and with colliding hashes that gives a different layout, +and so a different order, from the map rustc built in the first place. That fits +what the reduction showed: whether it reproduces depends on unrelated items +in the crate, which change the `DefId`s, and so the hashes. + +The same field is the cause given in +[#163878](https://github.com/rust-lang/rust/issues/163878), which reports +it under `-Zthreads`. This is the same field with no threads at all, in an +ordinary `cargo build` after an edit. It matters more than it might look: +since [#154724](https://github.com/rust-lang/rust/pull/154724) the crate +hash is computed from the metadata bytes, so an incremental build and a +clean build of the same source get different crate hashes, and every +dependent is rebuilt. + +`docs/hunt/generics-index-map.patch` changes the field to an `FxIndexMap`, +which keeps insertion order through encoding and decoding. With it, the +reduced case and nine of the ten edits give identical bytes. The +single-threaded edit that still fails is finding 2. + +### 2. Hygiene data after an incremental rebuild + +With finding 1 fixed, adding a variant to an enum in `wide_core` and the +matching arm in `wide_user` still gives `wide_user` different metadata from +a clean build. The incremental one is 16 bytes longer. +`docs/hunt/p6-expansions` has it reduced to two crates and the derive: +about 60 lines of the library and 17 of the dependent. + +What mirth's record shows, comparing the incremental process with the +clean one: the same tables are written, but only the incremental one, while +encoding, resolves foreign expansions (`expn_hash_to_expn_id`) and reads +foreign source files (`imported_source_file`, 150 times). So the +incremental session's metadata carries expansion and span data that the +clean session's does not. It needs the derive from the proc-macro crate: +without `#[derive(Named)]` it goes away. But so does removing the built-in +derives beside it, and, as with finding 1, removing unrelated items. + +Syntax contexts restored from the incremental cache are the place to look, +near [#161450](https://github.com/rust-lang/rust/pull/161450), which +changed how syntax contexts are encoded. This was not taken further. + +### 3. `impl Trait` in traits under `-Zthreads` + +```rust +pub trait Render { fn render(&self) -> impl Sized; } +pub trait Draw { fn draw(&self) -> impl Sized; } +``` + +Eight builds with `-Zthreads=8` give three or four different `.rmeta` files. +A comment on [#162202](https://github.com/rust-lang/rust/issues/162202) +reports return-position `impl Trait` in traits as not reproducible, so this +is known. The fix for finding 1 does not change it. Both fixtures have such +traits, so P5 under `-Zthreads=8` fails on `wide` every time, and on +`chain` occasionally (1 build in 24). + +## Not done + +- Neither new finding has been reported upstream. Before filing them, + check for duplicates again; #163878 especially is moving. +- Finding 2 is not root-caused. +- `fixtures/wide` fails `check.sh` (P5 under `-Zthreads=8`, finding 3) and + P6 for most edits (findings 1 and 2) until those are fixed. Its lists are + blessed against the unmodified compiler. diff --git a/docs/hunt/generics-index-map.patch b/docs/hunt/generics-index-map.patch new file mode 100644 index 0000000..b6fdf09 --- /dev/null +++ b/docs/hunt/generics-index-map.patch @@ -0,0 +1,20 @@ +--- a/compiler/rustc_middle/src/ty/generics.rs ++++ b/compiler/rustc_middle/src/ty/generics.rs +@@ -1,7 +1,7 @@ + use std::ops::ControlFlow; + + use rustc_ast as ast; +-use rustc_data_structures::fx::FxHashMap; ++use rustc_data_structures::fx::FxIndexMap; + use rustc_hir::def_id::DefId; + use rustc_macros::{StableHash, TyDecodable, TyEncodable}; + use rustc_span::{Span, Symbol, bug, kw}; +@@ -124,7 +124,7 @@ + + /// Reverse map to the `index` field of each `GenericParamDef`. + #[stable_hash(ignore)] +- pub param_def_id_to_index: FxHashMap, ++ pub param_def_id_to_index: FxIndexMap, + + pub has_self: bool, + pub has_late_bound_regions: Option, diff --git a/docs/hunt/p6-expansions/core-after.rs b/docs/hunt/p6-expansions/core-after.rs new file mode 100644 index 0000000..0f195ab --- /dev/null +++ b/docs/hunt/p6-expansions/core-after.rs @@ -0,0 +1,58 @@ +use std::fmt; +pub trait Named { + const NAME: &'static str; +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +pub struct Point { + pub x: i32, + pub y: i32, +} +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Shape { + Dot(Point), + Line { from: Point, to: Point }, + Poly(Vec), + Empty, +} +pub trait Windows { + type Window<'a> + where + Self: 'a; + fn window(&self, at: usize) -> Option>; +} +impl Windows for Vec { + type Window<'a> + = &'a [T] + where + T: 'a; + fn window(&self, at: usize) -> Option<&[T]> { + self.get(at..at + 2) + } +} +pub trait Render { + fn render(&self) -> impl fmt::Display + '_; +} +impl Render for Shape { + fn render(&self) -> impl fmt::Display + '_ { + match self { + Shape::Dot(p) => format!("dot {},{}", p.x, p.y), + Shape::Line { from, to } => format!("line {from:?} {to:?}"), + Shape::Poly(points) => format!("poly of {}", points.len()), + Shape::Empty => String::new(), + } + } +} +#[macro_export] +macro_rules! poly { + ($(($x:expr, $y:expr)),* $(,)?) => { + }; +} +pub fn spread(points: I) -> i32 +where + I: IntoIterator, +{ + let (min, max) = points + .into_iter() + .fold((i32::MAX, i32::MIN), |(lo, hi), p| (lo.min(p.x), hi.max(p.x))); + max - min +} diff --git a/docs/hunt/p6-expansions/core-before.rs b/docs/hunt/p6-expansions/core-before.rs new file mode 100644 index 0000000..78c8af2 --- /dev/null +++ b/docs/hunt/p6-expansions/core-before.rs @@ -0,0 +1,56 @@ +use std::fmt; +pub trait Named { + const NAME: &'static str; +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +pub struct Point { + pub x: i32, + pub y: i32, +} +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Shape { + Dot(Point), + Line { from: Point, to: Point }, + Poly(Vec), +} +pub trait Windows { + type Window<'a> + where + Self: 'a; + fn window(&self, at: usize) -> Option>; +} +impl Windows for Vec { + type Window<'a> + = &'a [T] + where + T: 'a; + fn window(&self, at: usize) -> Option<&[T]> { + self.get(at..at + 2) + } +} +pub trait Render { + fn render(&self) -> impl fmt::Display + '_; +} +impl Render for Shape { + fn render(&self) -> impl fmt::Display + '_ { + match self { + Shape::Dot(p) => format!("dot {},{}", p.x, p.y), + Shape::Line { from, to } => format!("line {from:?} {to:?}"), + Shape::Poly(points) => format!("poly of {}", points.len()), + } + } +} +#[macro_export] +macro_rules! poly { + ($(($x:expr, $y:expr)),* $(,)?) => { + }; +} +pub fn spread(points: I) -> i32 +where + I: IntoIterator, +{ + let (min, max) = points + .into_iter() + .fold((i32::MAX, i32::MIN), |(lo, hi), p| (lo.min(p.x), hi.max(p.x))); + max - min +} diff --git a/docs/hunt/p6-expansions/derive.rs b/docs/hunt/p6-expansions/derive.rs new file mode 100644 index 0000000..8e645c5 --- /dev/null +++ b/docs/hunt/p6-expansions/derive.rs @@ -0,0 +1,36 @@ +//! A derive with no dependencies: `#[derive(Named)]` gives a type a `NAME` +//! constant and a `name` method, through a trait in `wide-core`. + +use proc_macro::{TokenStream, TokenTree}; + +#[proc_macro_derive(Named, attributes(named))] +pub fn derive_named(input: TokenStream) -> TokenStream { + let mut tokens = input.into_iter(); + let mut name = None; + while let Some(token) = tokens.next() { + if let TokenTree::Ident(ident) = &token { + let word = ident.to_string(); + if word == "struct" || word == "enum" { + name = tokens.next().map(|token| token.to_string()); + break; + } + } + } + let name = name.expect("a struct or an enum"); + format!( + "impl ::wide_core::Named for {name} {{ const NAME: &'static str = \"{name}\"; }}" + ) + .parse() + .unwrap() +} + +/// An attribute macro that wraps a function's body in a call counter. +#[proc_macro_attribute] +pub fn counted(_attr: TokenStream, item: TokenStream) -> TokenStream { + let text = item.to_string(); + let brace = text.find('{').expect("a function body"); + let (head, body) = text.split_at(brace); + format!("{head} {{ ::wide_core::COUNT.fetch_add(1, ::std::sync::atomic::Ordering::Relaxed); {body} }}") + .parse() + .unwrap() +} diff --git a/docs/hunt/p6-expansions/user-after.rs b/docs/hunt/p6-expansions/user-after.rs new file mode 100644 index 0000000..a3e9771 --- /dev/null +++ b/docs/hunt/p6-expansions/user-after.rs @@ -0,0 +1,17 @@ +pub use wide_core::{Point, Shape, poly}; +use wide_derive::{Named, counted}; +#[derive(Named, Debug, Clone, PartialEq)] +pub struct Drawing { + pub shapes: Vec, +} +pub fn each_point(drawing: &Drawing, mut f: impl FnMut(Point)) { + for shape in &drawing.shapes { + match shape { + Shape::Dot(p) => f(*p), + Shape::Line { from, to } => { + } + Shape::Poly(points) => points.iter().copied().for_each(&mut f), + Shape::Empty => {} + } + } +} diff --git a/docs/hunt/p6-expansions/user-before.rs b/docs/hunt/p6-expansions/user-before.rs new file mode 100644 index 0000000..44c9d40 --- /dev/null +++ b/docs/hunt/p6-expansions/user-before.rs @@ -0,0 +1,16 @@ +pub use wide_core::{Point, Shape, poly}; +use wide_derive::{Named, counted}; +#[derive(Named, Debug, Clone, PartialEq)] +pub struct Drawing { + pub shapes: Vec, +} +pub fn each_point(drawing: &Drawing, mut f: impl FnMut(Point)) { + for shape in &drawing.shapes { + match shape { + Shape::Dot(p) => f(*p), + Shape::Line { from, to } => { + } + Shape::Poly(points) => points.iter().copied().for_each(&mut f), + } + } +} diff --git a/docs/hunt/p6-generics/lib.rs b/docs/hunt/p6-generics/lib.rs new file mode 100644 index 0000000..ff79849 --- /dev/null +++ b/docs/hunt/p6-generics/lib.rs @@ -0,0 +1,2 @@ +pub struct Grid(A, B, C); +impl Grid { pub const AREA: usize = 1; } diff --git a/docs/hunt/repro.sh b/docs/hunt/repro.sh new file mode 100755 index 0000000..a2375fc --- /dev/null +++ b/docs/hunt/repro.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# The three reproductions in hunt.md, with plain rustc (RUSTC, or the pinned +# nightly). Each prints "same" or "DIFFER". +set -u +here=$(cd "$(dirname "$0")" && pwd) +rustc=${RUSTC:-$(rustc +nightly-2026-10-06 --print sysroot)/bin/rustc} +d=$(mktemp -d) +trap 'rm -rf "$d"' EXIT +rc() { "$rustc" --edition 2024 "$@" 2> "$d/err" || { cat "$d/err"; exit 1; }; } + +echo -n "threads-rpitit, 8 builds with -Zthreads=8, distinct .rmeta files: " +for i in 1 2 3 4 5 6 7 8; do + rc --crate-type lib --emit=metadata -Zthreads=8 "$here/threads-rpitit/lib.rs" -o "$d/t$i.rmeta" +done +sha256sum "$d"/t*.rmeta | cut -d' ' -f1 | sort -u | wc -l + +echo -n "p6-generics, incremental rebuild after a comment vs a clean build: " +cp "$here/p6-generics/lib.rs" "$d/lib.rs" +rc --crate-type lib --emit=metadata -Cincremental="$d/i1" "$d/lib.rs" -o "$d/inc.rmeta" +{ echo "// a comment"; cat "$here/p6-generics/lib.rs"; } > "$d/lib.rs" +rc --crate-type lib --emit=metadata -Cincremental="$d/i1" "$d/lib.rs" -o "$d/inc.rmeta" +rc --crate-type lib --emit=metadata -Cincremental="$d/i2" "$d/lib.rs" -o "$d/clean.rmeta" +cmp -s "$d/inc.rmeta" "$d/clean.rmeta" && echo same || echo DIFFER + +echo -n "p6-expansions, incremental rebuild of user after a new variant vs a clean build: " +x=$here/p6-expansions +mkdir -p "$d/pm" "$d/c1" "$d/c2" "$d/o1" "$d/o2" +rc --crate-type proc-macro --extern proc_macro --crate-name wide_derive "$x/derive.rs" --out-dir "$d/pm" +rc --crate-type lib --crate-name wide_core "$x/core-before.rs" --out-dir "$d/c1" +rc --crate-type lib --crate-name wide_core "$x/core-after.rs" --out-dir "$d/c2" +user() { + cp "$1" "$d/user.rs" + rc --crate-type lib --crate-name wide_user "$d/user.rs" --emit=dep-info,metadata,link \ + --extern wide_core="$2/libwide_core.rlib" --extern wide_derive="$d/pm/libwide_derive.so" \ + -Cincremental="$3" --out-dir "$4" +} +user "$x/user-before.rs" "$d/c1" "$d/i3" "$d/o1" +user "$x/user-after.rs" "$d/c2" "$d/i3" "$d/o1" +user "$x/user-after.rs" "$d/c2" "$d/i4" "$d/o2" +cmp -s "$d/o1/libwide_user.rmeta" "$d/o2/libwide_user.rmeta" && echo same || echo DIFFER diff --git a/docs/hunt/threads-rpitit/lib.rs b/docs/hunt/threads-rpitit/lib.rs new file mode 100644 index 0000000..2d3c533 --- /dev/null +++ b/docs/hunt/threads-rpitit/lib.rs @@ -0,0 +1,2 @@ +pub trait Render { fn render(&self) -> impl Sized; } +pub trait Draw { fn draw(&self) -> impl Sized; } diff --git a/fixtures/wide/Cargo.lock b/fixtures/wide/Cargo.lock new file mode 100644 index 0000000..8457964 --- /dev/null +++ b/fixtures/wide/Cargo.lock @@ -0,0 +1,27 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "wide" +version = "0.0.0" +dependencies = [ + "wide-core", + "wide-user", +] + +[[package]] +name = "wide-core" +version = "0.0.0" + +[[package]] +name = "wide-derive" +version = "0.0.0" + +[[package]] +name = "wide-user" +version = "0.0.0" +dependencies = [ + "wide-core", + "wide-derive", +] diff --git a/fixtures/wide/Cargo.toml b/fixtures/wide/Cargo.toml new file mode 100644 index 0000000..516ace7 --- /dev/null +++ b/fixtures/wide/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] + +[package] +name = "wide" +version = "0.0.0" +edition = "2024" +publish = false + +[dependencies] +core-lib = { path = "core", package = "wide-core" } +user = { path = "user", package = "wide-user" } diff --git a/fixtures/wide/core/Cargo.toml b/fixtures/wide/core/Cargo.toml new file mode 100644 index 0000000..d3d7b20 --- /dev/null +++ b/fixtures/wide/core/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "wide-core" +version = "0.0.0" +edition = "2024" +publish = false +build = "build.rs" diff --git a/fixtures/wide/core/build.rs b/fixtures/wide/core/build.rs new file mode 100644 index 0000000..8555a06 --- /dev/null +++ b/fixtures/wide/core/build.rs @@ -0,0 +1,13 @@ +// Generates a table into OUT_DIR, included by lib.rs. +use std::fmt::Write; + +fn main() { + let mut table = String::from("pub const SQUARES: [u32; 16] = ["); + for i in 0..16u32 { + write!(table, "{}, ", i * i).unwrap(); + } + table.push_str("];\n"); + let out = std::env::var("OUT_DIR").unwrap(); + std::fs::write(format!("{out}/table.rs"), table).unwrap(); + println!("cargo::rerun-if-changed=build.rs"); +} diff --git a/fixtures/wide/core/src/lib.rs b/fixtures/wide/core/src/lib.rs new file mode 100644 index 0000000..c110e5a --- /dev/null +++ b/fixtures/wide/core/src/lib.rs @@ -0,0 +1,120 @@ +//! The bottom crate: derives, generics of every kind, an exported macro, +//! a generated table, statics, and traits for dependents to implement. + +use std::collections::BTreeMap; +use std::fmt; +use std::sync::atomic::AtomicUsize; + +include!(concat!(env!("OUT_DIR"), "/table.rs")); + +pub static COUNT: AtomicUsize = AtomicUsize::new(0); + +pub trait Named { + const NAME: &'static str; + + fn name(&self) -> &'static str { + Self::NAME + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +pub struct Point { + pub x: i32, + pub y: i32, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Shape { + Dot(Point), + Line { from: Point, to: Point }, + Poly(Vec), +} + +#[derive(Debug, Clone)] +pub struct Grid { + pub cells: [[T; W]; H], +} + +impl Grid { + pub fn filled(value: T) -> Self { + Grid { cells: [[value; W]; H] } + } + + pub const AREA: usize = W * H; +} + +/// A lending iterator: a generic associated type. +pub trait Windows { + type Window<'a> + where + Self: 'a; + + fn window(&self, at: usize) -> Option>; +} + +impl Windows for Vec { + type Window<'a> + = &'a [T] + where + T: 'a; + + fn window(&self, at: usize) -> Option<&[T]> { + self.get(at..at + 2) + } +} + +pub trait Render { + fn render(&self) -> impl fmt::Display + '_; + + fn boxed(&self) -> Box { + Box::new(self.render()) + } +} + +impl Render for Shape { + fn render(&self) -> impl fmt::Display + '_ { + match self { + Shape::Dot(p) => format!("dot {},{}", p.x, p.y), + Shape::Line { from, to } => format!("line {from:?} {to:?}"), + Shape::Poly(points) => format!("poly of {}", points.len()), + } + } +} + +#[allow(async_fn_in_trait)] +pub trait Store { + async fn load(&self, key: &str) -> Option; +} + +pub struct Memory(pub BTreeMap); + +impl Store for Memory { + async fn load(&self, key: &str) -> Option { + self.0.get(key).copied() + } +} + +/// Builds a `Shape::Poly` from a list of pairs. +#[macro_export] +macro_rules! poly { + ($(($x:expr, $y:expr)),* $(,)?) => { + $crate::Shape::Poly(vec![$($crate::Point { x: $x, y: $y }),*]) + }; +} + +pub fn spread(points: I) -> i32 +where + I: IntoIterator, +{ + let (min, max) = points + .into_iter() + .fold((i32::MAX, i32::MIN), |(lo, hi), p| (lo.min(p.x), hi.max(p.x))); + max - min +} + +#[inline] +pub fn square(i: usize) -> u32 { + SQUARES[i % SQUARES.len()] +} + +pub const ORIGIN: Point = Point { x: 0, y: 0 }; diff --git a/fixtures/wide/derive/Cargo.toml b/fixtures/wide/derive/Cargo.toml new file mode 100644 index 0000000..87c1995 --- /dev/null +++ b/fixtures/wide/derive/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "wide-derive" +version = "0.0.0" +edition = "2024" +publish = false + +[lib] +proc-macro = true diff --git a/fixtures/wide/derive/src/lib.rs b/fixtures/wide/derive/src/lib.rs new file mode 100644 index 0000000..8e645c5 --- /dev/null +++ b/fixtures/wide/derive/src/lib.rs @@ -0,0 +1,36 @@ +//! A derive with no dependencies: `#[derive(Named)]` gives a type a `NAME` +//! constant and a `name` method, through a trait in `wide-core`. + +use proc_macro::{TokenStream, TokenTree}; + +#[proc_macro_derive(Named, attributes(named))] +pub fn derive_named(input: TokenStream) -> TokenStream { + let mut tokens = input.into_iter(); + let mut name = None; + while let Some(token) = tokens.next() { + if let TokenTree::Ident(ident) = &token { + let word = ident.to_string(); + if word == "struct" || word == "enum" { + name = tokens.next().map(|token| token.to_string()); + break; + } + } + } + let name = name.expect("a struct or an enum"); + format!( + "impl ::wide_core::Named for {name} {{ const NAME: &'static str = \"{name}\"; }}" + ) + .parse() + .unwrap() +} + +/// An attribute macro that wraps a function's body in a call counter. +#[proc_macro_attribute] +pub fn counted(_attr: TokenStream, item: TokenStream) -> TokenStream { + let text = item.to_string(); + let brace = text.find('{').expect("a function body"); + let (head, body) = text.split_at(brace); + format!("{head} {{ ::wide_core::COUNT.fetch_add(1, ::std::sync::atomic::Ordering::Relaxed); {body} }}") + .parse() + .unwrap() +} diff --git a/fixtures/wide/edits/01-private-body b/fixtures/wide/edits/01-private-body new file mode 100755 index 0000000..a52f0bd --- /dev/null +++ b/fixtures/wide/edits/01-private-body @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# A body change that changes no interface. +set -euo pipefail +sed -i 's/(lo.min(p.x), hi.max(p.x))/(lo.min(p.x), hi.max(p.x).max(lo))/' core/src/lib.rs diff --git a/fixtures/wide/edits/02-new-variant b/fixtures/wide/edits/02-new-variant new file mode 100755 index 0000000..4b687e4 --- /dev/null +++ b/fixtures/wide/edits/02-new-variant @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# A new enum variant, so every match downstream changes. +set -euo pipefail +sed -i 's/ Poly(Vec),/ Poly(Vec),\n Empty,/' core/src/lib.rs +sed -i 's| Shape::Poly(points) => format!("poly of {}", points.len()),| Shape::Poly(points) => format!("poly of {}", points.len()),\n Shape::Empty => String::new(),|' core/src/lib.rs +sed -i 's| Shape::Poly(points) => points.iter().copied().for_each(\&mut f),| Shape::Poly(points) => points.iter().copied().for_each(\&mut f),\n Shape::Empty => {}|' user/src/lib.rs diff --git a/fixtures/wide/edits/03-doc-only b/fixtures/wide/edits/03-doc-only new file mode 100755 index 0000000..dbf1386 --- /dev/null +++ b/fixtures/wide/edits/03-doc-only @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Only a doc comment changes. +set -euo pipefail +sed -i 's|/// Builds a `Shape::Poly` from a list of pairs.|/// Builds a `Shape::Poly` from a list of (x, y) pairs.|' core/src/lib.rs diff --git a/fixtures/wide/edits/04-spans-only b/fixtures/wide/edits/04-spans-only new file mode 100755 index 0000000..a6d6c77 --- /dev/null +++ b/fixtures/wide/edits/04-spans-only @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Every span in core moves down two lines; nothing else changes. +set -euo pipefail +sed -i '1i // moved\n//' core/src/lib.rs diff --git a/fixtures/wide/edits/05-reorder b/fixtures/wide/edits/05-reorder new file mode 100755 index 0000000..1e2d94a --- /dev/null +++ b/fixtures/wide/edits/05-reorder @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Two items swap places. +set -euo pipefail +python3 - <<'PY' +import pathlib +p = pathlib.Path('core/src/lib.rs'); s = p.read_text() +a = '#[inline]\npub fn square(i: usize) -> u32 {\n SQUARES[i % SQUARES.len()]\n}\n' +b = 'pub const ORIGIN: Point = Point { x: 0, y: 0 };\n' +assert a in s and b in s +s = s.replace(a, '@A@').replace(b, a).replace('@A@', b) +p.write_text(s) +PY diff --git a/fixtures/wide/edits/06-derive-output b/fixtures/wide/edits/06-derive-output new file mode 100755 index 0000000..755fd27 --- /dev/null +++ b/fixtures/wide/edits/06-derive-output @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# The derive's output changes, so every user of it does. +set -euo pipefail +sed -i 's|const NAME: \&'"'"'static str = \\"{name}\\";|const NAME: \&'"'"'static str = \\"{name}!\\";|' derive/src/lib.rs diff --git a/fixtures/wide/edits/07-build-script b/fixtures/wide/edits/07-build-script new file mode 100755 index 0000000..049e21c --- /dev/null +++ b/fixtures/wide/edits/07-build-script @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# The build script generates a different table. +set -euo pipefail +sed -i 's/i \* i/i * i * i/' core/build.rs diff --git a/fixtures/wide/edits/08-const-generic b/fixtures/wide/edits/08-const-generic new file mode 100755 index 0000000..22e068b --- /dev/null +++ b/fixtures/wide/edits/08-const-generic @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# A const generic argument changes in a type alias. +set -euo pipefail +sed -i 's/Grid/Grid/' user/src/lib.rs diff --git a/fixtures/wide/edits/09-macro-rules b/fixtures/wide/edits/09-macro-rules new file mode 100755 index 0000000..31c8f48 --- /dev/null +++ b/fixtures/wide/edits/09-macro-rules @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# An exported macro's expansion changes. +set -euo pipefail +sed -i 's|\$crate::Point { x: \$x, y: \$y }|\$crate::Point { x: \$y, y: \$x }|' core/src/lib.rs diff --git a/fixtures/wide/edits/10-private-fn b/fixtures/wide/edits/10-private-fn new file mode 100755 index 0000000..669f8a0 --- /dev/null +++ b/fixtures/wide/edits/10-private-fn @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# A new private function in the middle crate. +set -euo pipefail +echo 'fn unused_helper() -> u32 { 4 }' >> user/src/lib.rs diff --git a/fixtures/wide/src/main.rs b/fixtures/wide/src/main.rs new file mode 100644 index 0000000..09e995e --- /dev/null +++ b/fixtures/wide/src/main.rs @@ -0,0 +1,35 @@ +use std::collections::BTreeMap; +use std::future::Future; +use std::pin::pin; +use std::task::{Context, Poll, Waker}; + +use core_lib::{Named, Store}; +use user::{Drawing, Layer}; + +fn block_on(future: F) -> F::Output { + let mut future = pin!(future); + let mut context = Context::from_waker(Waker::noop()); + loop { + if let Poll::Ready(output) = future.as_mut().poll(&mut context) { + return output; + } + } +} + +fn main() { + let drawing = Drawing::sample(); + let mut points = Vec::new(); + user::each_point(&drawing, |p| points.push(p)); + let memory = core_lib::Memory(BTreeMap::from([("a".to_string(), 7)])); + println!( + "{:?} {} {} {} {} {} {:?} {}", + drawing.describe(), + drawing.pairs(), + Drawing::NAME, + core_lib::spread(points), + user::Canvas::AREA, + user::canvas().cells[0][0], + user::layers().map(|(l, _)| l).max().unwrap_or(Layer::Back), + block_on(memory.load("a")).unwrap_or(0), + ); +} diff --git a/fixtures/wide/user/Cargo.toml b/fixtures/wide/user/Cargo.toml new file mode 100644 index 0000000..2b993db --- /dev/null +++ b/fixtures/wide/user/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "wide-user" +version = "0.0.0" +edition = "2024" +publish = false + +[dependencies] +wide-core = { path = "../core" } +wide-derive = { path = "../derive" } diff --git a/fixtures/wide/user/src/lib.rs b/fixtures/wide/user/src/lib.rs new file mode 100644 index 0000000..0e3f863 --- /dev/null +++ b/fixtures/wide/user/src/lib.rs @@ -0,0 +1,58 @@ +//! The middle crate: uses the derive, the attribute macro and the exported +//! macro, implements `wide-core`'s traits, and re-exports some of it. + +pub use wide_core::{Point, Shape, poly}; +use wide_core::{Named, Render, Windows}; +use wide_derive::{Named, counted}; + +#[derive(Named, Debug, Clone, PartialEq)] +pub struct Drawing { + pub shapes: Vec, +} + +#[derive(Named, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] +pub enum Layer { + Back, + Middle, + Front, +} + +impl Drawing { + #[counted] + pub fn sample() -> Drawing { + Drawing { shapes: vec![poly![(1, 2), (3, 4), (5, 6)], Shape::Dot(wide_core::ORIGIN)] } + } + + pub fn describe(&self) -> Vec { + self.shapes.iter().map(|shape| shape.render().to_string()).collect() + } + + pub fn pairs(&self) -> usize { + let names: Vec<&str> = self.shapes.iter().map(|_| self.name()).collect(); + (0..names.len()).filter_map(|i| names.window(i)).count() + } +} + +pub type Canvas = wide_core::Grid; + +pub fn canvas() -> Canvas { + Canvas::filled(wide_core::square(3) as u8) +} + +pub fn layers() -> impl Iterator { + [Layer::Back, Layer::Middle, Layer::Front].into_iter().map(|l| (l, Layer::NAME)) +} + +/// Calls back into a closure the caller provides; generic over it. +pub fn each_point(drawing: &Drawing, mut f: impl FnMut(Point)) { + for shape in &drawing.shapes { + match shape { + Shape::Dot(p) => f(*p), + Shape::Line { from, to } => { + f(*from); + f(*to) + } + Shape::Poly(points) => points.iter().copied().for_each(&mut f), + } + } +} diff --git a/rustc/hunt.sh b/rustc/hunt.sh new file mode 100755 index 0000000..39d0e0c --- /dev/null +++ b/rustc/hunt.sh @@ -0,0 +1,108 @@ +#!/usr/bin/env bash +# Look for bugs in the unmodified compiler with a fixture, beyond check.sh: +# +# threads REPEAT clean builds with -Zthreads=8 give the same .rmeta bytes +# edits for each script in fixtures//edits, an incremental +# rebuild after it gives the same .rmeta bytes as a clean build, +# with -Zincremental-verify-ich, single-threaded and with +# -Zthreads=8; and the rebuild's record says which crates +# encoded their metadata again +# +# rustc/hunt.sh +# +# REPEAT sets the number of threaded builds (8); HUNT_EDITS=0 skips the edits. +# +# Nothing here is blessed: every finding is printed, and the exit status is +# 1 if there was one. +set -uo pipefail +here=$(cd "$(dirname "$0")" && pwd) +repo=$(cd "$here/.." && pwd) +. "$here/pins.env" +: "${MIRTH_RUST:?set MIRTH_RUST to the checkout build.sh built}" +fixture=${1:?a fixture name} +repeat=${REPEAT:-8} +work=${MIRTH_WORK:-$MIRTH_RUST/build/mirth-work}/hunt-$fixture +host=$(rustc +"$TOOLCHAIN" -vV | sed -n 's/^host: //p') +rustc=$MIRTH_RUST/build/$host/stage1/bin/rustc +sites=$MIRTH_RUST/build/mirth-sites +cargo +"$TOOLCHAIN" build -q --release --manifest-path "$repo/Cargo.toml" -p mirth-cli +mirth=$repo/target/release/mirth +found=0 + +# As in check.sh: every build is incremental and happens in $work/run. +fresh() { + rm -rf "$work/run" + mkdir -p "$work/run" + cp -R "$repo/fixtures/$fixture" "$work/run/src" + rm -rf "$work/run/src/edit" "$work/run/src/edits" +} + +build() { + CARGO_INCREMENTAL=1 RUSTFLAGS="$flags" "$mirth" record --rustc "$rustc" --out "$work/$1.record" -- \ + cargo +"$TOOLCHAIN" build -q --manifest-path "$work/run/src/Cargo.toml" --target-dir "$work/run/target" \ + > "$work/$1.log" 2>&1 || { echo "the build failed:"; tail -30 "$work/$1.log"; return 1; } +} + +keep() { + rm -rf "$work/$1" + mv "$work/run" "$work/$1" +} + +rmetas() { + (cd "$work/$1/target" && find . -path ./debug/incremental -prune -o -name '*.rmeta' -type f \ + -not -path '*/rmeta??????/*' -print | sort | xargs sha256sum) +} + +roots=(--root "$work/run/target=target" --root "$work/run/src=." + --root "$MIRTH_RUST/build/$host/stage1=") + +# The crates whose rebuild encoded their metadata again, rather than reusing +# the incremental cache's copy. +encoded() { + "$mirth" report --sites "$sites" --out "$work/$1.record" "${roots[@]}" 2> /dev/null | + awk '/^== / {crate = $2} /encode-to .*full\.rmeta/ {print crate}' | sort -u | tr '\n' ' ' +} + +rm -rf "$work" +mkdir -p "$work" + +echo "== $repeat clean builds with -Zthreads=8" +flags=-Zthreads=8 +for i in $(seq 1 "$repeat"); do + fresh + build "t$i" || exit 1 + keep "t$i" + if [ "$i" -gt 1 ] && ! diff <(rmetas t1) <(rmetas "t$i") > "$work/t$i.diff"; then + echo "build $i differs from build 1:" + cat "$work/t$i.diff" + found=1 + fi +done +[ $found = 0 ] && echo "all $repeat identical: $(rmetas t1 | wc -l) .rmeta files" + +[ "${HUNT_EDITS:-1}" = 0 ] && exit $found +for edit in "$repo/fixtures/$fixture/edits"/*; do + [ -x "$edit" ] || continue + name=$(basename "$edit") + for flags in "-Zincremental-verify-ich" "-Zincremental-verify-ich -Zthreads=8"; do + echo "== $name ($flags)" + fresh + build before || { found=1; continue; } + (cd "$work/run/src" && "$edit") + build inc || { found=1; continue; } + echo "encoded again: $(encoded inc)" + keep inc + fresh + (cd "$work/run/src" && "$edit") + build clean || { found=1; continue; } + keep clean + if diff <(rmetas inc) <(rmetas clean) > "$work/$name.diff"; then + echo "P6 holds" + else + echo "P6 broken: the incremental rebuild's .rmeta files differ from a clean build's" + cat "$work/$name.diff" + found=1 + fi + done +done +exit $found diff --git a/tests/rmeta/wide.touch.txt b/tests/rmeta/wide.touch.txt new file mode 100644 index 0000000..c1f06e2 --- /dev/null +++ b/tests/rmeta/wide.touch.txt @@ -0,0 +1,503 @@ +== build_script_build (bin) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-core/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + remove_dir_all target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rustc* in - + remove_dir_all target/debug/build/wide-core/#/out/rustc* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 14 5 items 5 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 154 77 items 77 tracked codegen_fn_attrs + 58 58 items 58 tracked cross_crate_inlinable + 168 168 items 168 tracked def_kind + 1 1 items 1 tracked defaultness + 19 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 6 2 items 2 tracked explicit_clauses_of + 5 2 items 2 tracked explicit_implied_clauses_of + 1 1 items 1 tracked exportable_items + 21 19 items 19 tracked exported_generic_symbols + 19 19 items 19 tracked exported_non_generic_symbols + 40 19 items 19 tracked generics_of + 40 20 items 20 tracked impl_trait_header + 1 1 items 1 tracked implementations_of_trait + 2 2 items 2 tracked inferred_outlives_of + 1 1 items 1 tracked intrinsic_raw + 19 19 items 19 tracked missing_lang_items + 3913 45 items 45 tracked module_children + 23 19 items 19 tracked native_libraries + 2 1 items 1 tracked trait_def + 56 28 items 28 tracked type_of + 140 70 items 70 tracked visibility +read outside a query + 96 CrateMetadata::def_kind in - + 8601 CrateMetadata::def_path_hash in - + 30 CrateMetadata::expn_hash_to_expn_id in - + 140 CrateMetadata::get_expn_that_defined in - + 10 CrateMetadata::get_item_attrs in - + 15 CrateMetadata::get_macro in - + 2038 CrateMetadata::get_span in - + 10 CrateMetadata::opt_item_ident in - + 19 CrateRoot>::decode_denied_partial_mitigations in - + 19 CrateRoot>::decode_target_modifiers in - + 15 MetadataBlob::check_compatibility in - + 24 MetadataBlob::get_header in - + 3 MetadataBlob::get_root in - + 40 decode_expn_id::{closure#0} in - + 4 decode_syntax_context::{closure#0} in - + 336 def_key::{closure#0} in - + 10 expn_hash_to_expn_id::{closure#0} in - + 45 get_ambig_module_children::{closure#0} in - + 1470 imported_source_file::{closure#2} in - + 76 CrateMetadata::new in CStore::register_crate + 19 CrateRoot>::decode_crate_deps in CStore::register_crate + 36 MetadataBlob::check_compatibility in CStore::register_crate + 72 MetadataBlob::get_header in CStore::register_crate + 37 MetadataBlob::get_root in CStore::register_crate + 38 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + +== wide (bin) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in - + create target/debug/build/wide/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + remove_dir_all target/debug/build/wide/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide/#/out/rustc* in - + remove_dir_all target/debug/build/wide/#/out/rustc* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 6 2 items 2 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 464 232 items 232 tracked codegen_fn_attrs + 213 213 items 213 tracked cross_crate_inlinable + 19 19 items 19 tracked debugger_visualizers + 471 471 items 471 tracked def_kind + 1 1 items 1 tracked defaultness + 19 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 6 2 items 2 tracked explicit_clauses_of + 5 2 items 2 tracked explicit_implied_clauses_of + 1 1 items 1 tracked exportable_items + 21 19 items 19 tracked exported_generic_symbols + 19 19 items 19 tracked exported_non_generic_symbols + 50 24 items 24 tracked generics_of + 116 58 items 58 tracked impl_trait_header + 1 1 items 1 tracked implementations_of_trait + 2 2 items 2 tracked inferred_outlives_of + 1 1 items 1 tracked intrinsic_raw + 19 19 items 19 tracked missing_lang_items + 3431 44 items 44 tracked module_children + 23 19 items 19 tracked native_libraries + 2 1 items 1 tracked trait_def + 176 88 items 88 tracked type_of + 138 69 items 69 tracked visibility + 5 2 items 2 tracked core_lib attrs_for_def + 1 1 items 1 tracked core_lib canonical_symbols + 6 3 items 3 tracked core_lib codegen_fn_attrs + 3 3 items 3 tracked core_lib cross_crate_inlinable + 1 1 items 1 tracked core_lib debugger_visualizers + 6 6 items 6 tracked core_lib def_kind + 1 1 items 1 tracked core_lib defined_lang_items + 1 1 items 1 tracked core_lib diagnostic_items + 1 1 items 1 tracked core_lib exported_generic_symbols + 1 1 items 1 tracked core_lib exported_non_generic_symbols + 1 1 items 1 tracked core_lib missing_lang_items + 137 3 items 3 tracked core_lib module_children + 1 1 items 1 tracked core_lib native_libraries + 6 3 items 3 tracked core_lib visibility + 6 3 items 3 tracked user attrs_for_def + 1 1 items 1 tracked user canonical_symbols + 10 5 items 5 tracked user codegen_fn_attrs + 5 5 items 5 tracked user cross_crate_inlinable + 1 1 items 1 tracked user debugger_visualizers + 10 10 items 10 tracked user def_kind + 1 1 items 1 tracked user defined_lang_items + 1 1 items 1 tracked user diagnostic_items + 1 1 items 1 tracked user exported_generic_symbols + 1 1 items 1 tracked user exported_non_generic_symbols + 4 2 items 2 tracked user generics_of + 6 3 items 3 tracked user impl_trait_header + 1 1 items 1 tracked user missing_lang_items + 97 2 items 2 tracked user module_children + 1 1 items 1 tracked user native_libraries + 6 3 items 3 tracked user type_of + 4 2 items 2 tracked user visibility + 1 1 items 1 tracked wide_derive canonical_symbols + 1 1 items 1 tracked wide_derive defined_lang_items + 1 1 items 1 tracked wide_derive diagnostic_items + 1 1 items 1 tracked wide_derive missing_lang_items + 1 1 items 1 tracked wide_derive native_libraries +read outside a query + 89 CrateMetadata::def_kind in - + 12181 CrateMetadata::def_path_hash in - + 108 CrateMetadata::expn_hash_to_expn_id in - + 148 CrateMetadata::get_expn_that_defined in - + 6 CrateMetadata::get_item_attrs in - + 9 CrateMetadata::get_macro in - + 1970 CrateMetadata::get_span in - + 6 CrateMetadata::opt_item_ident in - + 21 CrateRoot>::decode_denied_partial_mitigations in - + 21 CrateRoot>::decode_target_modifiers in - + 23 MetadataBlob::check_compatibility in - + 40 MetadataBlob::get_header in - + 7 MetadataBlob::get_root in - + 56 decode_expn_id::{closure#0} in - + 4 decode_syntax_context::{closure#0} in - + 814 def_key::{closure#0} in - + 36 expn_hash_to_expn_id::{closure#0} in - + 49 get_ambig_module_children::{closure#0} in - + 1472 imported_source_file::{closure#2} in - + 88 CrateMetadata::new in CStore::register_crate + 21 CrateRoot>::decode_crate_deps in CStore::register_crate + 38 MetadataBlob::check_compatibility in CStore::register_crate + 75 MetadataBlob::get_header in CStore::register_crate + 41 MetadataBlob::get_root in CStore::register_crate + 43 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + +== wide_core (lib) emit dep-info,metadata,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + open target/debug/incremental/wide_core-#/s-*/metadata.rmeta in encoder::encode_metadata + encode-to target/debug/build/wide-core/#/out/rmeta*/stub.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + remove_file target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + rename target/debug/build/wide-core/#/out/rmeta*/full.rmeta -> target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rustc* in - + write target/debug/build/wide-core/#/out/rustc*/lib.rmeta-link in - + write target/debug/build/wide-core/#/out/rustc*/lib.rmeta in - + create target/debug/build/wide-core/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-core/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-core/#/out/rustc* in - + remove_dir_all target/debug/build/wide-core/#/out/rmeta* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 2 2 items 2 tracked adt_destructor + 15 3 items 3 tracked associated_item + 4 2 items 2 tracked associated_item_def_ids + 21 9 items 9 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 42 21 items 21 tracked codegen_fn_attrs + 21 21 items 21 tracked cross_crate_inlinable + 2 1 items 1 tracked def_ident_span + 75 75 items 75 tracked def_kind + 2 2 items 2 tracked defaultness + 19 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 4 2 items 2 tracked explicit_clauses_of + 7 4 items 4 tracked explicit_implied_clauses_of + 2 1 items 1 tracked expn_that_defined + 58 29 items 29 tracked generics_of + 10 5 items 5 tracked impl_trait_header + 16 16 items 16 tracked implementations_of_trait + 2 2 items 2 tracked inferred_outlives_of + 1 1 items 1 tracked intrinsic_raw + 19 19 items 19 tracked missing_lang_items + 6365 59 items 59 tracked module_children + 23 19 items 19 tracked native_libraries + 4 2 items 2 tracked object_lifetime_default + 4 2 items 2 tracked trait_def + 26 13 items 13 tracked type_of + 184 92 items 92 tracked visibility +read outside a query + 462 CrateMetadata::def_kind in - + 5946 CrateMetadata::def_path_hash in - + 168 CrateMetadata::get_expn_that_defined in - + 30 CrateMetadata::get_item_attrs in - + 45 CrateMetadata::get_macro in - + 2896 CrateMetadata::get_span in - + 30 CrateMetadata::opt_item_ident in - + 19 CrateRoot>::decode_denied_partial_mitigations in - + 19 CrateRoot>::decode_target_modifiers in - + 9 MetadataBlob::check_compatibility in - + 12 MetadataBlob::get_header in - + 3 MetadataBlob::get_root in - + 124 decode_expn_id::{closure#0} in - + 38 decode_syntax_context::{closure#0} in - + 142 def_key::{closure#0} in - + 59 get_ambig_module_children::{closure#0} in - + 60 imported_source_file::{closure#2} in - + 76 CrateMetadata::new in CStore::register_crate + 19 CrateRoot>::decode_crate_deps in CStore::register_crate + 18 MetadataBlob::check_compatibility in CStore::register_crate + 36 MetadataBlob::get_header in CStore::register_crate + 37 MetadataBlob::get_root in CStore::register_crate + 38 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + 4657 CrateMetadata::def_path_hash in encoder::encode_metadata + 18 CrateMetadata::expn_hash_to_expn_id in encoder::encode_metadata + 4 decode_expn_id::{closure#0} in encoder::encode_metadata + 2 decode_syntax_context::{closure#0} in encoder::encode_metadata + 72 def_key::{closure#0} in encoder::encode_metadata + 6 expn_hash_to_expn_id::{closure#0} in encoder::encode_metadata + 922 imported_source_file::{closure#2} in encoder::encode_metadata + +== wide_derive (proc-macro) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + create target/debug/build/wide-derive/#/out/rmeta* in fs::encode_and_write_metadata + open target/debug/incremental/wide_derive-#/s-*/metadata.rmeta in encoder::encode_metadata + open target/debug/build/wide-derive/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-derive/#/out/rustc* in - + write target/debug/build/wide-derive/#/out/rustc*/rmeta.o in - + remove_dir_all target/debug/build/wide-derive/#/out/rustc* in - + remove_dir_all target/debug/build/wide-derive/#/out/rmeta* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 6 2 items 2 tracked attrs_for_def + 21 21 items 21 tracked canonical_symbols + 222 111 items 111 tracked codegen_fn_attrs + 93 93 items 93 tracked cross_crate_inlinable + 239 239 items 239 tracked def_kind + 21 21 items 21 tracked defined_lang_items + 9 9 items 9 tracked diagnostic_items + 1 1 items 1 tracked exportable_items + 23 21 items 21 tracked exported_generic_symbols + 21 21 items 21 tracked exported_non_generic_symbols + 40 19 items 19 tracked generics_of + 68 34 items 34 tracked impl_trait_header + 1 1 items 1 tracked intrinsic_raw + 1 1 items 1 tracked is_mir_available + 21 21 items 21 tracked missing_lang_items + 2975 44 items 44 tracked module_children + 25 21 items 21 tracked native_libraries + 166 1 items 1 tracked reachable_non_generics + 86 43 items 43 tracked type_of + 136 68 items 68 tracked visibility +read outside a query + 86 CrateMetadata::def_kind in - + 9603 CrateMetadata::def_path_hash in - + 48 CrateMetadata::expn_hash_to_expn_id in - + 136 CrateMetadata::get_expn_that_defined in - + 4 CrateMetadata::get_item_attrs in - + 6 CrateMetadata::get_macro in - + 1556 CrateMetadata::get_span in - + 4 CrateMetadata::opt_item_ident in - + 21 CrateRoot>::decode_denied_partial_mitigations in - + 21 CrateRoot>::decode_target_modifiers in - + 11 MetadataBlob::check_compatibility in - + 20 MetadataBlob::get_header in - + 4 MetadataBlob::get_root in - + 48 decode_expn_id::{closure#0} in - + 6 decode_syntax_context::{closure#0} in - + 470 def_key::{closure#0} in - + 16 expn_hash_to_expn_id::{closure#0} in - + 44 get_ambig_module_children::{closure#0} in - + 1532 imported_source_file::{closure#2} in - + 84 CrateMetadata::new in CStore::register_crate + 21 CrateRoot>::decode_crate_deps in CStore::register_crate + 38 MetadataBlob::check_compatibility in CStore::register_crate + 76 MetadataBlob::get_header in CStore::register_crate + 40 MetadataBlob::get_root in CStore::register_crate + 42 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + +== wide_user (lib) emit dep-info,metadata,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-user/#/out/rmeta* in fs::encode_and_write_metadata + open target/debug/incremental/wide_user-#/s-*/metadata.rmeta in encoder::encode_metadata + encode-to target/debug/build/wide-user/#/out/rmeta*/stub.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + remove_file target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + rename target/debug/build/wide-user/#/out/rmeta*/full.rmeta -> target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-user/#/out/rustc* in - + write target/debug/build/wide-user/#/out/rustc*/lib.rmeta-link in - + write target/debug/build/wide-user/#/out/rustc*/lib.rmeta in - + create target/debug/build/wide-user/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-user/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-user/#/out/rustc* in - + remove_dir_all target/debug/build/wide-user/#/out/rmeta* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 15 7 items 7 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 106 53 items 53 tracked codegen_fn_attrs + 52 52 items 52 tracked cross_crate_inlinable + 136 136 items 136 tracked def_kind + 19 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 40 20 items 20 tracked generics_of + 42 21 items 21 tracked impl_trait_header + 19 19 items 19 tracked missing_lang_items + 6392 56 items 56 tracked module_children + 23 19 items 19 tracked native_libraries + 46 23 items 23 tracked type_of + 174 87 items 87 tracked visibility + 8 3 items 3 tracked wide_core attrs_for_def + 1 1 items 1 tracked wide_core canonical_symbols + 10 5 items 5 tracked wide_core codegen_fn_attrs + 4 4 items 4 tracked wide_core cross_crate_inlinable + 10 10 items 10 tracked wide_core def_kind + 1 1 items 1 tracked wide_core defined_lang_items + 1 1 items 1 tracked wide_core diagnostic_items + 8 4 items 4 tracked wide_core generics_of + 2 1 items 1 tracked wide_core impl_trait_header + 1 1 items 1 tracked wide_core missing_lang_items + 199 5 items 5 tracked wide_core module_children + 1 1 items 1 tracked wide_core native_libraries + 4 2 items 2 tracked wide_core type_of + 12 6 items 6 tracked wide_core visibility + 1 1 items 1 tracked wide_derive canonical_symbols + 1 1 items 1 tracked wide_derive defined_lang_items + 1 1 items 1 tracked wide_derive diagnostic_items + 15 1 items 1 tracked wide_derive module_children + 1 1 items 1 tracked wide_derive native_libraries + 2 1 items 1 tracked wide_derive visibility +read outside a query + 289 CrateMetadata::def_kind in - + 6090 CrateMetadata::def_path_hash in - + 174 CrateMetadata::get_expn_that_defined in - + 26 CrateMetadata::get_item_attrs in - + 33 CrateMetadata::get_macro in - + 2976 CrateMetadata::get_span in - + 22 CrateMetadata::opt_item_ident in - + 4 CrateMetadata::raw_proc_macro in - + 20 CrateRoot>::decode_denied_partial_mitigations in - + 20 CrateRoot>::decode_target_modifiers in - + 12 MetadataBlob::check_compatibility in - + 18 MetadataBlob::get_header in - + 6 MetadataBlob::get_root in - + 124 decode_expn_id::{closure#0} in - + 34 decode_syntax_context::{closure#0} in - + 126 def_key::{closure#0} in - + 62 get_ambig_module_children::{closure#0} in - + 62 imported_source_file::{closure#2} in - + 84 CrateMetadata::new in CStore::register_crate + 20 CrateRoot>::decode_crate_deps in CStore::register_crate + 18 MetadataBlob::check_compatibility in CStore::register_crate + 36 MetadataBlob::get_header in CStore::register_crate + 39 MetadataBlob::get_root in CStore::register_crate + 41 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + 1010 CrateMetadata::def_path_hash in encoder::encode_metadata + 30 CrateMetadata::expn_hash_to_expn_id in encoder::encode_metadata + 84 decode_expn_id::{closure#0} in encoder::encode_metadata + 42 decode_syntax_context::{closure#0} in encoder::encode_metadata + 162 def_key::{closure#0} in encoder::encode_metadata + 10 expn_hash_to_expn_id::{closure#0} in encoder::encode_metadata + 924 imported_source_file::{closure#2} in encoder::encode_metadata + diff --git a/tests/rmeta/wide.txt b/tests/rmeta/wide.txt new file mode 100644 index 0000000..29dadc1 --- /dev/null +++ b/tests/rmeta/wide.txt @@ -0,0 +1,943 @@ +== build_script_build (bin) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-core/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + remove_dir_all target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rustc* in - + remove_dir_all target/debug/build/wide-core/#/out/rustc* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 1275 37 items 37 tracked adt_def + 23 19 items 19 tracked adt_destructor + 152 76 items 76 tracked anon_const_kind + 2098 296 items 296 tracked associated_item + 110 55 items 55 tracked associated_item_def_ids + 7 7 items 7 tracked asyncness + 210 78 items 78 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 306 153 items 153 tracked codegen_fn_attrs + 32 16 items 16 tracked const_conditions + 88 88 items 88 tracked constness + 3 3 items 3 tracked coroutine_kind + 3 3 items 3 tracked crate_name + 84 84 items 84 tracked cross_crate_inlinable + 22 11 items 11 tracked def_ident_span + 484 484 items 484 tracked def_kind + 426 193 items 193 tracked def_span + 122 122 items 122 tracked defaultness + 35 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 504 233 items 233 tracked explicit_clauses_of + 72 37 items 37 tracked explicit_implied_clauses_of + 13 10 items 10 tracked explicit_implied_const_bounds + 2 1 items 1 tracked explicit_item_bounds + 2 1 items 1 tracked explicit_item_self_bounds + 14 8 items 8 tracked explicit_super_clauses_of + 40 10 items 10 tracked expn_that_defined + 3 3 items 3 tracked exportable_items + 21 19 items 19 tracked exported_generic_symbols + 19 19 items 19 tracked exported_non_generic_symbols + 19 19 items 19 tracked externally_implementable_items + 250 124 items 124 tracked fn_sig + 616 306 items 306 tracked generics_of + 37 37 items 37 tracked impl_parent + 160 80 items 80 tracked impl_trait_header + 124 124 items 124 tracked implementations_of_trait + 235 233 items 233 tracked inferred_outlives_of + 8 4 items 4 tracked inherent_impls + 115 107 items 107 tracked intrinsic_raw + 2 2 items 2 tracked is_doc_hidden + 59 59 items 59 tracked is_mir_available + 25 25 items 25 tracked lookup_deprecation_entry + 64 32 items 32 tracked lookup_stability + 202 91 items 91 tracked mir_for_ctfe + 19 19 items 19 tracked missing_lang_items + 3913 45 items 45 tracked module_children + 23 19 items 19 tracked native_libraries + 434 59 items 59 tracked optimized_mir + 1468 3 items 3 tracked reachable_non_generics + 3 3 items 3 tracked stable_order_of_exportable_impls + 80 39 items 39 tracked trait_def + 111 94 items 94 tracked trivial_const + 504 252 items 252 tracked type_of + 32 16 items 16 tracked variances_of + 190 95 items 95 tracked visibility + 2 0 items 0 tracked ? crate_incoherent_impls +read outside a query + 96 CrateMetadata::def_kind in - + 41843 CrateMetadata::def_path_hash in - + 140 CrateMetadata::get_expn_that_defined in - + 10 CrateMetadata::get_item_attrs in - + 15 CrateMetadata::get_macro in - + 2038 CrateMetadata::get_span in - + 10 CrateMetadata::opt_item_ident in - + 19 CrateRoot>::decode_denied_partial_mitigations in - + 19 CrateRoot>::decode_target_modifiers in - + 15 MetadataBlob::check_compatibility in - + 24 MetadataBlob::get_header in - + 3 MetadataBlob::get_root in - + 28 decode_expn_id::{closure#0} in - + 522 def_key::{closure#0} in - + 45 get_ambig_module_children::{closure#0} in - + 50 imported_source_file::{closure#2} in - + 76 CrateMetadata::new in CStore::register_crate + 19 CrateRoot>::decode_crate_deps in CStore::register_crate + 36 MetadataBlob::check_compatibility in CStore::register_crate + 72 MetadataBlob::get_header in CStore::register_crate + 37 MetadataBlob::get_root in CStore::register_crate + 38 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + +== wide (bin) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in - + create target/debug/build/wide/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + remove_dir_all target/debug/build/wide/#/out/rmeta* in fs::encode_and_write_metadata + create target/debug/build/wide/#/out/rustc* in - + remove_dir_all target/debug/build/wide/#/out/rustc* in - +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 1760 70 items 70 tracked adt_def + 61 46 items 46 tracked adt_destructor + 164 82 items 82 tracked anon_const_kind + 5834 859 items 859 tracked associated_item + 308 154 items 154 tracked associated_item_def_ids + 8 8 items 8 tracked asyncness + 348 135 items 135 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 38 19 items 19 tracked closure_saved_names_of_captured_variables + 1406 703 items 703 tracked codegen_fn_attrs + 82 41 items 41 tracked const_conditions + 264 264 items 264 tracked constness + 19 19 items 19 tracked coroutine_kind + 3 3 items 3 tracked crate_name + 613 613 items 613 tracked cross_crate_inlinable + 19 19 items 19 tracked debugger_visualizers + 38 19 items 19 tracked def_ident_span + 1414 1414 items 1414 tracked def_kind + 1792 865 items 865 tracked def_span + 277 277 items 277 tracked defaultness + 35 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 904 390 items 390 tracked explicit_clauses_of + 112 55 items 55 tracked explicit_implied_clauses_of + 20 14 items 14 tracked explicit_implied_const_bounds + 2 1 items 1 tracked explicit_item_bounds + 6 3 items 3 tracked explicit_item_self_bounds + 22 11 items 11 tracked explicit_super_clauses_of + 40 16 items 16 tracked expn_that_defined + 3 3 items 3 tracked exportable_items + 21 19 items 19 tracked exported_generic_symbols + 19 19 items 19 tracked exported_non_generic_symbols + 19 19 items 19 tracked externally_implementable_items + 1352 675 items 675 tracked fn_sig + 2330 1162 items 1162 tracked generics_of + 85 85 items 85 tracked impl_parent + 454 227 items 227 tracked impl_trait_header + 202 202 items 202 tracked implementations_of_trait + 397 390 items 390 tracked inferred_outlives_of + 18 9 items 9 tracked inherent_impls + 329 308 items 308 tracked intrinsic_raw + 2 2 items 2 tracked is_doc_hidden + 215 215 items 215 tracked is_mir_available + 2 1 items 1 tracked lookup_const_stability + 31 31 items 31 tracked lookup_deprecation_entry + 80 40 items 40 tracked lookup_stability + 324 134 items 134 tracked mir_for_ctfe + 19 19 items 19 tracked missing_lang_items + 3431 44 items 44 tracked module_children + 23 19 items 19 tracked native_libraries + 2 1 items 1 tracked object_lifetime_default + 1578 215 items 215 tracked optimized_mir + 8 4 items 4 tracked promoted_mir + 1468 3 items 3 tracked reachable_non_generics + 3 3 items 3 tracked stable_order_of_exportable_impls + 120 59 items 59 tracked trait_def + 157 133 items 133 tracked trivial_const + 2272 1136 items 1136 tracked type_of + 54 27 items 27 tracked variances_of + 628 314 items 314 tracked visibility + 4 0 items 0 tracked ? crate_incoherent_impls + 116 4 items 4 tracked core_lib adt_def + 4 4 items 4 tracked core_lib adt_destructor + 42 8 items 8 tracked core_lib associated_item + 8 4 items 4 tracked core_lib associated_item_def_ids + 21 10 items 10 tracked core_lib attrs_for_def + 1 1 items 1 tracked core_lib canonical_symbols + 4 2 items 2 tracked core_lib closure_saved_names_of_captured_variables + 10 5 items 5 tracked core_lib codegen_fn_attrs + 4 2 items 2 tracked core_lib const_of_item + 3 3 items 3 tracked core_lib constness + 2 2 items 2 tracked core_lib coroutine_kind + 1 1 items 1 tracked core_lib crate_name + 4 4 items 4 tracked core_lib cross_crate_inlinable + 1 1 items 1 tracked core_lib debugger_visualizers + 8 4 items 4 tracked core_lib def_ident_span + 20 20 items 20 tracked core_lib def_kind + 20 10 items 10 tracked core_lib def_span + 5 5 items 5 tracked core_lib defaultness + 1 1 items 1 tracked core_lib defined_lang_items + 1 1 items 1 tracked core_lib diagnostic_items + 34 17 items 17 tracked core_lib explicit_clauses_of + 4 2 items 2 tracked core_lib explicit_implied_clauses_of + 2 1 items 1 tracked core_lib explicit_item_bounds + 8 1 items 1 tracked core_lib explicit_item_self_bounds + 12 4 items 4 tracked core_lib expn_that_defined + 1 1 items 1 tracked core_lib exportable_items + 1 1 items 1 tracked core_lib exported_generic_symbols + 1 1 items 1 tracked core_lib exported_non_generic_symbols + 1 1 items 1 tracked core_lib externally_implementable_items + 8 4 items 4 tracked core_lib fn_sig + 32 16 items 16 tracked core_lib generics_of + 1 1 items 1 tracked core_lib impl_parent + 4 2 items 2 tracked core_lib impl_trait_header + 10 10 items 10 tracked core_lib implementations_of_trait + 17 17 items 17 tracked core_lib inferred_outlives_of + 4 2 items 2 tracked core_lib inherent_impls + 2 2 items 2 tracked core_lib intrinsic_raw + 3 3 items 3 tracked core_lib is_mir_available + 8 8 items 8 tracked core_lib lookup_deprecation_entry + 5 5 items 5 tracked core_lib lookup_stability + 2 1 items 1 tracked core_lib mir_const_qualif + 2 1 items 1 tracked core_lib mir_for_ctfe + 1 1 items 1 tracked core_lib missing_lang_items + 137 3 items 3 tracked core_lib module_children + 1 1 items 1 tracked core_lib native_libraries + 24 3 items 3 tracked core_lib optimized_mir + 4 1 items 1 tracked core_lib reachable_non_generics + 1 1 items 1 tracked core_lib stable_order_of_exportable_impls + 4 2 items 2 tracked core_lib trait_def + 1 1 items 1 tracked core_lib trivial_const + 44 22 items 22 tracked core_lib type_of + 6 3 items 3 tracked core_lib variances_of + 32 16 items 16 tracked core_lib visibility + 39 2 items 2 tracked user adt_def + 2 2 items 2 tracked user adt_destructor + 70 8 items 8 tracked user associated_item + 12 6 items 6 tracked user associated_item_def_ids + 10 5 items 5 tracked user attrs_for_def + 1 1 items 1 tracked user canonical_symbols + 2 1 items 1 tracked user closure_saved_names_of_captured_variables + 20 10 items 10 tracked user codegen_fn_attrs + 10 10 items 10 tracked user constness + 1 1 items 1 tracked user coroutine_kind + 1 1 items 1 tracked user crate_name + 10 10 items 10 tracked user cross_crate_inlinable + 1 1 items 1 tracked user debugger_visualizers + 14 3 items 3 tracked user def_ident_span + 25 25 items 25 tracked user def_kind + 32 16 items 16 tracked user def_span + 11 11 items 11 tracked user defaultness + 1 1 items 1 tracked user defined_lang_items + 1 1 items 1 tracked user diagnostic_items + 34 17 items 17 tracked user explicit_clauses_of + 2 1 items 1 tracked user explicit_item_bounds + 8 1 items 1 tracked user explicit_item_self_bounds + 2 1 items 1 tracked user expn_that_defined + 1 1 items 1 tracked user exportable_items + 1 1 items 1 tracked user exported_generic_symbols + 1 1 items 1 tracked user exported_non_generic_symbols + 1 1 items 1 tracked user externally_implementable_items + 18 9 items 9 tracked user fn_sig + 46 23 items 23 tracked user generics_of + 5 5 items 5 tracked user impl_parent + 12 6 items 6 tracked user impl_trait_header + 9 9 items 9 tracked user implementations_of_trait + 17 17 items 17 tracked user inferred_outlives_of + 2 1 items 1 tracked user inherent_impls + 9 9 items 9 tracked user intrinsic_raw + 3 3 items 3 tracked user is_doc_hidden + 5 5 items 5 tracked user is_mir_available + 10 10 items 10 tracked user lookup_deprecation_entry + 8 8 items 8 tracked user lookup_stability + 1 1 items 1 tracked user missing_lang_items + 97 2 items 2 tracked user module_children + 1 1 items 1 tracked user native_libraries + 16 5 items 5 tracked user optimized_mir + 6 1 items 1 tracked user reachable_non_generics + 1 1 items 1 tracked user stable_order_of_exportable_impls + 4 2 items 2 tracked user trivial_const + 1 1 items 1 tracked user type_alias_is_checked + 44 22 items 22 tracked user type_of + 4 2 items 2 tracked user variances_of + 20 10 items 10 tracked user visibility + 1 1 items 1 tracked wide_derive canonical_symbols + 2 1 items 1 tracked wide_derive defined_lang_items + 1 1 items 1 tracked wide_derive diagnostic_items + 1 1 items 1 tracked wide_derive exported_generic_symbols + 1 1 items 1 tracked wide_derive externally_implementable_items + 1 1 items 1 tracked wide_derive missing_lang_items + 1 1 items 1 tracked wide_derive native_libraries +read outside a query + 89 CrateMetadata::def_kind in - + 86011 CrateMetadata::def_path_hash in - + 148 CrateMetadata::get_expn_that_defined in - + 6 CrateMetadata::get_item_attrs in - + 9 CrateMetadata::get_macro in - + 1970 CrateMetadata::get_span in - + 6 CrateMetadata::opt_item_ident in - + 21 CrateRoot>::decode_denied_partial_mitigations in - + 21 CrateRoot>::decode_target_modifiers in - + 23 MetadataBlob::check_compatibility in - + 40 MetadataBlob::get_header in - + 7 MetadataBlob::get_root in - + 36 decode_expn_id::{closure#0} in - + 2076 def_key::{closure#0} in - + 49 get_ambig_module_children::{closure#0} in - + 50 imported_source_file::{closure#2} in - + 88 CrateMetadata::new in CStore::register_crate + 21 CrateRoot>::decode_crate_deps in CStore::register_crate + 38 MetadataBlob::check_compatibility in CStore::register_crate + 75 MetadataBlob::get_header in CStore::register_crate + 41 MetadataBlob::get_root in CStore::register_crate + 43 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + +== wide_core (lib) emit dep-info,metadata,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-core/#/out/rmeta* in fs::encode_and_write_metadata + encode-to target/debug/build/wide-core/#/out/rmeta*/full.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + encode-to target/debug/build/wide-core/#/out/rmeta*/stub.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + remove_file target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + rename target/debug/build/wide-core/#/out/rmeta*/full.rmeta -> target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-core/#/out/rustc* in - + write target/debug/build/wide-core/#/out/rustc*/lib.rmeta-link in - + write target/debug/build/wide-core/#/out/rustc*/lib.rmeta in - + create target/debug/build/wide-core/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-core/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-core/#/out/rustc* in - + remove_dir_all target/debug/build/wide-core/#/out/rmeta* in - +encoded + 2 2 items adapted.set_some(on_disk_index, self.lazy(adapted_source_file)) + 29 29 items expn_data_table .set_some(index.as_raw(), this.lazy(expn_data.expect("local expn"))) + 29 29 items expn_hash_table.set_some(index.as_raw(), this.lazy(hash)) + 2 2 items record_array!( self.tables.assumed_wf_types_for_rpitit[def_id] <- self.tcx.assumed_wf_types_for_rpitit(def_id) ) + 27 27 items record_array!(self.tables.associated_item_or_field_def_ids[def_id] <- associated_item_def_ids.iter().map(|&def_id| { assert!(def_id.is_local()); def_id.index }) + 6 6 items record_array!(self.tables.associated_item_or_field_def_ids[variant.def_id] <- variant.fields.iter().map(|f| { assert!(f.did.is_local()); f.did.index })) + 95 95 items record_array!(self.tables.attributes[def_id.to_def_id()] <- attr_iter) + 26 26 items record_array!(self.tables.fn_arg_idents[def_id] <- tcx.fn_arg_idents(def_id)) + 2 1 items record_array!(self.tables.module_children_non_reexports[def_id] <- module_children.iter().filter(|child| child.reexport_chain.is_empty()) .map(|child| child.res + 5 5 items record_array!(self.tables.module_children_non_reexports[def_id] <- module_children.iter().map(|child| child.res.def_id().index)) + 39 39 items record_array!(self.tables.variances_of[def_id] <- v) + 2 1 items record_defaulted_array!(self.tables.ambig_module_children[def_id] <- ambig_module_children) + 4 4 items record_defaulted_array!(self.tables.explicit_implied_clauses_of[def_id] <- self.tcx.explicit_implied_clauses_of(def_id).skip_binder()) + 7 7 items record_defaulted_array!(self.tables.explicit_item_bounds[def_id] <- bounds) + 7 7 items record_defaulted_array!(self.tables.explicit_item_self_bounds[def_id] <- bounds) + 4 4 items record_defaulted_array!(self.tables.explicit_super_clauses_of[def_id] <- self.tcx.explicit_super_clauses_of(def_id).skip_binder()) + 97 97 items record_defaulted_array!(self.tables.inferred_outlives_of[def_id] <- inferred_outlives) + 1 1 items record_defaulted_array!(self.tables.inherent_impls[def_id.to_def_id()] <- impls.iter().map(|def_id| { assert!(def_id.is_local()); def_id.index })) + 2 1 items record_defaulted_array!(self.tables.module_children_reexports[def_id] <- module_children.iter().filter(|child| !child.reexport_chain.is_empty())) + 164 164 items record_some!(self.tables.def_kind[def_id] <- def_kind) + 8 8 items record_some_lazy!( self.tables.mut_restriction[field.did] <- field.mut_restriction ) + 1 1 items record_some_lazy!(self.tables.anon_const_kind[def_id] <- self.tcx.anon_const_kind(def_id)) + 7 7 items record_some_lazy!(self.tables.args_known_to_outlive_alias_params[def_id] <- tcx.args_known_to_outlive_alias_params(def_id)) + 32 32 items record_some_lazy!(self.tables.assoc_container[def_id] <- item.container) + 27 27 items record_some_lazy!(self.tables.associated_types_for_impl_traits_in_trait_or_impl[def_id] <- table) + 23 23 items record_some_lazy!(self.tables.closure_saved_names_of_captured_variables[def_id.to_def_id()] <- tcx.closure_saved_names_of_captured_variables(def_id)) + 32 32 items record_some_lazy!(self.tables.codegen_fn_attrs[def_id] <- self.tcx.codegen_fn_attrs(def_id)) + 2 2 items record_some_lazy!(self.tables.collect_return_position_impl_trait_in_trait_tys[def_id] <- table) + 3 3 items record_some_lazy!(self.tables.const_conditions[def_id] <- self.tcx.const_conditions(def_id)) + 4 4 items record_some_lazy!(self.tables.const_of_item[def_id] <- self.tcx.const_of_item(def_id)) + 124 124 items record_some_lazy!(self.tables.def_ident_span[def_id] <- ident_span) + 164 164 items record_some_lazy!(self.tables.def_keys[def_id] <- def_key) + 156 156 items record_some_lazy!(self.tables.def_span[def_id] <- def_span) + 1 1 items record_some_lazy!(self.tables.eval_static_initializer[def_id] <- data) + 97 97 items record_some_lazy!(self.tables.explicit_clauses_of[def_id] <- self.tcx.explicit_clauses_of(def_id)) + 35 35 items record_some_lazy!(self.tables.expn_that_defined[def_id] <- self.tcx.expn_that_defined(def_id)) + 29 29 items record_some_lazy!(self.tables.fn_sig[def_id] <- tcx.fn_sig(def_id)) + 3 3 items record_some_lazy!(self.tables.fn_sig[variant.def_id] <- fn_sig) + 97 97 items record_some_lazy!(self.tables.generics_of[def_id] <- g) + 22 22 items record_some_lazy!(self.tables.impl_trait_header[def_id] <- header) + 1 1 items record_some_lazy!(self.tables.macro_definition[def_id.to_def_id()] <- &*macro_def.body) + 4 4 items record_some_lazy!(self.tables.mir_const_qualif[def_id.to_def_id()] <- qualifs) + 2 1 items record_some_lazy!(self.tables.mir_coroutine_witnesses[def_id.to_def_id()] <- witnesses) + 6 6 items record_some_lazy!(self.tables.mir_for_ctfe[def_id.to_def_id()] <- tcx.mir_for_ctfe(def_id)) + 12 12 items record_some_lazy!(self.tables.object_lifetime_default[def_id] <- default) + 4 4 items record_some_lazy!(self.tables.opaque_ty_origin[def_id] <- self.tcx.opaque_ty_origin(def_id)) + 4 4 items record_some_lazy!(self.tables.opt_rpitit_info[def_id] <- rpitit_info) + 23 23 items record_some_lazy!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id)) + 4 4 items record_some_lazy!(self.tables.params_in_repr[def_id] <- params_in_repr) + 29 29 items record_some_lazy!(self.tables.promoted_mir[def_id.to_def_id()] <- tcx.promoted_mir(def_id)) + 4 4 items record_some_lazy!(self.tables.rendered_const[def_id.to_def_id()] <- const_data) + 4 4 items record_some_lazy!(self.tables.repr_options[def_id] <- adt_def.repr()) + 4 4 items record_some_lazy!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id)) + 1 1 items record_some_lazy!(self.tables.trivial_const[def_id.to_def_id()] <- (val, ty)) + 88 88 items record_some_lazy!(self.tables.type_of[def_id] <- self.tcx.type_of(def_id)) + 6 6 items record_some_lazy!(self.tables.variant_data[variant.def_id] <- data) + 61 61 items record_some_lazy!(self.tables.visibility[def_id] <- vis) + 26 26 items record_value!(self.tables.asyncness[def_id] <- asyncness) + 95 95 items record_value!(self.tables.attr_flags[def_id.to_def_id()] <- attr_flags) + 32 32 items record_value!(self.tables.constness[def_id] <- constness) + 1 1 items record_value!(self.tables.coroutine_kind[def_id] <- Some(coroutine_kind)) + 23 23 items record_value!(self.tables.cross_crate_inlinable[def_id.to_def_id()] <- self.tcx.cross_crate_inlinable(def_id)) + 164 164 items record_value!(self.tables.def_path_hashes[def_id] <- def_path_hash.local_hash().as_u64()) + 30 30 items record_value!(self.tables.defaultness[def_id] <- item.defaultness(tcx)) + 22 22 items record_value!(self.tables.defaultness[def_id] <- tcx.defaultness(def_id)) + 22 22 items record_value!(self.tables.impl_is_fully_generic_for_reflection[def_id] <- impl_is_fully_generic_for_reflection) + 1 1 items record_value!(self.tables.is_macro_rules[def_id.to_def_id()] <- macro_def.macro_rules) + 8 8 items record_value!(self.tables.safety[field.did] <- field.safety) + 1576 0 items self.set(i, Some(value)) + 26 26 items syntax_contexts.set_some(index, this.lazy(ctxt_data)) +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 930 37 items 37 tracked adt_def + 23 20 items 20 tracked adt_destructor + 164 82 items 82 tracked anon_const_kind + 7892 1149 items 1149 tracked associated_item + 254 127 items 127 tracked associated_item_def_ids + 22 11 items 11 tracked associated_types_for_impl_traits_in_trait_or_impl + 5 5 items 5 tracked asyncness + 263 85 items 85 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 2 1 items 1 tracked closure_saved_names_of_captured_variables + 282 141 items 141 tracked codegen_fn_attrs + 58 29 items 29 tracked const_conditions + 4 2 items 2 tracked const_of_item + 78 78 items 78 tracked constness + 1 1 items 1 tracked coroutine_kind + 3 3 items 3 tracked crate_name + 93 93 items 93 tracked cross_crate_inlinable + 92 46 items 46 tracked def_ident_span + 574 574 items 574 tracked def_kind + 578 270 items 270 tracked def_span + 155 155 items 155 tracked defaultness + 35 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 706 310 items 310 tracked explicit_clauses_of + 89 47 items 47 tracked explicit_implied_clauses_of + 16 13 items 13 tracked explicit_implied_const_bounds + 2 1 items 1 tracked explicit_item_bounds + 6 3 items 3 tracked explicit_item_self_bounds + 18 11 items 11 tracked explicit_super_clauses_of + 94 35 items 35 tracked expn_that_defined + 2 2 items 2 tracked exportable_items + 20 18 items 18 tracked exported_generic_symbols + 2 2 items 2 tracked exported_non_generic_symbols + 19 19 items 19 tracked externally_implementable_items + 300 150 items 150 tracked fn_sig + 844 422 items 422 tracked generics_of + 25 25 items 25 tracked impl_parent + 258 129 items 129 tracked impl_trait_header + 212 212 items 212 tracked implementations_of_trait + 311 310 items 310 tracked inferred_outlives_of + 16 8 items 8 tracked inherent_impls + 79 73 items 73 tracked intrinsic_raw + 3 3 items 3 tracked is_doc_hidden + 22 22 items 22 tracked is_mir_available + 2 1 items 1 tracked lookup_const_stability + 16 16 items 16 tracked lookup_default_body_stability + 65 65 items 65 tracked lookup_deprecation_entry + 172 86 items 86 tracked lookup_stability + 216 98 items 98 tracked mir_for_ctfe + 19 19 items 19 tracked missing_lang_items + 6365 59 items 59 tracked module_children + 23 19 items 19 tracked native_libraries + 24 12 items 12 tracked object_lifetime_default + 182 21 items 21 tracked optimized_mir + 6 3 items 3 tracked params_in_repr + 642 2 items 2 tracked reachable_non_generics + 2 2 items 2 tracked stable_order_of_exportable_impls + 108 52 items 52 tracked trait_def + 111 97 items 97 tracked trivial_const + 2 2 items 2 tracked type_alias_is_checked + 630 315 items 315 tracked type_of + 66 33 items 33 tracked variances_of + 438 219 items 219 tracked visibility + 4 0 items 0 tracked ? crate_incoherent_impls +read outside a query + 462 CrateMetadata::def_kind in - + 55745 CrateMetadata::def_path_hash in - + 168 CrateMetadata::get_expn_that_defined in - + 30 CrateMetadata::get_item_attrs in - + 45 CrateMetadata::get_macro in - + 2896 CrateMetadata::get_span in - + 30 CrateMetadata::opt_item_ident in - + 19 CrateRoot>::decode_denied_partial_mitigations in - + 19 CrateRoot>::decode_target_modifiers in - + 9 MetadataBlob::check_compatibility in - + 12 MetadataBlob::get_header in - + 3 MetadataBlob::get_root in - + 124 decode_expn_id::{closure#0} in - + 38 decode_syntax_context::{closure#0} in - + 340 def_key::{closure#0} in - + 59 get_ambig_module_children::{closure#0} in - + 60 imported_source_file::{closure#2} in - + 76 CrateMetadata::new in CStore::register_crate + 19 CrateRoot>::decode_crate_deps in CStore::register_crate + 18 MetadataBlob::check_compatibility in CStore::register_crate + 36 MetadataBlob::get_header in CStore::register_crate + 37 MetadataBlob::get_root in CStore::register_crate + 38 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + 6230 CrateMetadata::def_path_hash in encoder::encode_metadata + 126 def_key::{closure#0} in encoder::encode_metadata + +== wide_derive (proc-macro) emit dep-info,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-#.rmeta in - + create target/debug/build/wide-derive/#/out/rmeta* in fs::encode_and_write_metadata + encode-to target/debug/build/wide-derive/#/out/rmeta*/full.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + open target/debug/build/wide-derive/#/out/rmeta*/full.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-derive/#/out/rustc* in - + write target/debug/build/wide-derive/#/out/rustc*/rmeta.o in - + remove_dir_all target/debug/build/wide-derive/#/out/rustc* in - + remove_dir_all target/debug/build/wide-derive/#/out/rmeta* in - +encoded + 1 1 items adapted.set_some(on_disk_index, self.lazy(adapted_source_file)) + 1 1 items expn_data_table .set_some(index.as_raw(), this.lazy(expn_data.expect("local expn"))) + 1 1 items expn_hash_table.set_some(index.as_raw(), this.lazy(hash)) + 3 3 items record_array!(self.tables.attributes[def_id.to_def_id()] <- attr_iter) + 1 1 items record_some!(self.tables.def_kind[LOCAL_CRATE.as_def_id()] <- DefKind::Mod) + 2 2 items record_some!(self.tables.def_kind[def_id] <- DefKind::Macro(macro_kind.into())) + 2 2 items record_some_lazy!(self.tables.def_ident_span[def_id] <- span) + 5 3 items record_some_lazy!(self.tables.def_keys[def_id] <- def_key) + 1 1 items record_some_lazy!(self.tables.def_span[LOCAL_CRATE.as_def_id()] <- tcx.def_span(LOCAL_CRATE.as_def_id())) + 2 2 items record_some_lazy!(self.tables.def_span[def_id] <- span) + 1 1 items record_some_lazy!(self.tables.expn_that_defined[def_id] <- tcx.expn_that_defined(local_def_id)) + 1 1 items record_some_lazy!(self.tables.visibility[LOCAL_CRATE.as_def_id()] <- vis) + 2 2 items record_some_lazy!(self.tables.visibility[def_id] <- ty::Visibility::Public) + 3 3 items record_value!(self.tables.attr_flags[def_id.to_def_id()] <- attr_flags) + 3 3 items record_value!(self.tables.def_path_hashes[def_id] <- def_path_hash.local_hash().as_u64()) + 23 0 items self.set(i, Some(value)) +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 1763 63 items 63 tracked adt_def + 54 46 items 46 tracked adt_destructor + 154 77 items 77 tracked anon_const_kind + 3120 469 items 469 tracked associated_item + 188 94 items 94 tracked associated_item_def_ids + 5 5 items 5 tracked asyncness + 288 116 items 116 tracked attrs_for_def + 21 21 items 21 tracked canonical_symbols + 474 237 items 237 tracked codegen_fn_attrs + 42 21 items 21 tracked const_conditions + 132 132 items 132 tracked constness + 8 8 items 8 tracked coroutine_kind + 4 4 items 4 tracked crate_name + 137 137 items 137 tracked cross_crate_inlinable + 34 17 items 17 tracked def_ident_span + 680 680 items 680 tracked def_kind + 588 259 items 259 tracked def_span + 184 184 items 184 tracked defaultness + 38 21 items 21 tracked defined_lang_items + 9 9 items 9 tracked diagnostic_items + 696 303 items 303 tracked explicit_clauses_of + 75 38 items 38 tracked explicit_implied_clauses_of + 9 8 items 8 tracked explicit_implied_const_bounds + 2 1 items 1 tracked explicit_item_self_bounds + 13 8 items 8 tracked explicit_super_clauses_of + 22 11 items 11 tracked expn_that_defined + 4 4 items 4 tracked exportable_items + 23 21 items 21 tracked exported_generic_symbols + 21 21 items 21 tracked exported_non_generic_symbols + 21 21 items 21 tracked externally_implementable_items + 398 199 items 199 tracked fn_sig + 830 413 items 413 tracked generics_of + 62 62 items 62 tracked impl_parent + 220 110 items 110 tracked impl_trait_header + 155 155 items 155 tracked implementations_of_trait + 306 303 items 303 tracked inferred_outlives_of + 20 10 items 10 tracked inherent_impls + 182 169 items 169 tracked intrinsic_raw + 6 6 items 6 tracked is_doc_hidden + 97 97 items 97 tracked is_mir_available + 4 2 items 2 tracked lookup_const_stability + 26 26 items 26 tracked lookup_deprecation_entry + 78 39 items 39 tracked lookup_stability + 308 119 items 119 tracked mir_for_ctfe + 21 21 items 21 tracked missing_lang_items + 2975 44 items 44 tracked module_children + 25 21 items 21 tracked native_libraries + 670 96 items 96 tracked optimized_mir + 4 2 items 2 tracked promoted_mir + 1634 4 items 4 tracked reachable_non_generics + 4 4 items 4 tracked stable_order_of_exportable_impls + 86 42 items 42 tracked trait_def + 130 113 items 113 tracked trivial_const + 892 446 items 446 tracked type_of + 34 17 items 17 tracked variances_of + 198 99 items 99 tracked visibility + 2 0 items 0 tracked ? crate_incoherent_impls +read outside a query + 86 CrateMetadata::def_kind in - + 51069 CrateMetadata::def_path_hash in - + 136 CrateMetadata::get_expn_that_defined in - + 4 CrateMetadata::get_item_attrs in - + 6 CrateMetadata::get_macro in - + 1556 CrateMetadata::get_span in - + 4 CrateMetadata::opt_item_ident in - + 21 CrateRoot>::decode_denied_partial_mitigations in - + 21 CrateRoot>::decode_target_modifiers in - + 11 MetadataBlob::check_compatibility in - + 20 MetadataBlob::get_header in - + 4 MetadataBlob::get_root in - + 32 decode_expn_id::{closure#0} in - + 764 def_key::{closure#0} in - + 44 get_ambig_module_children::{closure#0} in - + 52 imported_source_file::{closure#2} in - + 84 CrateMetadata::new in CStore::register_crate + 21 CrateRoot>::decode_crate_deps in CStore::register_crate + 38 MetadataBlob::check_compatibility in CStore::register_crate + 76 MetadataBlob::get_header in CStore::register_crate + 40 MetadataBlob::get_root in CStore::register_crate + 42 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + 4 CrateMetadata::def_path_hash in encoder::encode_metadata + +== wide_user (lib) emit dep-info,metadata,link == +files + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-#.rmeta in CStore::register_crate + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-#.rmeta in CStore::register_crate + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open target/debug/build/wide-core/#/out/libwide_core-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-#.rmeta in - + open /lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-#.rmeta in - + create target/debug/build/wide-user/#/out/rmeta* in fs::encode_and_write_metadata + encode-to target/debug/build/wide-user/#/out/rmeta*/full.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + encode-to target/debug/build/wide-user/#/out/rmeta*/stub.rmeta in encoder::encode_metadata + finished in encoder::encode_metadata + remove_file target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + rename target/debug/build/wide-user/#/out/rmeta*/full.rmeta -> target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + open target/debug/build/wide-user/#/out/libwide_user-#.rmeta in fs::encode_and_write_metadata + create target/debug/build/wide-user/#/out/rustc* in - + write target/debug/build/wide-user/#/out/rustc*/lib.rmeta-link in - + write target/debug/build/wide-user/#/out/rustc*/lib.rmeta in - + create target/debug/build/wide-user/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-user/#/out/.tmp*.temp-archive in - + remove_dir_all target/debug/build/wide-user/#/out/rustc* in - + remove_dir_all target/debug/build/wide-user/#/out/rmeta* in - +encoded + 1 1 items adapted.set_some(on_disk_index, self.lazy(adapted_source_file)) + 20 20 items expn_data_table .set_some(index.as_raw(), this.lazy(expn_data.expect("local expn"))) + 20 20 items expn_hash_table.set_some(index.as_raw(), this.lazy(hash)) + 17 17 items record_array!(self.tables.associated_item_or_field_def_ids[def_id] <- associated_item_def_ids.iter().map(|&def_id| { assert!(def_id.is_local()); def_id.index }) + 4 4 items record_array!(self.tables.associated_item_or_field_def_ids[variant.def_id] <- variant.fields.iter().map(|f| { assert!(f.did.is_local()); f.did.index })) + 58 58 items record_array!(self.tables.attributes[def_id.to_def_id()] <- attr_iter) + 15 15 items record_array!(self.tables.fn_arg_idents[def_id] <- tcx.fn_arg_idents(def_id)) + 2 1 items record_array!(self.tables.module_children_non_reexports[def_id] <- module_children.iter().filter(|child| child.reexport_chain.is_empty()) .map(|child| child.res + 1 1 items record_array!(self.tables.module_children_non_reexports[def_id] <- module_children.iter().map(|child| child.res.def_id().index)) + 21 21 items record_array!(self.tables.variances_of[def_id] <- v) + 2 1 items record_defaulted_array!(self.tables.ambig_module_children[def_id] <- ambig_module_children) + 1 1 items record_defaulted_array!(self.tables.explicit_item_bounds[def_id] <- bounds) + 1 1 items record_defaulted_array!(self.tables.explicit_item_self_bounds[def_id] <- bounds) + 53 53 items record_defaulted_array!(self.tables.inferred_outlives_of[def_id] <- inferred_outlives) + 1 1 items record_defaulted_array!(self.tables.inherent_impls[def_id.to_def_id()] <- impls.iter().map(|def_id| { assert!(def_id.is_local()); def_id.index })) + 2 1 items record_defaulted_array!(self.tables.module_children_reexports[def_id] <- module_children.iter().filter(|child| !child.reexport_chain.is_empty())) + 88 88 items record_some!(self.tables.def_kind[def_id] <- def_kind) + 1 1 items record_some_lazy!( self.tables.mut_restriction[field.did] <- field.mut_restriction ) + 2 2 items record_some_lazy!(self.tables.anon_const_kind[def_id] <- self.tcx.anon_const_kind(def_id)) + 1 1 items record_some_lazy!(self.tables.args_known_to_outlive_alias_params[def_id] <- tcx.args_known_to_outlive_alias_params(def_id)) + 14 14 items record_some_lazy!(self.tables.assoc_container[def_id] <- item.container) + 17 17 items record_some_lazy!(self.tables.associated_types_for_impl_traits_in_trait_or_impl[def_id] <- table) + 11 11 items record_some_lazy!(self.tables.closure_saved_names_of_captured_variables[def_id.to_def_id()] <- tcx.closure_saved_names_of_captured_variables(def_id)) + 22 22 items record_some_lazy!(self.tables.codegen_fn_attrs[def_id] <- self.tcx.codegen_fn_attrs(def_id)) + 2 2 items record_some_lazy!(self.tables.const_of_item[def_id] <- self.tcx.const_of_item(def_id)) + 59 59 items record_some_lazy!(self.tables.def_ident_span[def_id] <- ident_span) + 88 88 items record_some_lazy!(self.tables.def_keys[def_id] <- def_key) + 88 88 items record_some_lazy!(self.tables.def_span[def_id] <- def_span) + 53 53 items record_some_lazy!(self.tables.explicit_clauses_of[def_id] <- self.tcx.explicit_clauses_of(def_id)) + 23 23 items record_some_lazy!(self.tables.expn_that_defined[def_id] <- self.tcx.expn_that_defined(def_id)) + 15 15 items record_some_lazy!(self.tables.fn_sig[def_id] <- tcx.fn_sig(def_id)) + 53 53 items record_some_lazy!(self.tables.generics_of[def_id] <- g) + 16 16 items record_some_lazy!(self.tables.impl_trait_header[def_id] <- header) + 4 4 items record_some_lazy!(self.tables.mir_const_qualif[def_id.to_def_id()] <- qualifs) + 2 2 items record_some_lazy!(self.tables.object_lifetime_default[def_id] <- default) + 1 1 items record_some_lazy!(self.tables.opaque_ty_origin[def_id] <- self.tcx.opaque_ty_origin(def_id)) + 11 11 items record_some_lazy!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id)) + 2 2 items record_some_lazy!(self.tables.params_in_repr[def_id] <- params_in_repr) + 11 11 items record_some_lazy!(self.tables.promoted_mir[def_id.to_def_id()] <- tcx.promoted_mir(def_id)) + 4 4 items record_some_lazy!(self.tables.rendered_const[def_id.to_def_id()] <- const_data) + 2 2 items record_some_lazy!(self.tables.repr_options[def_id] <- adt_def.repr()) + 4 4 items record_some_lazy!(self.tables.trivial_const[def_id.to_def_id()] <- (val, ty)) + 51 51 items record_some_lazy!(self.tables.type_of[def_id] <- self.tcx.type_of(def_id)) + 4 4 items record_some_lazy!(self.tables.variant_data[variant.def_id] <- data) + 28 28 items record_some_lazy!(self.tables.visibility[def_id] <- vis) + 15 15 items record_value!(self.tables.asyncness[def_id] <- asyncness) + 58 58 items record_value!(self.tables.attr_flags[def_id.to_def_id()] <- attr_flags) + 20 20 items record_value!(self.tables.constness[def_id] <- constness) + 11 11 items record_value!(self.tables.cross_crate_inlinable[def_id.to_def_id()] <- self.tcx.cross_crate_inlinable(def_id)) + 88 88 items record_value!(self.tables.def_path_hashes[def_id] <- def_path_hash.local_hash().as_u64()) + 11 11 items record_value!(self.tables.defaultness[def_id] <- item.defaultness(tcx)) + 16 16 items record_value!(self.tables.defaultness[def_id] <- tcx.defaultness(def_id)) + 16 16 items record_value!(self.tables.impl_is_fully_generic_for_reflection[def_id] <- impl_is_fully_generic_for_reflection) + 1 1 items record_value!(self.tables.safety[field.did] <- field.safety) + 1 1 items record_value!(self.tables.type_alias_is_checked[def_id] <- self.tcx.type_alias_is_checked(def_id)) + 854 0 items self.set(i, Some(value)) + 18 18 items syntax_contexts.set_some(index, this.lazy(ctxt_data)) +read through queries: reads, items, items whose query recorded a dependency on the crate, entries the writer wrote + 827 36 items 36 tracked adt_def + 28 23 items 23 tracked adt_destructor + 158 79 items 79 tracked anon_const_kind + 6674 978 items 978 tracked associated_item + 246 123 items 123 tracked associated_item_def_ids + 20 10 items 10 tracked associated_types_for_impl_traits_in_trait_or_impl + 4 4 items 4 tracked asyncness + 249 92 items 92 tracked attrs_for_def + 19 19 items 19 tracked canonical_symbols + 12 6 items 6 tracked closure_saved_names_of_captured_variables + 508 254 items 254 tracked codegen_fn_attrs + 60 30 items 30 tracked const_conditions + 103 103 items 103 tracked constness + 6 6 items 6 tracked coroutine_kind + 3 3 items 3 tracked crate_name + 193 193 items 193 tracked cross_crate_inlinable + 66 33 items 33 tracked def_ident_span + 705 705 items 705 tracked def_kind + 772 364 items 364 tracked def_span + 196 196 items 196 tracked defaultness + 35 19 items 19 tracked defined_lang_items + 7 7 items 7 tracked diagnostic_items + 842 300 items 300 tracked explicit_clauses_of + 98 51 items 51 tracked explicit_implied_clauses_of + 17 12 items 12 tracked explicit_implied_const_bounds + 2 1 items 1 tracked explicit_item_bounds + 4 2 items 2 tracked explicit_item_self_bounds + 15 9 items 9 tracked explicit_super_clauses_of + 56 24 items 24 tracked expn_that_defined + 2 2 items 2 tracked exportable_items + 20 18 items 18 tracked exported_generic_symbols + 2 2 items 2 tracked exported_non_generic_symbols + 19 19 items 19 tracked externally_implementable_items + 520 260 items 260 tracked fn_sig + 1150 575 items 575 tracked generics_of + 45 45 items 45 tracked impl_parent + 296 148 items 148 tracked impl_trait_header + 202 202 items 202 tracked implementations_of_trait + 302 300 items 300 tracked inferred_outlives_of + 20 10 items 10 tracked inherent_impls + 127 118 items 118 tracked intrinsic_raw + 2 2 items 2 tracked is_doc_hidden + 58 58 items 58 tracked is_mir_available + 17 17 items 17 tracked lookup_default_body_stability + 52 52 items 52 tracked lookup_deprecation_entry + 138 69 items 69 tracked lookup_stability + 210 93 items 93 tracked mir_for_ctfe + 19 19 items 19 tracked missing_lang_items + 6392 56 items 56 tracked module_children + 23 19 items 19 tracked native_libraries + 8 4 items 4 tracked object_lifetime_default + 390 57 items 57 tracked optimized_mir + 4 2 items 2 tracked params_in_repr + 2 1 items 1 tracked promoted_mir + 642 2 items 2 tracked reachable_non_generics + 2 2 items 2 tracked stable_order_of_exportable_impls + 114 55 items 55 tracked trait_def + 105 92 items 92 tracked trivial_const + 1 1 items 1 tracked type_alias_is_checked + 914 457 items 457 tracked type_of + 76 38 items 38 tracked variances_of + 420 210 items 210 tracked visibility + 3 0 items 0 tracked ? crate_incoherent_impls + 94 3 items 3 tracked wide_core adt_def + 3 3 items 3 tracked wide_core adt_destructor + 2 1 items 1 tracked 1 written wide_core args_known_to_outlive_alias_params + 69 13 items 13 tracked wide_core associated_item + 12 6 items 6 tracked wide_core associated_item_def_ids + 2 1 items 1 tracked 1 written wide_core associated_types_for_impl_traits_in_trait_or_impl + 28 13 items 13 tracked wide_core attrs_for_def + 1 1 items 1 tracked wide_core canonical_symbols + 16 8 items 8 tracked 8 written wide_core codegen_fn_attrs + 4 2 items 2 tracked 2 written wide_core const_of_item + 8 8 items 8 tracked 8 written wide_core constness + 1 1 items 1 tracked wide_core crate_name + 5 5 items 5 tracked 4 written wide_core cross_crate_inlinable + 18 9 items 9 tracked 9 written wide_core def_ident_span + 33 33 items 33 tracked 33 written wide_core def_kind + 24 12 items 12 tracked 12 written wide_core def_span + 13 13 items 13 tracked 13 written wide_core defaultness + 1 1 items 1 tracked wide_core defined_lang_items + 1 1 items 1 tracked wide_core diagnostic_items + 54 27 items 27 tracked 27 written wide_core explicit_clauses_of + 6 3 items 3 tracked 3 written wide_core explicit_implied_clauses_of + 2 1 items 1 tracked 1 written wide_core explicit_item_bounds + 8 1 items 1 tracked 1 written wide_core explicit_item_self_bounds + 16 6 items 6 tracked 6 written wide_core expn_that_defined + 1 1 items 1 tracked wide_core exportable_items + 1 1 items 1 tracked wide_core exported_generic_symbols + 1 1 items 1 tracked wide_core exported_non_generic_symbols + 1 1 items 1 tracked wide_core externally_implementable_items + 18 9 items 9 tracked 9 written wide_core fn_sig + 58 29 items 29 tracked 29 written wide_core generics_of + 2 2 items 2 tracked wide_core impl_parent + 12 6 items 6 tracked 6 written wide_core impl_trait_header + 13 13 items 13 tracked wide_core implementations_of_trait + 27 27 items 27 tracked 27 written wide_core inferred_outlives_of + 4 2 items 2 tracked 1 written wide_core inherent_impls + 6 6 items 6 tracked wide_core intrinsic_raw + 3 3 items 3 tracked wide_core is_doc_hidden + 4 4 items 4 tracked wide_core is_mir_available + 24 24 items 24 tracked wide_core lookup_deprecation_entry + 14 14 items 14 tracked wide_core lookup_stability + 4 2 items 2 tracked 2 written wide_core mir_for_ctfe + 1 1 items 1 tracked wide_core missing_lang_items + 199 5 items 5 tracked wide_core module_children + 1 1 items 1 tracked wide_core native_libraries + 14 4 items 4 tracked 4 written wide_core optimized_mir + 2 1 items 1 tracked 1 written wide_core promoted_mir + 4 1 items 1 tracked wide_core reachable_non_generics + 1 1 items 1 tracked wide_core stable_order_of_exportable_impls + 6 3 items 3 tracked 3 written wide_core trait_def + 3 3 items 3 tracked 0 written wide_core trivial_const + 60 30 items 30 tracked 30 written wide_core type_of + 10 5 items 5 tracked 5 written wide_core variances_of + 42 21 items 21 tracked 21 written wide_core visibility + 1 1 items 1 tracked wide_derive canonical_symbols + 1 1 items 1 tracked wide_derive crate_name + 1 1 items 1 tracked wide_derive defined_lang_items + 1 1 items 1 tracked wide_derive diagnostic_items + 1 1 items 1 tracked wide_derive exported_generic_symbols + 1 1 items 1 tracked wide_derive externally_implementable_items + 2 2 items 2 tracked wide_derive lookup_deprecation_entry + 3 3 items 3 tracked wide_derive lookup_stability + 15 1 items 1 tracked wide_derive module_children + 1 1 items 1 tracked wide_derive native_libraries + 2 1 items 1 tracked 1 written wide_derive visibility +read outside a query + 289 CrateMetadata::def_kind in - + 53513 CrateMetadata::def_path_hash in - + 174 CrateMetadata::get_expn_that_defined in - + 26 CrateMetadata::get_item_attrs in - + 33 CrateMetadata::get_macro in - + 2976 CrateMetadata::get_span in - + 22 CrateMetadata::opt_item_ident in - + 4 CrateMetadata::raw_proc_macro in - + 20 CrateRoot>::decode_denied_partial_mitigations in - + 20 CrateRoot>::decode_target_modifiers in - + 12 MetadataBlob::check_compatibility in - + 18 MetadataBlob::get_header in - + 6 MetadataBlob::get_root in - + 124 decode_expn_id::{closure#0} in - + 34 decode_syntax_context::{closure#0} in - + 490 def_key::{closure#0} in - + 62 get_ambig_module_children::{closure#0} in - + 62 imported_source_file::{closure#2} in - + 84 CrateMetadata::new in CStore::register_crate + 20 CrateRoot>::decode_crate_deps in CStore::register_crate + 18 MetadataBlob::check_compatibility in CStore::register_crate + 36 MetadataBlob::get_header in CStore::register_crate + 39 MetadataBlob::get_root in CStore::register_crate + 41 MetadataBlob::get_root_unhashed in CStore::register_crate + 43 new::{closure#1} in CStore::register_crate + 12229 CrateMetadata::def_path_hash in encoder::encode_metadata + 290 def_key::{closure#0} in encoder::encode_metadata + From a37d32a301fccbd6d37f7efc6f4691bea1be211e Mon Sep 17 00:00:00 2001 From: Zack Maril Date: Wed, 7 Oct 2026 06:47:11 +0000 Subject: [PATCH 2/2] Root-cause both incremental metadata bugs; draft their reports Finding 1: HashMap's Encodable writes iteration order and Decodable collects in that order, so Generics::param_def_id_to_index rotates every time generics_of goes through the incremental cache when its keys collide. A standalone program with std HashMap and rustc-hash reproduces rustc's sequence exactly. Four real crates show it; FxIndexMap fixes all four. Finding 2 was not hygiene data. String literals share an AllocId through allocate_bytes_dedup, but decoding a memory allocation from the cache always reserves a fresh one, so a rebuild encodes the literal twice. Reduced to two lines; regression from #116707, bisected between nightly-2025-07-24 and nightly-2025-07-26. docs/hunt/issue-*.md are draft reports. Each fix has a run-make style test that fails before it and passes after, and with both fixes P6 holds for all ten single-threaded edits while rustc's incremental, metadata UI and run-make, consts/statics/const-generics UI and codegen-llvm tests pass. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018Mnrg9JXj9X1ht6Qkz2ybh --- docs/hunt.md | 126 ++++++++--------- docs/hunt/alloc-dedup-on-decode.patch | 19 +++ docs/hunt/hashmap-roundtrip/Cargo.toml | 8 ++ docs/hunt/hashmap-roundtrip/src/main.rs | 60 ++++++++ docs/hunt/issue-generics-order.md | 129 ++++++++++++++++++ docs/hunt/issue-literal-dedup.md | 128 +++++++++++++++++ docs/hunt/p6-expansions/core-after.rs | 58 -------- docs/hunt/p6-expansions/core-before.rs | 56 -------- docs/hunt/p6-expansions/derive.rs | 36 ----- docs/hunt/p6-expansions/user-after.rs | 17 --- docs/hunt/p6-expansions/user-before.rs | 16 --- docs/hunt/p6-literals/after.rs | 2 + docs/hunt/p6-literals/before.rs | 2 + docs/hunt/repro.sh | 24 ++-- .../incr-metadata-generics-order/rmake.rs | 48 +++++++ .../incr-metadata-literal-dedup/rmake.rs | 43 ++++++ 16 files changed, 507 insertions(+), 265 deletions(-) create mode 100644 docs/hunt/alloc-dedup-on-decode.patch create mode 100644 docs/hunt/hashmap-roundtrip/Cargo.toml create mode 100644 docs/hunt/hashmap-roundtrip/src/main.rs create mode 100644 docs/hunt/issue-generics-order.md create mode 100644 docs/hunt/issue-literal-dedup.md delete mode 100644 docs/hunt/p6-expansions/core-after.rs delete mode 100644 docs/hunt/p6-expansions/core-before.rs delete mode 100644 docs/hunt/p6-expansions/derive.rs delete mode 100644 docs/hunt/p6-expansions/user-after.rs delete mode 100644 docs/hunt/p6-expansions/user-before.rs create mode 100644 docs/hunt/p6-literals/after.rs create mode 100644 docs/hunt/p6-literals/before.rs create mode 100644 docs/hunt/tests/incr-metadata-generics-order/rmake.rs create mode 100644 docs/hunt/tests/incr-metadata-literal-dedup/rmake.rs diff --git a/docs/hunt.md b/docs/hunt.md index 89f0b8d..20b656a 100644 --- a/docs/hunt.md +++ b/docs/hunt.md @@ -24,76 +24,71 @@ with `-Zthreads=8`. `rustc/check.sh wide` runs the ordinary checks. | | what | status | |---|---|---| -| 1 | single-threaded incremental rebuilds encode `Generics::param_def_id_to_index` in a different order from clean builds | **looks new**; reduced to 2 lines; a one-line change fixes it | -| 2 | single-threaded incremental rebuilds of a crate using a proc-macro derive encode hygiene data that clean builds do not | **looks new**; reduced, not root-caused | +| 1 | incremental rebuilds encode `Generics::param_def_id_to_index` in a different order from clean builds | **looks new**; root cause found; fix and regression test written | +| 2 | incremental rebuilds encode a string literal twice where clean builds encode it once | **looks new**; root cause found, regression from #116707 (1.90); fix and regression test written | | 3 | with `-Zthreads=8`, two traits with `-> impl Trait` methods give different metadata from run to run | known: [#162202](https://github.com/rust-lang/rust/issues/162202) | -All three reproduce with the official `nightly-2026-10-06`, without mirth: -`docs/hunt/repro.sh` runs them. None of them was searched for; P5 and P6 -reported them on the first run of the new fixture. +Findings 1 and 2 are single-threaded: an ordinary `cargo build`, an edit, another +`cargo build`, and the metadata differs from a clean build of the edited source. Both come +from the same kind of mistake: a value that does not survive a round trip through the +incremental cache unchanged. All three reproduce with the official `nightly-2026-10-06`, +without mirth: `docs/hunt/repro.sh` runs them. None was searched for: P5 and P6 reported +them on the first run of the new fixture. -Everything else held: P1, P2, P4 and P7 on the recorded clean build; the -touch-only rebuild reused every crate's metadata; and -`-Zincremental-verify-ich` found no unstable fingerprint in 20 incremental -rebuilds. +Draft bug reports for 1 and 2, written to be filed upstream, are +[`hunt/issue-generics-order.md`](hunt/issue-generics-order.md) and +[`hunt/issue-literal-dedup.md`](hunt/issue-literal-dedup.md). Each has a candidate fix +(`hunt/*.patch`) and a regression test in the style of rustc's `tests/run-make` +(`hunt/tests/`), which fails on the pinned compiler and passes with the fix. -### 1. `param_def_id_to_index` order after an incremental rebuild +With both fixes applied, P6 holds for all ten edits single-threaded, and these rustc tests +still pass: `tests/incremental`, the metadata-related UI and run-make tests, +`tests/ui/{consts,statics,const-generics}` and `tests/codegen-llvm`. + +Everything else held: P1, P2, P4 and P7 on the recorded clean build; the touch-only +rebuild reused every crate's metadata; and `-Zincremental-verify-ich` found no unstable +fingerprint in 20 incremental rebuilds. + +### 1. `param_def_id_to_index` order ```rust pub struct Grid(A, B, C); impl Grid { pub const AREA: usize = 1; } ``` -Build this with `-C incremental`, add a comment line at the top, build -again, and compare the `.rmeta` with a clean build of the same source: they -differ. Two clean builds agree, and so do an incremental rebuild with no -change and a clean build. - -Apart from the 16-byte hash in the header, only a few bytes differ, and they -are the same `(DefIndex, u32)` pairs in a different order: -`Generics::param_def_id_to_index`, an `FxHashMap` that -`TyEncodable` writes in iteration order. In the incremental session the -`generics_of` result is loaded from the incremental cache. The likely -mechanism, not verified: decoding builds the map by inserting in the -encoded order, and with colliding hashes that gives a different layout, -and so a different order, from the map rustc built in the first place. That fits -what the reduction showed: whether it reproduces depends on unrelated items -in the crate, which change the `DefId`s, and so the hashes. - -The same field is the cause given in -[#163878](https://github.com/rust-lang/rust/issues/163878), which reports -it under `-Zthreads`. This is the same field with no threads at all, in an -ordinary `cargo build` after an edit. It matters more than it might look: -since [#154724](https://github.com/rust-lang/rust/pull/154724) the crate -hash is computed from the metadata bytes, so an incremental build and a -clean build of the same source get different crate hashes, and every -dependent is rebuilt. - -`docs/hunt/generics-index-map.patch` changes the field to an `FxIndexMap`, -which keeps insertion order through encoding and decoding. With it, the -reduced case and nine of the ten edits give identical bytes. The -single-threaded edit that still fails is finding 2. - -### 2. Hygiene data after an incremental rebuild - -With finding 1 fixed, adding a variant to an enum in `wide_core` and the -matching arm in `wide_user` still gives `wide_user` different metadata from -a clean build. The incremental one is 16 bytes longer. -`docs/hunt/p6-expansions` has it reduced to two crates and the derive: -about 60 lines of the library and 17 of the dependent. - -What mirth's record shows, comparing the incremental process with the -clean one: the same tables are written, but only the incremental one, while -encoding, resolves foreign expansions (`expn_hash_to_expn_id`) and reads -foreign source files (`imported_source_file`, 150 times). So the -incremental session's metadata carries expansion and span data that the -clean session's does not. It needs the derive from the proc-macro crate: -without `#[derive(Named)]` it goes away. But so does removing the built-in -derives beside it, and, as with finding 1, removing unrelated items. - -Syntax contexts restored from the incremental cache are the place to look, -near [#161450](https://github.com/rust-lang/rust/pull/161450), which -changed how syntax contexts are encoded. This was not taken further. +`Generics::param_def_id_to_index` is an `FxHashMap`. `HashMap`'s `Encodable` writes it in +iteration order, and `Decodable` collects it back in that order. In this example all three +keys hash to the same home bucket of a 4-bucket table, so iteration order is insertion order +rotated by one. Each time `generics_of` goes through the incremental cache, the map is +rotated again, and the metadata encoder writes it in the rotated order. The encoded order +cycles with period 3 over successive incremental rebuilds, which is exactly what a +standalone program with `std` `HashMap` and `rustc_hash` 2.1.1 predicts. + +Adding a comment to the top of `lib.rs` changes the metadata of an incremental rebuild +relative to a clean one for `either`, `smallvec`, `memchr` and `arrayvec`, and making the +field an `FxIndexMap` removes the difference in all four. The same field is the cause given +in [#163878](https://github.com/rust-lang/rust/issues/163878) under `-Zthreads`. + +### 2. String literals encoded twice + +```rust +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { "literal" } // then edited to `{ let s = "literal"; s }` +``` + +String literals get their `AllocId` from `allocate_bytes_dedup`, so both bodies share one, +and a clean build encodes the allocation once. In the rebuild, `a`'s MIR comes from the +incremental cache, and decoding a memory allocation always reserves a fresh `AllocId` +(`reserve_and_set_memory_alloc`). The metadata then encodes two allocations with identical +bytes. It started with [#116707](https://github.com/rust-lang/rust/pull/116707), which gave +`ConstValue::Slice` an `AllocId`: `nightly-2025-07-24` is not affected, `nightly-2025-07-26` +is. No effect on generated code was found. + +In the fixture, the two literals were the type name in `#[derive(Debug)]`'s `fmt` (which is +`#[inline]`, so its MIR is encoded) and the same name in a `const` from the fixture's own +derive. That is why removing either derive made it disappear. The first write-up of this +finding blamed hygiene data, because the rebuild resolved foreign expansions while encoding; +that was a side effect of decoding cached MIR, not the cause. ### 3. `impl Trait` in traits under `-Zthreads` @@ -111,9 +106,8 @@ traits, so P5 under `-Zthreads=8` fails on `wide` every time, and on ## Not done -- Neither new finding has been reported upstream. Before filing them, - check for duplicates again; #163878 especially is moving. -- Finding 2 is not root-caused. -- `fixtures/wide` fails `check.sh` (P5 under `-Zthreads=8`, finding 3) and - P6 for most edits (findings 1 and 2) until those are fixed. Its lists are - blessed against the unmodified compiler. +- Neither new finding has been reported upstream. The drafts are ready; check #163878 again + before filing the first, since it touches the same field. +- `fixtures/wide` fails `check.sh` (P5 under `-Zthreads=8`, finding 3) and P6 for most + edits (findings 1 and 2) until those are fixed. Its lists are blessed against the + unmodified compiler. diff --git a/docs/hunt/alloc-dedup-on-decode.patch b/docs/hunt/alloc-dedup-on-decode.patch new file mode 100644 index 0000000..8959c8a --- /dev/null +++ b/docs/hunt/alloc-dedup-on-decode.patch @@ -0,0 +1,19 @@ +--- a/compiler/rustc_middle/src/mir/interpret/mod.rs ++++ b/compiler/rustc_middle/src/mir/interpret/mod.rs +@@ -214,7 +214,15 @@ + trace!("creating memory alloc ID"); + let alloc = as Decodable<_>>::decode(decoder); + trace!("decoded alloc {:?}", alloc); +- decoder.interner().reserve_and_set_memory_alloc(alloc) ++ // Immutable memory is deduplicated when it is created (string literals, for ++ // instance), so deduplicate it here too. Otherwise one allocation decoded ++ // from the incremental cache and the same one created afresh get two ++ // `AllocId`s, and metadata depends on which results came from the cache. ++ if alloc.inner().mutability.is_not() { ++ decoder.interner().reserve_and_set_memory_dedup(alloc, CTFE_ALLOC_SALT) ++ } else { ++ decoder.interner().reserve_and_set_memory_alloc(alloc) ++ } + } + AllocDiscriminant::Fn => { + trace!("creating fn alloc ID"); diff --git a/docs/hunt/hashmap-roundtrip/Cargo.toml b/docs/hunt/hashmap-roundtrip/Cargo.toml new file mode 100644 index 0000000..7d12244 --- /dev/null +++ b/docs/hunt/hashmap-roundtrip/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "hashmap-roundtrip" +version = "0.0.0" +edition = "2024" +[dependencies] +rustc-hash = "=2.1.1" diff --git a/docs/hunt/hashmap-roundtrip/src/main.rs b/docs/hunt/hashmap-roundtrip/src/main.rs new file mode 100644 index 0000000..a53e4d0 --- /dev/null +++ b/docs/hunt/hashmap-roundtrip/src/main.rs @@ -0,0 +1,60 @@ +// What rustc does with Generics::param_def_id_to_index across sessions. +use rustc_hash::FxHashMap; + +// DefId's Hash impl on 64-bit targets: (krate << 32) | index, as one u64. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +struct DefId { + index: u32, + krate: u32, +} +impl std::hash::Hash for DefId { + fn hash(&self, h: &mut H) { + (((self.krate as u64) << 32) | self.index as u64).hash(h) + } +} + +fn order(m: &FxHashMap) -> Vec<(u32, u32)> { + m.iter().map(|(k, v)| (k.index, *v)).collect() +} + +fn main() { + if std::env::args().nth(1).as_deref() == Some("buckets") { + return buckets(); + } + let first: Vec = std::env::args() + .skip(1) + .map(|a| a.parse().unwrap()) + .collect(); + // generics_of: own_params.iter().map(|p| (p.def_id, p.index)).collect() + let built: FxHashMap = first + .iter() + .enumerate() + .map(|(i, &d)| (DefId { index: d, krate: 0 }, i as u32)) + .collect(); + println!("clean session, built and encoded: {:?}", order(&built)); + // Encodable writes iteration order; Decodable collects in that order. + let mut map = built; + for session in 2..=4 { + let decoded: FxHashMap = order(&map) + .into_iter() + .map(|(d, i)| (DefId { index: d, krate: 0 }, i)) + .collect(); + println!( + "session {session}, decoded from the cache: {:?}", + order(&decoded) + ); + map = decoded; + } +} + +#[allow(dead_code)] +pub fn buckets() { + use std::hash::BuildHasher; + for i in [12u32, 13, 14] { + let h = rustc_hash::FxBuildHasher.hash_one(DefId { index: i, krate: 0 }); + println!( + "DefIndex {i}: hash {h:#018x}, bucket in a 4-bucket table {}", + h & 3 + ); + } +} diff --git a/docs/hunt/issue-generics-order.md b/docs/hunt/issue-generics-order.md new file mode 100644 index 0000000..4ed51b3 --- /dev/null +++ b/docs/hunt/issue-generics-order.md @@ -0,0 +1,129 @@ +# Incremental rebuilds encode `generics_of` with `param_def_id_to_index` in a different order from clean builds + + + +An incremental rebuild produces different `.rmeta` bytes from a clean build of the same +source, single-threaded. The cause is that `Generics::param_def_id_to_index`, an +`FxHashMap`, does not survive a round trip through the incremental cache in the same order. + +### Reproduction + +```rust +// lib.rs +pub struct Grid(A, B, C); +impl Grid { pub const AREA: usize = 1; } +``` + +```sh +rustc --edition 2024 --crate-type lib --emit=metadata -C incremental=incr lib.rs -o first.rmeta +sed -i '1i // a comment' lib.rs +rustc --edition 2024 --crate-type lib --emit=metadata -C incremental=incr lib.rs -o rebuilt.rmeta +rustc --edition 2024 --crate-type lib --emit=metadata -C incremental=clean lib.rs -o clean.rmeta +cmp rebuilt.rmeta clean.rmeta # differ +``` + +I expected `rebuilt.rmeta` and `clean.rmeta` to be identical: the same source, the same +compiler, the same flags. Instead they differ in 21 bytes: the 16-byte hash in the header +and the order of three `(DefIndex, u32)` pairs. + +It is not specific to this example. A comment added at the top of `lib.rs` gives an +incremental rebuild different metadata from a clean build for +[`either`](https://crates.io/crates/either) 1.13.0, `smallvec` 1.13.2, `memchr` 2.7.4 and +`arrayvec` 0.7.6. With the change suggested below, all four match. + +### Root cause + +`generics_of` is `cache_on_disk`. `Generics::param_def_id_to_index` is an +`FxHashMap`, and the `Encodable` impl for `HashMap` writes entries in iteration +order. `Decodable` collects them back in that order: + +- In the first session the map is built by + `own_params.iter().map(|param| (param.def_id, param.index)).collect()`, inserting in + parameter order, then written to the incremental cache in its iteration order. +- In the next session `generics_of` is green and decoded from the cache, so the map is + rebuilt by inserting in the first map's iteration order. + +Iteration order of a hashbrown table is bucket order, and which bucket a key lands in +depends on insertion order when keys collide. In the example all three keys hash to +the same home bucket of a 4-bucket table (FxHash of `DefId`s 12, 13 and 14, as +`(krate << 32) | index`). The first key inserted takes bucket 3 and the others wrap to +buckets 0 and 1, so iteration order is the insertion order rotated by one. Decoding inserts +in that rotated order and rotates it again. The metadata encoder then writes the decoded +map in its own iteration order: + +| session | encoded order (`DefIndex` → index) | +|---|---| +| clean build | 13→1, 14→2, 12→0 | +| incremental rebuild 1 | 14→2, 12→0, 13→1 | +| incremental rebuild 2 | 12→0, 13→1, 14→2 | +| incremental rebuild 3 | 13→1, 14→2, 12→0 (matches the clean build again) | + +The table is from the `.rmeta` files rustc wrote (from byte 1355, after `03` +for the length; each entry is `CrateNum`, `DefIndex`, index). A standalone program using `std::collections::HashMap` with +`rustc_hash::FxBuildHasher` 2.1.1, building and round-tripping the map the same way, prints +exactly the same sequence (attached as `hashmap-roundtrip`; `cargo run -- 12 13 14`). + +That is also why the reproduction is sensitive to unrelated items: adding or removing +items changes the `DefIndex`es, and so whether keys collide. Two colliding keys swap on +every round trip; keys that don't collide are stable. + +### Impact + +- An incremental rebuild's `.rmeta`, and the crate hash computed from it (#154724), depend + on how many times each `generics_of` result has been round-tripped through the cache, not + only on the source. So does the `.rlib` that embeds it, and the metadata of every crate + that depends on it, since those record the crate hash. +- I found no effect on generated code or diagnostics: the map is only used for lookups. +- It hides other incremental bugs from anyone comparing incremental and clean outputs. I + found it while doing that, and it masked a second issue (#…). + +### Suggested fix + +Keep the map's order deterministic across encoding and decoding. Making the field an +`FxIndexMap` does that: an `IndexMap` iterates in insertion order, and decoding +inserts in the encoded order, so a round trip is the identity. It is a two-line change +(`compiler/rustc_middle/src/ty/generics.rs`), and every construction site uses `.collect()` +and every use is `get` or indexing. Another option is not to encode the map at all and +rebuild it from `own_params` when decoding. + +With the `FxIndexMap` change, the reproduction, the four crates above, and nine of ten edits +to a larger test fixture give identical metadata after an incremental rebuild. (The tenth is +the other issue, #….) With this change and the one suggested there applied together, +`tests/incremental` (180), the metadata-related UI +(532) and run-make (46) tests, `tests/ui/{consts,statics,const-generics}` (1844) and +`tests/codegen-llvm` (1122) still pass; the full test suite was not run. The `Generics` +struct is the only one I found that derives `TyEncodable`/`Encodable`, reaches metadata and +has a `HashMap` field; the others with such fields (`TypeckResults::used_trait_imports`, +`CrateInfo`, the on-disk cache footer) do not reach `.rmeta`. + +#163878 reports the same field as a source of non-reproducibility under `-Zthreads`. The +change here would fix the single-threaded case. Whether it also fixes the parallel one depends +on whether those builds differ only in this map's order. The suggested change was not tested +against #163878's reproduction. + +A regression test in the style of `tests/run-make` is attached +(`incr-metadata-generics-order/rmake.rs`). It fails on the current nightly and passes with +the change. It tries the example after +0 to 7 unrelated items, since collisions depend on the `DefIndex`es. + +### How it was found + +[mirth](https://github.com/PowderworksCode/mirth) checks properties of rustc's metadata +handling across Cargo builds. One property is that an incremental rebuild after an edit +encodes the same metadata as a clean build of the edited source. + +### Meta + +`rustc --version --verbose`: +``` +rustc 1.101.0-nightly (ea137335b 2026-10-05) +binary: rustc +commit-hash: ea137335b78829b4514bf1b4c16302f74fab8581 +host: x86_64-unknown-linux-gnu +``` + +The example also reproduces with 1.95.0 and 1.98.1, where only the 6 bytes of the +reordered pairs differ (those releases do not yet derive the header hash from the +metadata). Releases 1.78 to 1.82 show much larger +differences between incremental and clean metadata for this example, from some other cause, +so I could not tell when this one started. diff --git a/docs/hunt/issue-literal-dedup.md b/docs/hunt/issue-literal-dedup.md new file mode 100644 index 0000000..d4716a4 --- /dev/null +++ b/docs/hunt/issue-literal-dedup.md @@ -0,0 +1,128 @@ +# Incremental rebuilds encode a string literal twice in metadata where a clean build encodes it once + + + +After an incremental rebuild, a crate's `.rmeta` can contain two copies of the same +string-literal allocation where a clean build of the same source has one. The copy decoded +from the incremental cache gets its own `AllocId` instead of being deduplicated with the one +built afresh. + +### Reproduction + +```rust +// before.rs +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { "literal" } +``` + +```rust +// after.rs: only b's body changes +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { let s = "literal"; s } +``` + +```sh +mkdir rebuilt clean +cp before.rs lib.rs +rustc --edition 2024 --crate-type lib --emit=metadata,link -C incremental=incr --out-dir rebuilt lib.rs +cp after.rs lib.rs +rustc --edition 2024 --crate-type lib --emit=metadata,link -C incremental=incr --out-dir rebuilt lib.rs +rustc --edition 2024 --crate-type lib --emit=metadata,link -C incremental=clean --out-dir clean lib.rs +cmp rebuilt/liblib.rmeta clean/liblib.rmeta # differ +grep -c -a -o literal rebuilt/liblib.rmeta # 2 +grep -c -a -o literal clean/liblib.rmeta # 1 +``` + +I expected the two `.rmeta` files to be identical. Instead the rebuilt one is 16 bytes longer: +it encodes the allocation for `"literal"` twice. (`--emit=link` is needed only because +MIR is encoded only when the crate is also code-generated, as in `cargo build`.) + +### Root cause + +String literals are allocated with `TyCtxt::allocate_bytes_dedup(bytes, CTFE_ALLOC_SALT)` +(`rustc_mir_build/src/builder/expr/as_constant.rs`), so in one session every `"literal"` +in MIR shares one `AllocId`. The metadata encoder collects allocations by `AllocId` +(`EncodeContext::interpret_allocs`, an `FxIndexSet`), so a clean build encodes it +once. + +Allocations decoded from the incremental cache, or from metadata, are not deduplicated. +`AllocDecodingSession::decode_alloc_id` (`rustc_middle/src/mir/interpret/mod.rs`) handles +`AllocDiscriminant::Alloc` with `reserve_and_set_memory_alloc`, which always reserves a fresh +`AllocId`. Its neighbours `Fn` and `VTable` go through the deduplicating +`reserve_and_set_fn_alloc` and `reserve_and_set_vtable_alloc` with `CTFE_ALLOC_SALT`. + +In the rebuild, `b` changed, so `optimized_mir(b)` is computed again and its literal gets the +deduplicated `AllocId`. `a` did not change, so `optimized_mir(a)` is decoded from the cache, +and its literal gets a fresh one. The metadata then has two allocations with identical bytes. + +It started with #116707 ("Create an `AllocId` for `ConstValue::Slice`", merged +2025-07-24, in 1.90): `nightly-2025-07-24` (`ace633090`) is not affected, and +`nightly-2025-07-26` (`430d6eddf`) is. Before that change a slice constant carried its +bytes inline, so each use was encoded separately, the same way in both builds: 1.89.0 +has three copies of `"literal"` in both. From 1.90.0 to the current nightly, the rebuild has +two and the clean build one. + +### Impact + +- An incremental rebuild's `.rmeta`, and the crate hash computed from it (#154724), depend on + which MIR bodies came from the cache. So does the metadata of crates that depend on it. +- It does not accumulate: alternating the two versions of `b` for six sessions keeps the + rebuilt metadata at two copies. +- I found no effect on generated code: a dependent comparing `a().as_ptr() == b().as_ptr()` + prints `true` either way, at `-C opt-level=0` and `3`, because codegen merges identical + constant data anyway. +- It reaches real builds through derives: `#[derive(Debug)]`'s `fmt` is `#[inline]` and + contains the type's name as a literal. Any other literal with the same text, such as a + `const NAME: &str = "Drawing"` produced by another derive, is encoded once in a clean build + and twice after an incremental rebuild that recompiled only one of them. That is how I first + saw it. + +### Suggested fix + +Decode immutable memory allocations the way they were created, deduplicated: + +```diff + AllocDiscriminant::Alloc => { + let alloc = as Decodable<_>>::decode(decoder); +- decoder.interner().reserve_and_set_memory_alloc(alloc) ++ if alloc.inner().mutability.is_not() { ++ decoder.interner().reserve_and_set_memory_dedup(alloc, CTFE_ALLOC_SALT) ++ } else { ++ decoder.interner().reserve_and_set_memory_alloc(alloc) ++ } + } +``` + +With it, together with the fix for #… (the other issue), the reproduction and all ten +single-threaded incremental edits to a larger test fixture give identical metadata. These all +still pass: `tests/incremental` (180), `tests/ui/{consts,statics,const-generics}` (1844), +`tests/codegen-llvm` (1122), and the 532 UI and 46 run-make tests about metadata and crate +loading that I run. The full test suite was not run. + +It does more than strictly needed: it would also merge an immutable allocation decoded from a +dependency's metadata with an identical local one, and two immutable allocations that were +distinct when created (results of different constants, say). As far as I know, neither has +a guaranteed unique address, but someone who knows the const-eval memory model should +confirm. A narrower fix records, when encoding, whether an allocation was created +through deduplication and with which salt, and repeats exactly that when decoding. + +A regression test in the style of `tests/run-make`, which fails before the change and passes +after, is attached (`incr-metadata-literal-dedup/rmake.rs`). + +### How it was found + +[mirth](https://github.com/PowderworksCode/mirth) checks properties of rustc's metadata +handling across Cargo builds. One property is that an incremental rebuild after an edit +encodes the same metadata as a clean build of the edited source. Comparing what the two +compiler processes did, the rebuild decoded cached MIR (resolving foreign expansions and +source files to do so), which led to the cached allocations. + +### Meta + +`rustc --version --verbose`: +``` +rustc 1.101.0-nightly (ea137335b 2026-10-05) +binary: rustc +commit-hash: ea137335b78829b4514bf1b4c16302f74fab8581 +host: x86_64-unknown-linux-gnu +``` diff --git a/docs/hunt/p6-expansions/core-after.rs b/docs/hunt/p6-expansions/core-after.rs deleted file mode 100644 index 0f195ab..0000000 --- a/docs/hunt/p6-expansions/core-after.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::fmt; -pub trait Named { - const NAME: &'static str; -} -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] -pub struct Point { - pub x: i32, - pub y: i32, -} -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum Shape { - Dot(Point), - Line { from: Point, to: Point }, - Poly(Vec), - Empty, -} -pub trait Windows { - type Window<'a> - where - Self: 'a; - fn window(&self, at: usize) -> Option>; -} -impl Windows for Vec { - type Window<'a> - = &'a [T] - where - T: 'a; - fn window(&self, at: usize) -> Option<&[T]> { - self.get(at..at + 2) - } -} -pub trait Render { - fn render(&self) -> impl fmt::Display + '_; -} -impl Render for Shape { - fn render(&self) -> impl fmt::Display + '_ { - match self { - Shape::Dot(p) => format!("dot {},{}", p.x, p.y), - Shape::Line { from, to } => format!("line {from:?} {to:?}"), - Shape::Poly(points) => format!("poly of {}", points.len()), - Shape::Empty => String::new(), - } - } -} -#[macro_export] -macro_rules! poly { - ($(($x:expr, $y:expr)),* $(,)?) => { - }; -} -pub fn spread(points: I) -> i32 -where - I: IntoIterator, -{ - let (min, max) = points - .into_iter() - .fold((i32::MAX, i32::MIN), |(lo, hi), p| (lo.min(p.x), hi.max(p.x))); - max - min -} diff --git a/docs/hunt/p6-expansions/core-before.rs b/docs/hunt/p6-expansions/core-before.rs deleted file mode 100644 index 78c8af2..0000000 --- a/docs/hunt/p6-expansions/core-before.rs +++ /dev/null @@ -1,56 +0,0 @@ -use std::fmt; -pub trait Named { - const NAME: &'static str; -} -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] -pub struct Point { - pub x: i32, - pub y: i32, -} -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum Shape { - Dot(Point), - Line { from: Point, to: Point }, - Poly(Vec), -} -pub trait Windows { - type Window<'a> - where - Self: 'a; - fn window(&self, at: usize) -> Option>; -} -impl Windows for Vec { - type Window<'a> - = &'a [T] - where - T: 'a; - fn window(&self, at: usize) -> Option<&[T]> { - self.get(at..at + 2) - } -} -pub trait Render { - fn render(&self) -> impl fmt::Display + '_; -} -impl Render for Shape { - fn render(&self) -> impl fmt::Display + '_ { - match self { - Shape::Dot(p) => format!("dot {},{}", p.x, p.y), - Shape::Line { from, to } => format!("line {from:?} {to:?}"), - Shape::Poly(points) => format!("poly of {}", points.len()), - } - } -} -#[macro_export] -macro_rules! poly { - ($(($x:expr, $y:expr)),* $(,)?) => { - }; -} -pub fn spread(points: I) -> i32 -where - I: IntoIterator, -{ - let (min, max) = points - .into_iter() - .fold((i32::MAX, i32::MIN), |(lo, hi), p| (lo.min(p.x), hi.max(p.x))); - max - min -} diff --git a/docs/hunt/p6-expansions/derive.rs b/docs/hunt/p6-expansions/derive.rs deleted file mode 100644 index 8e645c5..0000000 --- a/docs/hunt/p6-expansions/derive.rs +++ /dev/null @@ -1,36 +0,0 @@ -//! A derive with no dependencies: `#[derive(Named)]` gives a type a `NAME` -//! constant and a `name` method, through a trait in `wide-core`. - -use proc_macro::{TokenStream, TokenTree}; - -#[proc_macro_derive(Named, attributes(named))] -pub fn derive_named(input: TokenStream) -> TokenStream { - let mut tokens = input.into_iter(); - let mut name = None; - while let Some(token) = tokens.next() { - if let TokenTree::Ident(ident) = &token { - let word = ident.to_string(); - if word == "struct" || word == "enum" { - name = tokens.next().map(|token| token.to_string()); - break; - } - } - } - let name = name.expect("a struct or an enum"); - format!( - "impl ::wide_core::Named for {name} {{ const NAME: &'static str = \"{name}\"; }}" - ) - .parse() - .unwrap() -} - -/// An attribute macro that wraps a function's body in a call counter. -#[proc_macro_attribute] -pub fn counted(_attr: TokenStream, item: TokenStream) -> TokenStream { - let text = item.to_string(); - let brace = text.find('{').expect("a function body"); - let (head, body) = text.split_at(brace); - format!("{head} {{ ::wide_core::COUNT.fetch_add(1, ::std::sync::atomic::Ordering::Relaxed); {body} }}") - .parse() - .unwrap() -} diff --git a/docs/hunt/p6-expansions/user-after.rs b/docs/hunt/p6-expansions/user-after.rs deleted file mode 100644 index a3e9771..0000000 --- a/docs/hunt/p6-expansions/user-after.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use wide_core::{Point, Shape, poly}; -use wide_derive::{Named, counted}; -#[derive(Named, Debug, Clone, PartialEq)] -pub struct Drawing { - pub shapes: Vec, -} -pub fn each_point(drawing: &Drawing, mut f: impl FnMut(Point)) { - for shape in &drawing.shapes { - match shape { - Shape::Dot(p) => f(*p), - Shape::Line { from, to } => { - } - Shape::Poly(points) => points.iter().copied().for_each(&mut f), - Shape::Empty => {} - } - } -} diff --git a/docs/hunt/p6-expansions/user-before.rs b/docs/hunt/p6-expansions/user-before.rs deleted file mode 100644 index 44c9d40..0000000 --- a/docs/hunt/p6-expansions/user-before.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub use wide_core::{Point, Shape, poly}; -use wide_derive::{Named, counted}; -#[derive(Named, Debug, Clone, PartialEq)] -pub struct Drawing { - pub shapes: Vec, -} -pub fn each_point(drawing: &Drawing, mut f: impl FnMut(Point)) { - for shape in &drawing.shapes { - match shape { - Shape::Dot(p) => f(*p), - Shape::Line { from, to } => { - } - Shape::Poly(points) => points.iter().copied().for_each(&mut f), - } - } -} diff --git a/docs/hunt/p6-literals/after.rs b/docs/hunt/p6-literals/after.rs new file mode 100644 index 0000000..8c1e4c0 --- /dev/null +++ b/docs/hunt/p6-literals/after.rs @@ -0,0 +1,2 @@ +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { let s = "literal"; s } diff --git a/docs/hunt/p6-literals/before.rs b/docs/hunt/p6-literals/before.rs new file mode 100644 index 0000000..6a8f7a9 --- /dev/null +++ b/docs/hunt/p6-literals/before.rs @@ -0,0 +1,2 @@ +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { "literal" } diff --git a/docs/hunt/repro.sh b/docs/hunt/repro.sh index a2375fc..78de6e1 100755 --- a/docs/hunt/repro.sh +++ b/docs/hunt/repro.sh @@ -22,19 +22,11 @@ rc --crate-type lib --emit=metadata -Cincremental="$d/i1" "$d/lib.rs" -o "$d/inc rc --crate-type lib --emit=metadata -Cincremental="$d/i2" "$d/lib.rs" -o "$d/clean.rmeta" cmp -s "$d/inc.rmeta" "$d/clean.rmeta" && echo same || echo DIFFER -echo -n "p6-expansions, incremental rebuild of user after a new variant vs a clean build: " -x=$here/p6-expansions -mkdir -p "$d/pm" "$d/c1" "$d/c2" "$d/o1" "$d/o2" -rc --crate-type proc-macro --extern proc_macro --crate-name wide_derive "$x/derive.rs" --out-dir "$d/pm" -rc --crate-type lib --crate-name wide_core "$x/core-before.rs" --out-dir "$d/c1" -rc --crate-type lib --crate-name wide_core "$x/core-after.rs" --out-dir "$d/c2" -user() { - cp "$1" "$d/user.rs" - rc --crate-type lib --crate-name wide_user "$d/user.rs" --emit=dep-info,metadata,link \ - --extern wide_core="$2/libwide_core.rlib" --extern wide_derive="$d/pm/libwide_derive.so" \ - -Cincremental="$3" --out-dir "$4" -} -user "$x/user-before.rs" "$d/c1" "$d/i3" "$d/o1" -user "$x/user-after.rs" "$d/c2" "$d/i3" "$d/o1" -user "$x/user-after.rs" "$d/c2" "$d/i4" "$d/o2" -cmp -s "$d/o1/libwide_user.rmeta" "$d/o2/libwide_user.rmeta" && echo same || echo DIFFER +echo -n "p6-literals, incremental rebuild after editing b vs a clean build: " +mkdir -p "$d/o1" "$d/o2" +cp "$here/p6-literals/before.rs" "$d/lib.rs" +rc --crate-type lib --emit=metadata,link -Cincremental="$d/i3" --out-dir "$d/o1" "$d/lib.rs" +cp "$here/p6-literals/after.rs" "$d/lib.rs" +rc --crate-type lib --emit=metadata,link -Cincremental="$d/i3" --out-dir "$d/o1" "$d/lib.rs" +rc --crate-type lib --emit=metadata,link -Cincremental="$d/i4" --out-dir "$d/o2" "$d/lib.rs" +cmp -s "$d/o1/liblib.rmeta" "$d/o2/liblib.rmeta" && echo same || echo DIFFER diff --git a/docs/hunt/tests/incr-metadata-generics-order/rmake.rs b/docs/hunt/tests/incr-metadata-generics-order/rmake.rs new file mode 100644 index 0000000..dd86188 --- /dev/null +++ b/docs/hunt/tests/incr-metadata-generics-order/rmake.rs @@ -0,0 +1,48 @@ +//@ needs-target-std +// +// An incremental rebuild must encode the same metadata as a clean build of the same source. +// `Generics::param_def_id_to_index` was an `FxHashMap`, encoded in iteration order. When +// `generics_of` came from the incremental cache, decoding rebuilt the map by inserting in +// that order, which with colliding hashes gives a different layout, so the rebuild encoded +// the entries in a different order. Whether keys collide depends on their `DefIndex`es, so +// this tries the same items after 0 to 7 unrelated ones. + +use run_make_support::{rfs, rustc}; + +fn build(src: &str, incremental: &str, out_dir: &str) -> Vec { + rfs::write("lib.rs", src); + rustc() + .input("lib.rs") + .crate_name("foo") + .crate_type("lib") + .emit("metadata") + .incremental(incremental) + .out_dir(out_dir) + .run(); + rfs::read(format!("{out_dir}/libfoo.rmeta")) +} + +fn main() { + for padding in 0..8 { + let mut src = String::new(); + for i in 0..padding { + src.push_str(&format!("pub struct Padding{i};\n")); + } + src.push_str("pub struct Grid(A, B, C);\n"); + src.push_str("impl Grid { pub const AREA: usize = 1; }\n"); + let edited = format!("// an edit that changes nothing but spans\n{src}"); + + let (incr, out) = (format!("incr{padding}"), format!("out{padding}")); + build(&src, &incr, &out); + let incremental = build(&edited, &incr, &out); + let clean = build( + &edited, + &format!("clean-incr{padding}"), + &format!("clean-out{padding}"), + ); + assert!( + incremental == clean, + "with {padding} padding items, the incremental rebuild's metadata differs from a clean build's" + ); + } +} diff --git a/docs/hunt/tests/incr-metadata-literal-dedup/rmake.rs b/docs/hunt/tests/incr-metadata-literal-dedup/rmake.rs new file mode 100644 index 0000000..aca8feb --- /dev/null +++ b/docs/hunt/tests/incr-metadata-literal-dedup/rmake.rs @@ -0,0 +1,43 @@ +//@ needs-target-std +// +// An incremental rebuild must encode the same metadata as a clean build of the same source. +// Identical string literals share one `AllocId` when MIR is built (`allocate_bytes_dedup`), +// but an allocation decoded from the incremental cache got a fresh one. So after an edit +// to `b`, `a`'s MIR came from the cache and `b`'s was built again, and the metadata +// encoded the literal twice where a clean build encodes it once. + +use run_make_support::{rfs, rustc}; + +fn build(src: &str, incremental: &str, out_dir: &str) -> Vec { + rfs::write("lib.rs", src); + rustc() + .input("lib.rs") + .crate_name("foo") + .crate_type("lib") + // MIR is only encoded for crates that are also code-generated, as Cargo does. + .emit("metadata,link") + .incremental(incremental) + .out_dir(out_dir) + .run(); + rfs::read(format!("{out_dir}/libfoo.rmeta")) +} + +const BEFORE: &str = r#" +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { "literal" } +"#; + +const AFTER: &str = r#" +#[inline] pub fn a() -> &'static str { "literal" } +#[inline] pub fn b() -> &'static str { let s = "literal"; s } +"#; + +fn main() { + build(BEFORE, "incr", "out"); + let incremental = build(AFTER, "incr", "out"); + let clean = build(AFTER, "clean-incr", "clean-out"); + assert!( + incremental == clean, + "the incremental rebuild's metadata differs from a clean build's" + ); +}