Skip to content

Compiler crashed with 'Calling a function with a bad signature!' #22874

Description

@jamii
#![feature(hash)] // TODO is this a good idea?
#![allow(dead_code)]

#[derive(PartialOrd, PartialEq, Clone, Hash, Debug)]
enum Value {
    Least,
    String(String),
    Greatest
}

type Row = [Value];

struct Table {
    rows: [Row]
}

trait Skippable {
    fn next(&self, row: &Row, inclusive: bool) -> &Row;
}

impl Skippable for Table {
    fn next(&self, row: &Row, inclusive: bool) -> &Row {
        &self.rows[0]
    }
}

fn main() {
}
amie@wanderer:~/make_you_a_database/examples$ cargo build --verbose
   Compiling make-you-a-database v0.0.1 (file:///home/jamie/make_you_a_database/examples)
     Running `rustc src/main.rs --crate-name make-you-a-database --crate-type bin -g --out-dir /home/jamie/make_you_a_database/examples/target --emit=dep-info,link -L dependency=/home/jamie/make_you_a_database/examples/target -L dependency=/home/jamie/make_you_a_database/examples/target/deps`
src/main.rs:1:12: 1:16 warning: unused or unknown feature, #[warn(unused_features)] on by default
src/main.rs:1 #![feature(hash)] // TODO is this a good idea?
                         ^~~~
src/main.rs:22:17: 22:20 warning: unused variable: `row`, #[warn(unused_variables)] on by default
src/main.rs:22  fn next(&self, row: &Row, inclusive: bool) -> &Row {
                               ^~~
src/main.rs:22:28: 22:37 warning: unused variable: `inclusive`, #[warn(unused_variables)] on by default
src/main.rs:22  fn next(&self, row: &Row, inclusive: bool) -> &Row {
                                          ^~~~~~~~~
rustc: /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/Instructions.cpp:281: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
Could not compile `make-you-a-database`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name make-you-a-database --crate-type bin -g --out-dir /home/jamie/make_you_a_database/examples/target --emit=dep-info,link -L dependency=/home/jamie/make_you_a_database/examples/target -L dependency=/home/jamie/make_you_a_database/examples/target/deps` (status=6)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions