Skip to content

Conversation

RossSmyth
Copy link

Hello,

This nix devshell was a bit jank. I cleaned it up, and also added a nix derivation.

  1. Make a ./nix directory to put Nix-specific stuff in
  2. Create a patch for grabbing tinycbor from nixpkgs, since fetching in the Nix sandbox is not allowed

This is fine because the version in nixpkgs is the same version that was being fetched via git anyways.

  1. Create a derivation for building c2rust in the nix sandbox at ./nix/package.nix
  2. Create a wrapper derivation for running c2rust at ./nix/default.nix

This provides things that c2rust needs in its environment to run, such as setting up PATH and other things.

  1. Make a ./shell.nix file

This is basically the same as before. It is hooked up to the flake too.

  1. Add some flake checks

This allows to check that it builds when updating and other things.

  1. Add overlay in ./default.nix

This is very useful, because it allows for people to directly import c2rust as an overlay into their NixOS config, home-manager config, or devshells.

  1. Update Nix instructions in README

I am unsure what sort of scope the project would like for Nix integration. This is basically the minimum of being able to build it on Nix easily. There are other things that could be done:

  1. Run Nix checks in CI
  2. Automatically update lock file

There is a TODO for a test failures:

fn lighttpd_minimal() {

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/build/source/target/x86_64-unknown-linux-gnu/release/c2rust-analyze /nix/store/ipjksldzmw00pwndfc8v4wy99q83k8z2-cargo-auditable-0.6.5/bin/cargo-auditable rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 101)
  --- stderr
  error: multiple input filenames provided (first two filenames are `rustc` and `-`)

thread 'main' panicked at '
[ERROR @ c2rust-analyze/src/main.rs:241 @ c2rust_analyze]: error (exit status: 101) running: "/nix/store/k5cb6zl45g4hpwzkjj41qzwq29zy2w1x-cargo-1.65.0-nightly-2022-08-08-x86_64-unknown-linux-gnu/bin/cargo" "check" "--manifest-path" "../analysis/tests/lighttpd-minimal/Cargo.toml"
', c2rust-analyze/src/log.rs:50:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

And various filecheck failures. It also looks like there is some sort of race happening on stderr output?
filecheck.log

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @RossSmyth, thanks for this PR, but we don't really have the capacity to review nix improvements. If you can finish this up so it's not a draft and it looks generally okay, we can try to merge it, but we won't be able to help or review it with any depth.

@RossSmyth
Copy link
Author

Sounds good. I've been slammed at work so I've not been able to get back to this quite yet.

Copy link

@cydparser cydparser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the Nix expressions!

python3
}:
let
# Something changed in nixpkgs since this snapshot,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use a newer snapshot if the derivation is changed to only build c2rust:

  cargoBuildFlags = [
    "-p"
    "c2rust"
  ];

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the MSRV of c2rust? The whole point is tracking what the repo does.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, 1.65 (the pinned nightly). Not sure if it works on any older versions.

Copy link
Author

@RossSmyth RossSmyth Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I realize that. cydparser said that if you only build c2rust you can "use a newer snapshot". I'm unsure how, so I am asking what they mean.

Copy link
Contributor

@DieracDelta DieracDelta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT this is needed to be able to build c2rust from the devshell

@RossSmyth
Copy link
Author

The tests still fail though

c2rust> Running phase: checkPhase
c2rust> Executing cargoNextestHook
c2rust> cargoNextestHook flags: --target x86_64-unknown-linux-gnu --offline -j 14 --
c2rust>    Compiling proc-macro2 v1.0.95
c2rust>    Compiling unicode-ident v1.0.8
c2rust>    Compiling libc v0.2.147
c2rust>    Compiling memchr v2.5.0
c2rust>    Compiling cfg-if v1.0.0
c2rust>    Compiling log v0.4.17
c2rust>    Compiling io-lifetimes v1.0.10
c2rust>    Compiling serde v1.0.163
c2rust>    Compiling once_cell v1.21.2
c2rust>    Compiling syn v1.0.109
c2rust>    Compiling print_bytes v1.2.0
c2rust>    Compiling version_check v0.9.4
c2rust>    Compiling cc v1.0.79
c2rust>    Compiling lazy_static v1.4.0
c2rust>    Compiling bitflags v1.3.2
c2rust>    Compiling rustix v0.37.25
c2rust>    Compiling linux-raw-sys v0.3.7
c2rust>    Compiling heck v0.4.1
c2rust>    Compiling autocfg v1.1.0
c2rust>    Compiling regex-syntax v0.7.1
c2rust>    Compiling gimli v0.27.2
c2rust>    Compiling hashbrown v0.12.3
c2rust>    Compiling adler v1.0.2
c2rust>    Compiling rustc-demangle v0.1.23
c2rust>    Compiling either v1.8.1
c2rust>    Compiling crossbeam-utils v0.8.19
c2rust>    Compiling glob v0.3.1
c2rust>    Compiling thiserror v1.0.40
c2rust>    Compiling prettyplease v0.2.32
c2rust>    Compiling linked-hash-map v0.5.6
c2rust>    Compiling strsim v0.10.0
c2rust>    Compiling os_str_bytes v6.5.0
c2rust>    Compiling termcolor v1.2.0
c2rust>    Compiling minimal-lexical v0.2.1
c2rust>    Compiling bindgen v0.69.5
c2rust>    Compiling textwrap v0.16.0
c2rust>    Compiling fs-err v2.9.0
c2rust>    Compiling humantime v2.1.0
c2rust>    Compiling pin-project-lite v0.2.9
c2rust>    Compiling rustc-hash v1.1.0
c2rust>    Compiling shlex v1.3.0
c2rust>    Compiling lazycell v1.3.0
c2rust>    Compiling eyre v0.6.8
c2rust>    Compiling typenum v1.16.0
c2rust>    Compiling bitflags v2.9.0
c2rust>    Compiling ucd-trie v0.1.5
c2rust>    Compiling owo-colors v3.5.0
c2rust>    Compiling indenter v0.3.3
c2rust>    Compiling half v1.8.2
c2rust>    Compiling anyhow v1.0.75
c2rust>    Compiling rustversion v1.0.12
c2rust>    Compiling unicode-xid v0.2.4
c2rust>    Compiling serde_json v1.0.96
c2rust>    Compiling utf8parse v0.2.1
c2rust>    Compiling failure_derive v0.1.8
c2rust>    Compiling anstyle v1.0.0
c2rust>    Compiling fastrand v1.9.0
c2rust>    Compiling anstyle-query v1.0.0
c2rust>    Compiling same-file v1.0.6
c2rust>    Compiling itoa v1.0.6
c2rust>    Compiling fnv v1.0.7
c2rust>    Compiling colorchoice v1.0.0
c2rust>    Compiling ryu v1.0.13
c2rust>    Compiling arc-swap v1.6.0
c2rust>    Compiling toml_datetime v0.6.1
c2rust>    Compiling similar v2.2.1
c2rust>    Compiling clap_lex v0.4.1
c2rust>    Compiling winnow v0.4.6
c2rust>    Compiling dtoa v1.0.6
c2rust>    Compiling pathdiff v0.2.1
c2rust>    Compiling cpufeatures v0.2.7
c2rust>    Compiling datafrog v2.0.1
c2rust>    Compiling strum v0.24.1
c2rust>    Compiling smallvec v1.10.0
c2rust>    Compiling byteorder v1.5.0
c2rust>    Compiling assert_matches v1.5.0
c2rust>    Compiling is_executable v1.0.1
c2rust>    Compiling c2rust-asm-casts v0.20.0 (/build/source/c2rust-asm-casts)
c2rust>    Compiling sharded-slab v0.1.4
c2rust>    Compiling c2rust-build-paths v0.20.0 (/build/source/c2rust-build-paths)
c2rust>    Compiling tracing-core v0.1.31
c2rust>    Compiling thread_local v1.1.7
c2rust>    Compiling cmake v0.1.50
c2rust>    Compiling miniz_oxide v0.6.2
c2rust>    Compiling libloading v0.7.4
c2rust>    Compiling itertools v0.10.5
c2rust>    Compiling yaml-rust v0.4.5
c2rust>    Compiling linked_hash_set v0.1.4
c2rust>    Compiling proc-macro-error-attr v1.0.4
c2rust>    Compiling proc-macro-error v1.0.4
c2rust>    Compiling generic-array v0.14.7
c2rust>    Compiling clap_lex v0.2.4
c2rust>    Compiling indexmap v1.9.3
c2rust>    Compiling clang-sys v1.6.1
c2rust>    Compiling addr2line v0.19.0
c2rust>    Compiling anstyle-parse v0.2.0
c2rust>    Compiling walkdir v2.5.0
c2rust>    Compiling tracing v0.1.37
c2rust>    Compiling c2rust-pdg v0.20.0 (/build/source/pdg)
c2rust>    Compiling c2rust-analyze v0.20.0 (/build/source/c2rust-analyze)
c2rust>    Compiling c2rust-instrument v0.20.0 (/build/source/dynamic_instrumentation)
c2rust>    Compiling tracing-subscriber v0.3.17
c2rust>    Compiling log-reroute v0.1.8
c2rust>    Compiling polonius-engine v0.13.0
c2rust>    Compiling aho-corasick v1.0.1
c2rust>    Compiling object v0.30.3
c2rust>    Compiling bstr v1.6.0
c2rust>    Compiling aho-corasick v0.7.20
c2rust>    Compiling quote v1.0.36
c2rust>    Compiling nom v7.1.3
c2rust>    Compiling backtrace v0.3.67
c2rust>    Compiling crossbeam-queue v0.3.11
c2rust>    Compiling atty v0.2.14
c2rust>    Compiling console v0.15.5
c2rust>    Compiling getrandom v0.2.10
c2rust>    Compiling fs2 v0.4.3
c2rust>    Compiling tracing-error v0.2.0
c2rust>    Compiling which v4.4.0
c2rust>    Compiling syn v2.0.101
c2rust>    Compiling regex v1.8.1
c2rust>    Compiling colored v1.9.3
c2rust>    Compiling colored v2.0.0
c2rust>    Compiling rand_core v0.6.4
c2rust>    Compiling color-spantrace v0.2.0
c2rust>    Compiling cexpr v0.6.0
c2rust>    Compiling crypto-common v0.1.6
c2rust>    Compiling block-buffer v0.10.4
c2rust>    Compiling fern v0.6.2
c2rust>    Compiling globset v0.4.10
c2rust>    Compiling digest v0.10.7
c2rust>    Compiling is-terminal v0.4.7
c2rust>    Compiling tempfile v3.5.0
c2rust>    Compiling color-eyre v0.6.2
c2rust>    Compiling synstructure v0.12.6
c2rust>    Compiling c2rust-ast-builder v0.20.0 (/build/source/c2rust-ast-builder)
c2rust>    Compiling insta v1.43.1
c2rust>    Compiling env_logger v0.10.0
c2rust>    Compiling anstream v0.3.2
c2rust>    Compiling sha2 v0.10.8
c2rust>    Compiling c2rust-ast-printer v0.20.0 (/build/source/c2rust-ast-printer)
c2rust>    Compiling clap_builder v4.2.7
c2rust>    Compiling serde_derive v1.0.163
c2rust>    Compiling thiserror-impl v1.0.40
c2rust>    Compiling c2rust-bitfields-derive v0.20.0 (/build/source/c2rust-bitfields-derive)
c2rust>    Compiling clap_derive v4.2.0
c2rust>    Compiling zerocopy-derive v0.7.35
c2rust>    Compiling clap_derive v3.2.25
c2rust>    Compiling enum_dispatch v0.3.11
c2rust>    Compiling strum_macros v0.24.3
c2rust>    Compiling c2rust-bitfields v0.20.0 (/build/source/c2rust-bitfields)
c2rust>    Compiling c2rust-ast-exporter v0.20.0 (/build/source/c2rust-ast-exporter)
c2rust>    Compiling failure v0.1.8
c2rust>    Compiling pest v2.6.0
c2rust>    Compiling zerocopy v0.7.35
c2rust>    Compiling pest_meta v2.6.0
c2rust>    Compiling ppv-lite86 v0.2.20
c2rust>    Compiling pest_generator v2.6.0
c2rust>    Compiling rand_chacha v0.3.1
c2rust>    Compiling rand v0.8.5
c2rust>    Compiling clap v4.2.7
c2rust>    Compiling pest_derive v2.6.0
c2rust>    Compiling bincode v1.3.3
c2rust>    Compiling serde_bytes v0.11.9
c2rust>    Compiling indexed_vec v1.2.1
c2rust>    Compiling serde_cbor v0.11.2
c2rust>    Compiling serde_bencode v0.2.3
c2rust>    Compiling c2rust-analysis-rt v0.20.0 (/build/source/analysis/runtime)
c2rust>    Compiling clap v3.2.25
c2rust>    Compiling toml_edit v0.19.8
c2rust>    Compiling handlebars v4.3.7
c2rust>    Compiling c2rust-transpile v0.20.0 (/build/source/c2rust-transpile)
c2rust>    Compiling c2rust v0.20.0 (/build/source/c2rust)
c2rust>     Finished test [unoptimized + debuginfo] target(s) in 3m 10s
c2rust> ------------0:00:00]                                            0/104:
c2rust>  Nextest run ID 05ba9164-17e1-4c6e-84d8-9acaa1e1a5f9 with nextest profile: default
c2rust>     Starting 103 tests across 19 binaries (1 test skipped)
c2rust>         PASS [   0.012s] c2rust-analyze::analyze check_for_missing_tests[1m0 skipped
c2rust>         PASS [   0.012s] c2rust-analyze::auto_fix_errors check_for_missing_tests skipped
c2rust>         PASS [   0.116s] c2rust-analyze::analyze rust_intrinsiced, 0 skipped
c2rust>         PASS [   0.123s] c2rust-analyze::analyze macros2;1mpassed, 0 skipped
c2rust>         PASS [   0.130s] c2rust-analyze::analyze string_literalsd, 0 skipped
c2rust>         PASS [   0.137s] c2rust-analyze::analyze ptr_addr_ofassed, 0 skipped
c2rust>         PASS [   0.163s] c2rust-analyze::analyze string_castsssed, 0 skipped
c2rust>         FAIL [   0.203s] c2rust-analyze::analyze lighttpd_minimal, 0 skipped
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test lighttpd_minimal ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         lighttpd_minimal
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.19s
c2rust>     
c2rust>   stderr ---
c2rust>     thread 'lighttpd_minimal' panicked at 'assertion failed: status.success()', c2rust-analyze/tests/analyze.rs:66:5
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>   Cancelling due to test failure: 13 tests still running 1 failed, 0 skipped                                                                                    
c2rust>         PASS [   0.251s] c2rust-analyze::filecheck addr_of0m, 1 failed, 0 skipped                                                                                    
c2rust>         FAIL [   0.252s] c2rust-analyze::filecheck alias1m1 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test alias1 ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         alias1
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.24s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/alias1.rs:3:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "alias1_good"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:9:74: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias1[0dc4]::alias1_good), const_param_did: None }), promoted: None }:
c2rust>                                                                              ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/alias1.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                1: 0 force_rewrite defs
c2rust>     label:3'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                2: global pointerid range: 0 .. 0
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                3: local pointerid range: 0 .. 8
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                4: local pointerid range: 8 .. 16
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                5: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>                6: update bb0: [] -> []
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                7: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>                8: update bb0: [] -> []
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                9: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias1[0dc4]::alias1_good), const_param_did: None }), promoted: None }:
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:3'1                                                                              ?                                                                              possible intended match
c2rust>               10:  block bb0:
c2rust>     label:3'0     ~~~~~~~~~~~~
c2rust>               11:  bb0[0]: StorageLive(_1)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               12:  /build/source/c2rust-analyze/tests/filecheck/alias1.rs:6:9: 6:14 (#0) (no unlowering entries found)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               13:  bb0[1]: _1 = const 0_i32
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               14:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/alias1.rs:6:17: 6:18 (#0)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>     >>>>>>
c2rust>     thread 'alias1' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/alias1.rs" > "/build/source/c2rust-analyze/tests/filecheck/alias1.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         PASS [   0.268s] c2rust-analyze::auto_fix_errors derive_copy;1mfailed, 1 skipped                                                                                    
c2rust>         PASS [   0.283s] c2rust-analyze::filecheck adjust_unsizefailed, 1 skipped                                                                                    
c2rust>         FAIL [   0.281s] c2rust-analyze::filecheck alias2m2 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test alias2 ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         alias2
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.27s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/alias2.rs:3:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "alias2_copy_good"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:15:74: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias2[3f65]::alias2_copy_good), const_param_did: None }), promoted: None }:
c2rust>                                                                              ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/alias2.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                1: 0 force_rewrite defs
c2rust>     label:3'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                2: global pointerid range: 0 .. 4
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                3: local pointerid range: 4 .. 10
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                4: local pointerid range: 10 .. 18
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                5: local pointerid range: 18 .. 24
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                6: local pointerid range: 24 .. 32
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>               10: update bb0: [] -> [_1]
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               11: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>               12: update bb0: [] -> [_1]
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               13: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>               14: update bb0: [] -> [_1]
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               15: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias2[3f65]::alias2_copy_good), const_param_did: None }), promoted: None }:
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:3'1                                                                              ?                                                                                   possible intended match
c2rust>               16:  block bb0:
c2rust>     label:3'0     ~~~~~~~~~~~~
c2rust>               17:  bb0[0]: StorageLive(_2)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               18:  /build/source/c2rust-analyze/tests/filecheck/alias2.rs:7:9: 7:10 (#0) (no unlowering entries found)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               19:  bb0[1]: _2 = _1
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~
c2rust>               20:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/alias2.rs:7:13: 7:14 (#0)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>     >>>>>>
c2rust>     thread 'alias2' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/alias2.rs" > "/build/source/c2rust-analyze/tests/filecheck/alias2.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         FAIL [   0.327s] c2rust-analyze::filecheck aggregate1 3 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test aggregate1 ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         aggregate1
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.32s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/aggregate1.rs:22:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "tuple"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:22:1: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:9 ~ aggregate1[d287]::aggregate), const_param_did: None }), promoted: None }:
c2rust>     ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/aggregate1.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                 1: 0 force_rewrite defs
c2rust>     label:22'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                 2: global pointerid range: 0 .. 7
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 3: local pointerid range: 7 .. 23
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 4: local pointerid range: 23 .. 41
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 5: local pointerid range: 41 .. 55
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 6: local pointerid range: 55 .. 65
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 .
c2rust>                 .
c2rust>                 .
c2rust>                17: update bb1: [] -> [_2]
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                18: update bb2: [] -> []
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                19: update bb0: [] -> [_1]
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                20: queue = [bb0]
c2rust>     label:22'0     ~~~~~~~~~~~~~~
c2rust>                21: update bb0: [] -> []
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                22: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:9 ~ aggregate1[d287]::aggregate), const_param_did: None }), promoted: None }:
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:22'1     ?                                                                                                                                                         possible intended match
c2rust>                23:  block bb0:
c2rust>     label:22'0     ~~~~~~~~~~~~
c2rust>                24:  bb0[0]: StorageLive(_1)
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                25:  /build/source/c2rust-analyze/tests/filecheck/aggregate1.rs:12:9: 12:10 (#0) (no unlowering entries found)
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                26:  bb0[1]: _1 = const 0_u32
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                27:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/aggregate1.rs:12:13: 12:14 (#0)
c2rust>     label:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 .
c2rust>                 .
c2rust>                 .
c2rust>     >>>>>>
c2rust>     thread 'aggregate1' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/aggregate1.rs" > "/build/source/c2rust-analyze/tests/filecheck/aggregate1.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         FAIL [   0.262s] c2rust-analyze::filecheck alias3[0m, 4 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test alias3 ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         alias3
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.25s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/alias3.rs:3:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "alias3_copy_bad1"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     warning: unused import: `std::ptr`
c2rust>     ^
c2rust>     <stdin>:17:74: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias3[91eb]::alias3_copy_bad1), const_param_did: None }), promoted: None }:
c2rust>                                                                              ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/alias3.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                1: warning: unused import: `std::ptr`
c2rust>     label:3'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                2:  --> /build/source/c2rust-analyze/tests/filecheck/alias3.rs:1:5
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                3:  |
c2rust>     label:3'0     ~~~
c2rust>                4: 1 | use std::ptr;
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~
c2rust>                5:  | ^^^^^^^^
c2rust>     label:3'0     ~~~~~~~~~~~~
c2rust>                6:  |
c2rust>     label:3'0     ~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>               12: local pointerid range: 9 .. 16
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               13: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>               14: update bb0: [] -> [_1]
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               15: queue = [bb0]
c2rust>     label:3'0     ~~~~~~~~~~~~~~
c2rust>               16: update bb0: [] -> [_1]
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               17: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:6 ~ alias3[91eb]::alias3_copy_bad1), const_param_did: None }), promoted: None }:
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:3'1                                                                              ?                                                                                   possible intended match
c2rust>               18:  block bb0:
c2rust>     label:3'0     ~~~~~~~~~~~~
c2rust>               19:  bb0[0]: StorageLive(_2)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               20:  /build/source/c2rust-analyze/tests/filecheck/alias3.rs:9:9: 9:10 (#0) (no unlowering entries found)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               21:  bb0[1]: _2 = _1
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~
c2rust>               22:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/alias3.rs:9:13: 9:14 (#0)
c2rust>     label:3'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>     >>>>>>
c2rust>     thread 'alias3' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/alias3.rs" > "/build/source/c2rust-analyze/tests/filecheck/alias3.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         PASS [   0.231s] c2rust-analyze::filecheck call_cast[0m failed, 1 skipped                                                                                    
c2rust>         FAIL [   0.261s] c2rust-analyze::filecheck call11m5 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test call1 ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         call1
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.25s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/call1.rs:8:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "call1"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:46:73: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:3 ~ call1[def9]::call1), const_param_did: None }), promoted: None }:
c2rust>                                                                             ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/call1.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                1: 0 force_rewrite defs
c2rust>     label:8'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                2: global pointerid range: 0 .. 5
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                3: local pointerid range: 5 .. 7
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                4: local pointerid range: 7 .. 9
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                5: local pointerid range: 9 .. 21
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                6: local pointerid range: 21 .. 25
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>               41:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/call1.rs:31:30: 33:2 (#0)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               42:  [Rvalue]: Expr, /build/source/c2rust-analyze/tests/filecheck/call1.rs:31:30: 33:2 (#0)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               43:  bb0[2]: Terminator { source_info: SourceInfo { span: /build/source/c2rust-analyze/tests/filecheck/call1.rs:33:2: 33:2 (#0), scope: scope[0] }, kind: return }
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               44:  /build/source/c2rust-analyze/tests/filecheck/call1.rs:33:2: 33:2 (#0) (no unlowering entries found)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               45: distributed rewrites:
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~
c2rust>               46: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:3 ~ call1[def9]::call1), const_param_did: None }), promoted: None }:
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:8'1                                                                             ?                                                                        possible intended match
c2rust>               47:  block bb0:
c2rust>     label:8'0     ~~~~~~~~~~~~
c2rust>               48:  bb0[0]: StorageLive(_2)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               49:  /build/source/c2rust-analyze/tests/filecheck/call1.rs:12:9: 12:10 (#0) (no unlowering entries found)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               50:  bb0[1]: _2 = _1
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~
c2rust>               51:  []: StoreIntoLocal, /build/source/c2rust-analyze/tests/filecheck/call1.rs:12:13: 12:14 (#0)
c2rust>     label:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>     >>>>>>
c2rust>     thread 'call1' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/call1.rs" > "/build/source/c2rust-analyze/tests/filecheck/call1.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         FAIL [   0.290s] c2rust-analyze::filecheck as_ptr[0m, 6 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test as_ptr ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         as_ptr
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.28s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/as_ptr.rs:1:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "slice_as_ptr_load"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:25:74: note: possible intended match here
c2rust>     unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:3 ~ as_ptr[f80f]::slice_as_ptr_load), const_param_did: None }), promoted: None }:
c2rust>                                                                              ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/as_ptr.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                1: 0 force_rewrite defs
c2rust>     label:1'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                2: global pointerid range: 0 .. 4
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                3: local pointerid range: 4 .. 11
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                4: local pointerid range: 11 .. 22
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                5: local pointerid range: 22 .. 32
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                6: local pointerid range: 32 .. 46
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>               20: queue = [bb2, bb3, bb1, bb0]
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               21: update bb2: [] -> [_5]
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               22: update bb3: [] -> []
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>               23: update bb1: [] -> [_2, _5]
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               24: update bb0: [] -> [_1, _2, _5]
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               25: unlowering for MirSource { instance: Item(WithOptConstParam { did: DefId(0:3 ~ as_ptr[f80f]::slice_as_ptr_load), const_param_did: None }), promoted: None }:
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:1'1                                                                              ?                                                                                    possible intended match
c2rust>               26:  block bb0:
c2rust>     label:1'0     ~~~~~~~~~~~~
c2rust>               27:  bb0[0]: StorageLive(_2)
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               28:  /build/source/c2rust-analyze/tests/filecheck/as_ptr.rs:6:9: 6:10 (#0) (no unlowering entries found)
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               29:  bb0[1]: StorageLive(_3)
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>               30:  /build/source/c2rust-analyze/tests/filecheck/as_ptr.rs:6:13: 6:23 (#0) (no unlowering entries found)
c2rust>     label:1'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                .
c2rust>                .
c2rust>                .
c2rust>     >>>>>>
c2rust>     thread 'as_ptr' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/as_ptr.rs" > "/build/source/c2rust-analyze/tests/filecheck/as_ptr.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         PASS [   0.424s] c2rust-analyze::analyze with_pdg_filem failed, 1 skipped                                                                                    
c2rust>         FAIL [   0.479s] c2rust-analyze::filecheck alloc, 8 failed, 1 skipped                                                                                    
c2rust>   stdout ---
c2rust>     running 1 test
c2rust>     test alloc ... FAILED
c2rust>     failures:
c2rust>     failures:
c2rust>         alloc
c2rust>     test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.47s
c2rust>     
c2rust>   stderr ---
c2rust>     /build/source/c2rust-analyze/tests/filecheck/alloc.rs:27:17: error: CHECK-LABEL: expected string not found in input
c2rust>     // CHECK-LABEL: final labeling for "malloc_and_free1"
c2rust>                     ^
c2rust>     <stdin>:1:1: note: scanning from here
c2rust>     0 force_rewrite defs
c2rust>     ^
c2rust>     <stdin>:7:1: note: possible intended match here
c2rust>     local pointerid range: 76 .. 141
c2rust>     ^
c2rust>     Input file: <stdin>
c2rust>     Check file: /build/source/c2rust-analyze/tests/filecheck/alloc.rs
c2rust>     -dump-input=help explains the following input dump.
c2rust>     Input was:
c2rust>     <<<<<<
c2rust>                 1: 0 force_rewrite defs
c2rust>     label:27'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
c2rust>                 2: global pointerid range: 0 .. 6
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 3: local pointerid range: 6 .. 22
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 4: local pointerid range: 22 .. 43
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 5: local pointerid range: 43 .. 60
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 6: local pointerid range: 60 .. 76
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 7: local pointerid range: 76 .. 141
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>     label:27'1     ?                                 possible intended match
c2rust>                 8: local pointerid range: 141 .. 150
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                 9: local pointerid range: 150 .. 161
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                10: queue = [bb3, bb4, bb2, bb1, bb0]
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c2rust>                11: update bb3: [] -> []
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                12: update bb4: [] -> []
c2rust>     label:27'0     ~~~~~~~~~~~~~~~~~~~~~
c2rust>                 .
c2rust>                 .
c2rust>                 .
c2rust>     >>>>>>
c2rust>     thread 'alloc' panicked at '
c2rust>     FileCheck failed with status exit status: 1:
c2rust>     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/alloc.rs" > "/build/source/c2rust-analyze/tests/filecheck/alloc.rs.analysis.txt"
c2rust>     ', c2rust-analyze/tests/common/mod.rs:275:9
c2rust>     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
c2rust>         SLOW [> 60.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
c2rust>         SLOW [>120.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
c2rust>         SLOW [>180.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
c2rust>         SLOW [>240.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
c2rust>         SLOW [>300.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
c2rust>         PASS [ 323.621s] c2rust-analyze::filecheck algo_md5m (1 slow), 8 failed, 1 skipped                                                                           
c2rust> ------------[0m [ 00:05:23]   21/103: 0 running, 13 passed (1 slow), 8 failed, 1 skipped                                                                           
c2rust>      Summary [ 323.624s] 21/103 tests run: 13 passed (1 slow), 8 failed, 1 skipped
c2rust>         FAIL [   0.203s] c2rust-analyze::analyze lighttpd_minimal
c2rust>         FAIL [   0.327s] c2rust-analyze::filecheck aggregate1
c2rust>         FAIL [   0.252s] c2rust-analyze::filecheck alias1
c2rust>         FAIL [   0.281s] c2rust-analyze::filecheck alias2
c2rust>         FAIL [   0.262s] c2rust-analyze::filecheck alias3
c2rust>         FAIL [   0.479s] c2rust-analyze::filecheck alloc
c2rust>         FAIL [   0.290s] c2rust-analyze::filecheck as_ptr
c2rust>         FAIL [   0.261s] c2rust-analyze::filecheck call1
c2rust> warning: 82/103 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
c2rust> error: test run failed103: 0 running, 13 passed (1 slow), 8 failed, 1 skipped                                                                           
error: builder for '/nix/store/13pkv9zd3z3x4fhgh0irpjc85ra073ls-c2rust-0.20.0.drv' failed with exit code 100;
       last 25 log lines:
       >     >>>>>>
       >     thread 'alloc' panicked at '
       >     FileCheck failed with status exit status: 1:
       >     > "/nix/store/zzm2ka57nhpijl98j5livhprqw9d7pdp-llvm-19.1.7/bin/FileCheck" "/build/source/c2rust-analyze/tests/filecheck/alloc.rs" > "/build/source/c2rust-analyze/tests/filecheck/alloc.rs.analysis.txt"
       >     ', c2rust-analyze/tests/common/mod.rs:275:9
       >     note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       >
       >         SLOW [> 60.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
       >         SLOW [>120.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
       >         SLOW [>180.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
       >         SLOW [>240.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
       >         SLOW [>300.000s] c2rust-analyze::filecheck algo_md5m, 8 failed, 1 skipped                                                                                    
       >         PASS [ 323.621s] c2rust-analyze::filecheck algo_md5m (1 slow), 8 failed, 1 skipped                                                                           
       > ------------[0m [ 00:05:23]   21/103: 0 running, 13 passed (1 slow), 8 failed, 1 skipped                                                                           
       >      Summary [ 323.624s] 21/103 tests run: 13 passed (1 slow), 8 failed, 1 skipped
       >         FAIL [   0.203s] c2rust-analyze::analyze lighttpd_minimal
       >         FAIL [   0.327s] c2rust-analyze::filecheck aggregate1
       >         FAIL [   0.252s] c2rust-analyze::filecheck alias1
       >         FAIL [   0.281s] c2rust-analyze::filecheck alias2
       >         FAIL [   0.262s] c2rust-analyze::filecheck alias3
       >         FAIL [   0.479s] c2rust-analyze::filecheck alloc
       >         FAIL [   0.290s] c2rust-analyze::filecheck as_ptr
       >         FAIL [   0.261s] c2rust-analyze::filecheck call1
       > warning: 82/103 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
       > error: test run failed103: 0 running, 13 passed (1 slow), 8 failed, 1 skipped                                                                           
       For full logs, run 'nix log /nix/store/13pkv9zd3z3x4fhgh0irpjc85ra073ls-c2rust-0.20.0.drv'.
error: 1 dependencies of derivation '/nix/store/lbszanw9mszn1gr0jwrzhgiah0ii248n-c2rust-0.20.0.drv' failed to build

@Chobbes
Copy link
Contributor

Chobbes commented Aug 22, 2025

@RossSmyth oh shoot, I didn't see this. I made a PR to fix up the nix build as well, didn't mean to step on any toes!

#1341

I did manage to get all of the tests passing under nix as well, if that's helpful for you.

@Chobbes
Copy link
Contributor

Chobbes commented Aug 26, 2025

@RossSmyth / @kkysen I'm wondering if you think it makes sense to merge #1341 first, as it's ready to go, and then the additional refactoring in this PR can be merged on top of it later?

The shell.nix / README changes / flake checks / CI changes / general refactoring here are valuable, but maybe it makes sense to stage it so we can have a working nix package / shell now? I'm happy to help with merging these changes with mine after the fact!

Thanks!

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RossSmyth / @kkysen I'm wondering if you think it makes sense to merge #1341 first, as it's ready to go, and then the additional refactoring in this PR can be merged on top of it later?

The shell.nix / README changes / flake checks / CI changes / general refactoring here are valuable, but maybe it makes sense to stage it so we can have a working nix package / shell now? I'm happy to help with merging these changes with mine after the fact!

I don't really have a strong opinion either way. I think whichever one is ready first can merge first, unless it's much more difficult to rebase one of them or something like that.

@RossSmyth
Copy link
Author

I'd say merge the other PR, but if I ever come back around to this (I am very busy with work and life and unfortunately this is low priority for me) I'll clean it up as it isn't quite idiomatic nix.

@RossSmyth RossSmyth closed this Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants