Skip to content

ICE: expect >0 RPITITs in call to 'collect_return_position_impl_trait_in_trait_tys' #122655

Closed

Description

auto-reduced (treereduce-rust):

struct Wrapper<'rom>(T);

trait Foo {
    fn bar() -> Wrapper<impl Sized>;
}

impl Foo for () {
    fn bar() -> Wrapper<impl Sized>;
}

original:

struct Wrapper<'rom>(T);
//~^ ERROR cannot find type `T` in this scope

trait Foo {
    fn bar() -> Wrapper<impl Sized>;
    //~^ ERROR missing lifetime specifier
    //~| ERROR struct takes 0 generic arguments but 1 generic argument was supplied
}

impl Foo for () {
    fn bar() -> Wrapper<impl Sized>;
    //~^ ERROR missing lifetime specifier
    //~| ERROR struct takes 0 generic arguments but 1 generic argument was supplied
}

fn main() {}

Version information

rustc 1.78.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.78.0-dev
LLVM version: 18.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions