Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
strega-nil opened this issue Apr 26, 2015 · 1 comment

Comments

@strega-nil
Copy link
Contributor

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.

@strega-nil strega-nil changed the title ICE: assertion failed: left == right (left: 1, right: 2) Compiler should catch when your #[lang = ""] items are not equal to what it expects Apr 26, 2015
@nagisa
Copy link
Member

nagisa commented Apr 26, 2015

dupe of #9307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants