File tree 3 files changed +24
-3
lines changed 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};
4
4
use crate :: state:: { RawLua , WeakLua } ;
5
5
6
6
/// A reference to a Lua (complex) value stored in the Lua auxiliary thread.
7
- pub ( crate ) struct ValueRef {
7
+ pub struct ValueRef {
8
8
pub ( crate ) lua : WeakLua ,
9
9
pub ( crate ) index : c_int ,
10
10
pub ( crate ) drop : bool ,
Original file line number Diff line number Diff line change @@ -67,8 +67,7 @@ pub enum Value {
67
67
/// `Error` is a special builtin userdata type. When received from Lua it is implicitly cloned.
68
68
Error ( Box < Error > ) ,
69
69
/// Any other value not known to mlua (eg. LuaJIT CData).
70
- #[ allow( private_interfaces) ]
71
- Other ( ValueRef ) ,
70
+ Other ( #[ doc( hidden) ] ValueRef ) ,
72
71
}
73
72
74
73
pub use self :: Value :: Nil ;
Original file line number Diff line number Diff line change @@ -296,3 +296,25 @@ fn test_value_conversions() -> Result<()> {
296
296
297
297
Ok ( ( ) )
298
298
}
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