Skip to content

ICE when Add trait is missing the add method #31076

Description

@oli-obk

if the method is missing, rustc panics due to an unwrap on a None:

#![feature(no_core, lang_items)]
#![no_core]

#[lang="sized"]
trait Sized {}

#[lang="add"]
trait Add<T> {}

impl Add<i32> for i32 {}

fn main() {
    let x = 5 + 6;
}

Activity

  1. changed the title [-]ICE when `Add` trai is missing the `add` method[/-] [+]ICE when `Add` trait is missing the `add` method[/+] on Jan 21, 2016
  2. oli-obk commented on Jan 21, 2016

    @oli-obk
    ContributorAuthor

    related to #9307

  3. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Jan 26, 2016
  4. istankovic commented on Mar 18, 2018

    @istankovic
    Contributor

    Still an issue with rustc 1.26.0-nightly (adf2135ad 2018-03-17).

  5. added a commit that references this issue on Nov 5, 2018
  6. added a commit that references this issue on Nov 6, 2018
    54bc9c2
  7. added a commit that references this issue on Nov 6, 2018
    f90aab7
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

    C-bugCategory: This is a bug.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