(That's an unit test)
As part of the "unboxing closures" PR, I need to unbox the nested closure in the check
function, which I have done in this commit. However, when I ran make check-stage1-collections
I got a compiler error about the compiler not being able to infer the type of the closure in the check_intersection
function. The weird part is that, upon isolating the unit test (which I did to understand/fix the compiler error), I found out that the code actually compiles!
-
Build a compiler that includes #19449
-
Checkout rust-lang/rust#19467
-
configure
the build system to use the compiler built in step (1) as the stage0 compiler -
make check-stage1-collections
rustc: x86_64-unknown-linux-gnu/stage2/test/collectionstest-x86_64-unknown-linux-gnu
/root/rust/src/libcollections/btree/set.rs:488:13: 488:18 error: unable to infer enough type information about `_`; type annotations required
/root/rust/src/libcollections/btree/set.rs:488 check(a, b, expected, |x, y, f| x.intersection(y).all(f))
- But if you compile
unboxed.rs
directly... It works!
$ LD_LIBRARY_PATH=~/rust/build/x86_64-unknown-linux-gnu/stage1/lib ~/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc unboxed.rs && echo It works!
It works!