lazy norm, infinitely sized types, and the occurs check

Open
#7 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
rust
Domain
compilers

Research direction

The issue names no repository file, test, or entry point, so begin by locating the lazy normalization, type equating, and occurs-check implementation. Reproduce the Alias and From examples described in the issue and determine whether an overlap case can actually pass; done means either a focused regression test and fix or a documented decision that no change is needed.

Written by the indexing model from the issue text.

Description

for type Alias = Vec<Alias>;, equating Alias with Vec<Alias> may succeed:

  • normalizes-to(Alias, Vec<Alias>) -> Vec<Alias>
    • equate(Vec<Alias>, Vec<Alias>) ok via structural equality fast-path

This would cause the occurs check to be incomplete as ?0 eq Vec<?0> can be proven by instantiating ?0 with Alias. The occurs check is strictly required:

trait From<T> {}
impl<T> From<T> for T {}
impl<T> From<T> for Box<T> {}

This issue is pretty much purely theoretical as we're eagerly replacing all aliases inside of the normalized type with infer vars when equating it with the expected term. I don't necessarily believe we need to handle this until somebody crafts an example where this causes 'overlap' of impls allowed due to the occurs check.

Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/project-dictionary-passing

All issues in rust-lang/project-dictionary-passing

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.