File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use std::os::raw::{c_int, c_void};
44use crate :: state:: { RawLua , WeakLua } ;
55
66/// A reference to a Lua (complex) value stored in the Lua auxiliary thread.
7- pub ( crate ) struct ValueRef {
7+ pub struct ValueRef {
88 pub ( crate ) lua : WeakLua ,
99 pub ( crate ) index : c_int ,
1010 pub ( crate ) drop : bool ,
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ pub enum Value {
6767 /// `Error` is a special builtin userdata type. When received from Lua it is implicitly cloned.
6868 Error ( Box < Error > ) ,
6969 /// Any other value not known to mlua (eg. LuaJIT CData).
70- #[ allow( private_interfaces) ]
71- Other ( ValueRef ) ,
70+ Other ( #[ doc( hidden) ] ValueRef ) ,
7271}
7372
7473pub use self :: Value :: Nil ;
Original file line number Diff line number Diff line change @@ -296,3 +296,25 @@ fn test_value_conversions() -> Result<()> {
296296
297297 Ok ( ( ) )
298298}
299+
300+ #[ test]
301+ fn test_value_exhaustive_match ( ) {
302+ match Value :: Nil {
303+ Value :: Nil => { }
304+ Value :: Boolean ( _) => { }
305+ Value :: LightUserData ( _) => { }
306+ Value :: Integer ( _) => { }
307+ Value :: Number ( _) => { }
308+ #[ cfg( feature = "luau" ) ]
309+ Value :: Vector ( _) => { }
310+ Value :: String ( _) => { }
311+ Value :: Table ( _) => { }
312+ Value :: Function ( _) => { }
313+ Value :: Thread ( _) => { }
314+ Value :: UserData ( _) => { }
315+ #[ cfg( feature = "luau" ) ]
316+ Value :: Buffer ( _) => { }
317+ Value :: Error ( _) => { }
318+ Value :: Other ( _) => { }
319+ }
320+ }
You can’t perform that action at this time.
0 commit comments