Skip to content

Impl lookup can be recursive in an unbounded way #6028

@danakj

Description

@danakj

Description of the bug:

  • impl lookup does deduction on its generic parameters
  • deduction does impl lookup which can find another impl decl
  • which will do deduction on its generic parameters...

This is all done synchronously so it should be possible to construct programs that exhaust stack space and crash the compiler.

Consider making impl lookup return a Future instead of a result, and you have to Poll the Future repeatedly until it gives a result. The Future would hold a worklist, and it could stop and return NotReady if it ever re-enters impl lookup (or maybe if it gets to the eval step twice?), preventing the stack growth.

See discord discussion: https://discord.com/channels/655572317891461132/655578254970716160/1414743730258182155

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions