indexing 0.1.2

Sound unchecked indexing using “generativity”; a type system approach to indices and ranges that are trusted to be in bounds.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate indexing;

use indexing::indices;

fn main() {
    let arr1 = [1, 2, 3, 4, 5];
    let arr2 = [10, 20, 30];

    indices(&arr1[..], |arr1, r1| {
        indices(&arr2[..], move |arr2, r2| {
            &arr2[r1]; //~ ERROR cannot infer an appropriate lifetime
            //~^ ERROR cannot infer an appropriate lifetime
            &arr1[r2]; //~ ERROR cannot infer an appropriate lifetime
            //~^ ERROR cannot infer an appropriate lifetime
        });
    });
}