Skip to content

Compiler should catch when your #[lang = ""] items are not equal to what it expects #24831

Closed
@strega-nil

Description

@strega-nil

By making the lang-item index not equal what it is in core:

#[lang = "index"]
trait Index {
    // ...
    fn index<'a>(&'a self) -> &'a Self::Output;
}

This causes the assertion:

assertion failed: `left == right` (left: `1`, right: `2`)

If instead you change it to a *const instead of an &'a, you get

src/lib.rs:11:5: 11:9 error: internal compiler error: cat_expr Errd
src/lib.rs:11     a[0]

However, if you change from &'a to &'a mut, nothing happens.

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