Skip to content

LLVM assertion on "let ref a = someArray[..];" #23605

Closed
@demelev

Description

@demelev
let someArray = [1,2,3];

let a = &someArray; // The variable 'a' has a type &'static [i32, 3]
let ref b = someArray; // The variable 'b' has a type &'static [i32, 3]

I've tried to write:

let ref a = someArray[..]; // I thought maybe it equals to &someArray[..];

The line above gives LLVM assertion.
I think this must show some syntax error.

Assertion failed!

Program: C:\rust\bin\rustc.exe
File: C:/bot/slave/nightly-dist-rustc-win-64/build/src/llvm/lib/IR/Instructions.
cpp, Line 1083

Expression: getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType
())->getElementType() && "Ptr must be a pointer to Val type!"

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)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