Skip to content

Support for subslice projection #449

@adpaco-aws

Description

@adpaco-aws

In #436 the standard library regression is failing to codegen due the unimplemented case in codegen_projection:

            ProjectionElem::Subslice { .. } => unimplemented!(),

I think we get this due to attempting to codegen the split_last function:

Starting RMC codegen for the Rust standard library
     Created binary (application) `SizeAndAlignOfDstTest` package
Panic on building standard library
   Compiling compiler_builtins v0.1.49
   Compiling core v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.99
   Compiling cc v1.0.69
   Compiling memchr v2.4.1
   Compiling std v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std)
   Compiling unwind v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/unwind)
   Compiling rustc-std-workspace-core v1.99.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/alloc)
   Compiling cfg-if v0.1.10
   Compiling adler v0.2.3
   Compiling rustc-demangle v0.1.18
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_abort v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/panic_abort)
   Compiling panic_unwind v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/panic_unwind)
   Compiling gimli v0.25.0
   Compiling miniz_oxide v0.4.0
   Compiling hashbrown v0.11.0
   Compiling std_detect v0.1.5 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling object v0.26.1
   Compiling addr2line v0.16.0
   Compiling proc_macro v0.0.0 (/home/ubuntu/rmc-rebase/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/proc_macro)
thread 'rustc' panicked at 'not implemented', compiler/rustc_codegen_llvm/src/gotoc/mir_to_goto/codegen/place.rs:360:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z force-unstable-if-unmarked -Z trim-diagnostic-paths=no -Z codegen-backend=gotoc -C embed-bitcode=no -C debuginfo=2 --crate-type rlib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

[RMC] current codegen item: codegen_function: core::slice::<impl [T]>::split_last

RMC unexpectedly panicked during code generation.

If you are seeing this message, please file an issue here instead of on the Rust compiler: https://github.com/model-checking/rmc/issues/new?labels=bug&template=bug_report.md
error: could not compile `std`
warning: build failed, waiting for other jobs to finish...
error: build failed

Metadata

Metadata

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