Attempt to enable compiletest_rs on nightly on travis

This commit is contained in:
kyren
2018-02-10 00:26:48 -05:00
parent f785a3abe4
commit d4c80d44c8
7 changed files with 91 additions and 56 deletions
-52
View File
@@ -744,55 +744,3 @@ fn too_many_binds() {
.is_err()
);
}
// TODO: Need to use compiletest-rs or similar to make sure these don't compile.
/*
#[test]
fn should_not_compile() {
let lua = Lua::new();
let globals = lua.globals();
// Should not allow userdata borrow to outlive lifetime of AnyUserData handle
struct MyUserData;
impl UserData for MyUserData {};
let userdata_ref;
{
let touter = globals.get::<_, Table>("touter").unwrap();
touter.set("userdata", lua.create_userdata(MyUserData)).unwrap();
let userdata = touter.get::<_, AnyUserData>("userdata").unwrap();
userdata_ref = userdata.borrow::<MyUserData>();
}
// Should not allow self borrow of lua, it can change addresses
globals.set("boom", lua.create_function(|_, _| {
lua.eval::<i32>("1 + 1", None)
})).unwrap();
// Should not allow Scope references to leak
struct MyUserdata(Rc<()>);
impl UserData for MyUserdata {}
let lua = Lua::new();
let mut r = None;
lua.scope(|scope| {
r = Some(scope.create_userdata(MyUserdata(Rc::new(()))).unwrap());
});
struct Test {
field: i32,
}
let lua = Lua::new();
lua.scope(|scope| {
let mut test = Test { field: 0 };
let f = scope
.create_function(|_, ()| {
test.field = 42;
Ok(())
})
.unwrap();
lua.globals().set("bad!", f).unwrap();
});
}
*/