Skip to content

Commit 68f8930

Browse files
committed
Remove obsolete workaround for #11040, derive PartialEq
rust-lang/rust#11040 is fixed, so the workaround can be removed. Deriving Eq now requires deriving PartialEq as well.
1 parent 59e64dd commit 68f8930

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub mod Type {
8484
use std::{ptr, str};
8585

8686
/// Lua value types
87-
#[deriving(Clone,Eq,Show)]
87+
#[deriving(Clone,PartialEq,Eq,Show)]
8888
pub enum Type {
8989
/// Type for nil
9090
Nil = raw::LUA_TNIL,

raw.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,12 @@ extern {
9797
pub fn lua_tolstring(L: *mut lua_State, idx: c_int,
9898
len: *mut libc::size_t) -> *libc::c_char;
9999
pub fn lua_objlen(L: *mut lua_State, idx: c_int) -> libc::size_t;
100-
// FIXME(#11040): fn -> Option<extern fn> is not immediate on 32-bit linux
101-
#[cfg(not(target_os="macos"), not(target_os="windows"))]
102-
#[link_name="lua_tocfunction"]
103-
pub fn lua_tocfunction_(L: *mut lua_State, idx: c_int) -> *libc::c_void;
104-
#[cfg(target_os="macos")]
105-
#[cfg(target_os="windows")]
106100
pub fn lua_tocfunction(L: *mut lua_State, idx: c_int) -> Option<lua_CFunction>;
107101
pub fn lua_touserdata(L: *mut lua_State, idx: c_int) -> *mut libc::c_void;
108102
pub fn lua_tothread(L: *mut lua_State, idx: c_int) -> *mut lua_State;
109103
pub fn lua_topointer(L: *mut lua_State, idx: c_int) -> *libc::c_void;
110104
}
111105

112-
#[cfg(not(target_os="macos"), not(target_os="windows"))]
113-
#[inline(always)]
114-
// FIXME(#11040)
115-
pub unsafe fn lua_tocfunction(L: *mut lua_State, idx: c_int) -> Option<lua_CFunction> {
116-
::std::cast::transmute(lua_tocfunction_(L, idx))
117-
}
118-
119106
// Push functions (C -> stack)
120107
extern {
121108
pub fn lua_pushnil(L: *mut lua_State);

tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn test_openlibs() {
7171
assert_eq!(s.type_(-1), Some(Type::Table));
7272
}
7373

74-
#[deriving(Eq,Show)]
74+
#[deriving(PartialEq,Eq,Show)]
7575
enum CheckOptionEnum {
7676
COEOne,
7777
COETwo,

0 commit comments

Comments
 (0)