Skip to content

ICE when calling function as part of vector initializer #5052

Closed

Description

@jdm
rusti> let a = [0, ..ptr::null()];
rust: task failed at 'Unsupported constant expr', /run/media/jdm/ssd/rust/src/librustc/middle/const_eval.rs:236

Activity

  1. alexcrichton commented on May 22, 2013

    @alexcrichton
    Member

    Using today's compiler, you now get:

    rusti> let a = [0, ..ptr::null()];
    <anon>:36:14: 36:26 error: expected constant integer for repeat count but found variable
    <anon>:36 let a = [0, ..ptr::null()];
                            ^~~~~~~~~~~~
    error: aborting due to previous error
    rust: task failed at 'explicit failure', /Users/alex/code/rust-opt/src/libsyntax/diagnostic.rs:93
    

    Which is now helpfully an error instead of an ICE!

  2. added a commit that references this issue on May 27, 2026
  3. 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

    A-frontendArea: Compiler frontend (errors, parsing and HIR)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions