I’ve been playing around with rust implementing a linear algebra library and I’ve come across a weird problem.
Here is a snippet of my code for points and vectors: https://play.rust-lang.org/?gist=0fd9a9d531baaef27c83366037bee60e&version=stable&backtrace=0
As you can see, it works just fine. But if instead of a bin I try to put the same code in a lib and execute the main code in a test I get the following (I’ve also split it across files):
vec.rs:209:20: 209:29 error: overflow evaluating the requirement
<&_ as std::ops::Add<_>>::Output [E0275]
vec.rs:209 assert_eq!(&p1 + &p2, exp_result);
vec.rs:209:20: 209:29 note: consider adding a
#![recursion_limit="128"] attribute to your crate
The problem persist no even with recursion_limit=“512”.
What is happening?