Skip to content

better_any regression #183

Closed
rust-lang/rust
#141347
@compiler-errors

Description

@compiler-errors

https://crater-reports.s3.amazonaws.com/pr-133502-2/try%23da0a4799770027c4c578bf48cdb390acfde09023/reg/better_any-0.2.0/log.txt

use std::any::TypeId;

unsafe trait TidAble<'a>: Tid<'a> {}
trait TidExt<'a>: Tid<'a> {
    fn downcast_box(self: Box<Self>) {
        loop {}
    }
}

impl<'a, X: ?Sized + Tid<'a>> TidExt<'a> for X {}

unsafe trait Tid<'a>: 'a {}

unsafe impl<'a, T: ?Sized + TidAble<'a>> Tid<'a> for T {}

impl<'a> dyn Tid<'a> + 'a {
    fn downcast_any_box(self: Box<Self>) {
        self.downcast_box();
    }
}

unsafe impl<'a> TidAble<'a> for dyn Tid<'a> + 'a {}
error[E0283]: type annotations needed: cannot satisfy `dyn Tid<'a>: Tid<'_>`
  --> src/lib.rs:18:14
   |
18 |         self.downcast_box();

Conflict between blanket impl and dyn impl. Probably fixed if we were to fix the dyn overlap problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from-craterA regression found via a crater run, not part of our test suite

    Type

    No type

    Projects

    Status

    done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions