Skip to content

Rustc behaviour with overflow evaluating the requirement #2045

@philberty

Description

@philberty

This test case: https://github.com/rust-lang/rust/blob/aa3ca1994904f2e056679fce1f185db8c7ed2703/src/test/ui/issue-20413.rs

trait Foo {
  fn answer(self);
}

struct NoData<T>;
//~^ ERROR: parameter `T` is never used

impl<T> Foo for T where NoData<T>: Foo {
//~^ ERROR: overflow evaluating the requirement
  fn answer(self) {
    let val: NoData<T> = NoData;
  }
}

fn main() {}

Currently compiles fine with gccrs: https://godbolt.org/z/r3Poahqxj

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions