Skip to content

Unexpected E0271 while using Pointee trait #91446

Closed
@CraftSpider

Description

@CraftSpider

I tried this code:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=53652794c179fb2128d73e2f11888a8a

I expected to see this happen:

The code compiles successfully

Instead, this happened:

There are two errors, despite the error sites apparently being no different from the successfully compiled ones, aside from the presence of generic type inference.

I couldn't get this to happen with a user-defined trait, so it may be related to Pointee's magic implementations. On the other hand, it may be possible to trigger via user code and I just couldn't find an example.

Meta

Playground Nightly Version Used:

2021-12-01 48a5999fceeea84a8971

Metadata

Metadata

Labels

A-inferenceArea: Type inferenceA-trait-systemArea: Trait systemC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions