Skip to content

LLVM assert "Op types should be identical!" with iter_vec(fail){...}ย #2145

Closed

Description

@jruderman
fn iter_vec<T>(v: [T], f: fn(T)) { for v.each {|x| f(x); } }
fn main() { iter_vec(fail) {|i| if i % 2 == 1 { } }; }

rustc fails with:

Assertion failed: (C1->getType() == C2->getType() && "Op types should be identical!"), function getCompare, file /Users/jruderman/code/rust/src/llvm/lib/VMCore/Constants.cpp, line 1705.

Activity

  1. jruderman commented on Apr 9, 2012

    @jruderman
    ContributorAuthor

    Now I get

    error: the type of this value must be known in this context
    

    I guess this was fixed along with #2149.

  2. added a commit that references this issue on Sep 22, 2022
  3. added a commit that references this issue on Apr 8, 2024
  4. added a commit that references this issue on Apr 8, 2024
  5. added a commit that references this issue on Jun 4, 2026
  6. added a commit that references this issue on Aug 21, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions