Skip to content

Error while using c2rust - thread 'main' panicked at 'no entry found for key' #1332

@RandallFlagg

Description

@RandallFlagg

I built c2rust from the master per the suggestion in #1329.

Did I do something wrong or is this a problem in c2rust?

Here is what I did:

  1. I cloned the fsearch repo: https://github.com/cboxdoerfer/fsearch
  2. I created the compile_commands.json using the following commands:
    meson setup builddir
    ninja -C builddir
  3. Then from the root of the project I did: RUST_BACKTRACE=1 c2rust transpile builddir/compile_commands.json
  4. This is the result:

warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/ui_resources.c
warning: Skipping duplicate compilation cmd for /opt/Projects/fsearch/builddir/src/icon_resources.c
Transpiling ui_resources.c
Transpiling icon_resources.c
Transpiling fsearch.c
thread 'main' panicked at 'no entry found for key', c2rust-transpile/src/c_ast/iterators.rs:341:69
stack backtrace:
0: rust_begin_unwind
at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/d394408fb38c4de61f765a3ed5189d2731a1da91/library/core/src/option.rs:1874:5
5: c2rust_transpile::c_ast::iterators::immediate_children_all_types
6: c2rust_transpile::c_ast::iterators::NodeVisitor::visit_tree
7: c2rust_transpile::translator::comments::::locate_comments
8: c2rust_transpile::translator::translate
9: c2rust_transpile::transpile_single
10: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
11: <alloc::vec::Vec as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
12: c2rust_transpile::transpile
13: c2rust_transpile::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions