Skip to content

Recent regression in diagnostics: "overflow evaluating the trait core::kinds::Sized for the type <generic #139>" #18400

Closed
@japaric

Description

@japaric

STR

trait Set<T> {
    fn contains(&self, T) -> bool;
    fn set(&mut self, T);
}

impl<'a, T, S> Set<&'a [T]> for S where
    T: Copy,
    S: Set<T>,
{
    fn contains(&self, bits: &[T]) -> bool {
        bits.iter().all(|&bit| self.contains(bit))
    }

    fn set(&mut self, bits: &[T]) {
        for &bit in bits.iter() {
            self.set(bit)
        }
    }
}

fn main() {
    let bits: &[_] = &[0, 1];

    0.contains(bits);
}

Output

overflow.rs:24:5: 24:21 error: overflow evaluating the trait `core::kinds::Sized` for the type `<generic #139>`
overflow.rs:24     0.contains(bits);
                   ^~~~~~~~~~~~~~~~
overflow.rs:24:5: 24:21 error: overflow evaluating the trait `core::kinds::Copy` for the type `<generic #139>`
overflow.rs:24     0.contains(bits);
                   ^~~~~~~~~~~~~~~~
overflow.rs:24:5: 24:21 error: overflow evaluating the trait `core::kinds::Sized` for the type `<generic integer #2>`
overflow.rs:24     0.contains(bits);
                   ^~~~~~~~~~~~~~~~
overflow.rs:24:5: 24:21 error: overflow evaluating the trait `Set<<generic #139>>` for the type `<generic integer #2>`
overflow.rs:24     0.contains(bits);
                   ^~~~~~~~~~~~~~~~
overflow.rs:24:16: 24:20 error: mismatched types: expected `&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[<generic #139>]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]`, found `&[<generic integer #0>]` (expected &-ptr, found integral variable)
overflow.rs:24     0.contains(bits);
                              ^~~~
error: aborting due to 5 previous errors

Version

rustc 0.13.0-dev (9a778bc55 2014-10-28 10:11:51 +0000)

Compare it to the output of the playpen:

<anon>:24:5: 24:21 error: the trait `Set<<generic integer #0>>` is not implemented for the type `<generic integer #2>`
<anon>:24     0.contains(bits);
              ^~~~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
Program ended.

@thestinger Do you know what's the playpen current rustc version?

According to rusti, the version is/was:

NOTICE: rustc 0.13.0-dev (2130f2221 2014-10-21 19:32:10 +0000)

cc @nikomatsakis

EDIT Added playpen version

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions