Skip to content

NLL: cast causes failure to promote to static #55288

Closed
@pnkfelix

Description

@pnkfelix

spawned off of #55223 (comment)

This example is causing an error in NLL:

play

struct Slice(&'static [&'static [u8]]);
static MAP: Slice = Slice(&[
    b"CloseEvent" as &'static [u8],
]);

but this one does not cause an error:

play

struct Slice(&'static [&'static [u8]]);
static MAP: Slice = Slice(&[
    b"CloseEvent",
]);

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)A-lifetimesArea: Lifetimes / regionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions