Skip to content

ICE inlining failed in call to ‘always_inline’ function body not available (-Copt-level=(2..) #832

Description

@matthiaskrgr

snippet:

//@compile-flags: -Zcodegen-backend=gcc -Clink-dead-code=true -Copt-level=3
fn main() {
    let mut bytes = vec![];
    let id = 1234u32;
    let port_number = 8080u16;
    let some_random_string = "".to_string();
    bytes.splice(0..4, id.to_be_bytes());
    bytes.splice(25..27, port_number.to_be_bytes());
    some_random_string.as_bytes().to_vec();
    println!("bytes: {:?}, len: {}", bytes, bytes.len())
}

Version information

rustc 1.95.0-nightly (a18e6d9d1 2026-01-24)
binary: rustc
commit-hash: a18e6d9d1473d9b25581dd04bef6c7577999631c
commit-date: 2026-01-24
host: x86_64-unknown-linux-gnu
release: 1.95.0-nightly
LLVM version: 21.1.8

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcodegen-backend=gcc -Clink-dead-code=true -Copt-level=3

Program output

libgccjit.so: error: : inlining failed in call to ‘always_inline’ ‘_RNvXs2D_NtNtCsjXZVF46obq5_4core5slice4iterINtB6_4IterhENtNtNtNtBa_4iter6traits10exact_size17ExactSizeIterator3lenCs3Ktur3hQz7J_4mvce’: function body not available
libgccjit.so: error: : inlining failed in call to ‘always_inline’ ‘_RNvMs2C_NtNtCsjXZVF46obq5_4core5slice4iterINtB6_4IterhE10make_sliceCs3Ktur3hQz7J_4mvce’: function body not available
libgccjit.so: error: : inlining failed in call to ‘always_inline’ ‘_RNvXs2D_NtNtCsjXZVF46obq5_4core5slice4iterINtB6_4IterhENtNtNtNtBa_4iter6traits10exact_size17ExactSizeIterator3lenCs3Ktur3hQz7J_4mvce’: function body not available
libgccjit.so: error: : inlining failed in call to ‘always_inline’ ‘_RNvMs2C_NtNtCsjXZVF46obq5_4core5slice4iterINtB6_4IterhE10make_sliceCs3Ktur3hQz7J_4mvce’: function body not available
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "-m64" "/tmp/icemaker_global_tempdir.O3K6xjHgMH4d/rustc_testrunner_tmpdir_reporting.RIyO3bTgJ9ub/rustcFOFs9D/symbols.o" "<3 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/icemaker_global_tempdir.O3K6xjHgMH4d/rustc_testrunner_tmpdir_reporting.RIyO3bTgJ9ub/rustcFOFs9D/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "outputfile" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: cannot open outputfile.mvce.2bac8b0cd4d5b33d-cgu.1.rcgu.o: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: aborting due to 1 previous error


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions