Use compiletest to make sure unsafe things do not compile#46
Use compiletest to make sure unsafe things do not compile#46jonas-schievink wants to merge 2 commits intomlua-rs:masterfrom jonas-schievink:compile-fail
Conversation
|
Oh yeah, Travis fails since this only works on nightly. Give me a second. |
UGH. Why isn't there a more elegant and usable solution for compile-fail tests? They're pretty important for all sorts of crates... |
|
I ended up working off of what you had and managed to get compiletests_rs working on travis as of 1426bdb. I didn't put compiletest_rs in [dev-dependencies], but it is optional? I'm not sure if I have it set up in the most optimal way. |
|
@kyren Very nice! The only issue with making compiletest a regular dependency is that downstream crates can now request the Eventually I'll revisit my plans to make compile-fail tests more accessible, probably after rust-lang/cargo#4734 lands or rust-lang/rfcs#2318 is accepted and implemented. Also closing, since this is implemented now. |
I only added 2 tests I found in
tests.rs, it would be nice to gather more. If anyone finds something unsafe that we should test against, please leave a comment.