Skip to content
A prototype of a proposed Rust trait matching algorithm.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.md
README.md
coherence.js
coherenceTest.js
method.js
methodTest.js
runTests.sh
testLib.js
trait.js
traitTest.js
type.js
typeTest.js

README.md

trait-matching-algorithm

Structure

A prototype of a proposed Rust trait matching algorithm. The prototype is intended to be run with the spidermonkey shell and is divided into several "modules" (sadly not proper ES6 modules):

  • type: some classes to represent types and a very simple unification algorithm.
  • trait: the core trait resolution algorithm.
  • coherence: the coherence test that ensures that we cannot have overlapping impls.
  • method: the method resolution algorithm for calls like a.b().

The basic idea

Shortcomings

  • I don't currently model inherent methods.
  • I don't currently model the orphan check.
You can’t perform that action at this time.