@@ -288,7 +288,7 @@ impl JitOptions {
288288
289289 /// Toggles the runtime bytecode inliner.
290290 ///
291- /// Disabled by default. Changing this option does not affect already loaded functions .
291+ /// Disabled by default. Enable before compiling and executing code .
292292 #[ must_use]
293293 pub const fn inliner ( mut self , enabled : bool ) -> Self {
294294 self . inliner = enabled;
@@ -1325,8 +1325,6 @@ impl Lua {
13251325 unsafe {
13261326 let state = lua. main_state ( ) ;
13271327 if options. inliner {
1328- let _ = Self :: set_fflag ( "LuauCallFeedback" , true ) ;
1329- let _ = Self :: set_fflag ( "LuauEmitCallFeedback" , true ) ;
13301328 ffi:: luau_enable_jit_inliner ( state) ;
13311329 } else {
13321330 ffi:: luau_disable_jit_inliner ( state) ;
@@ -1336,11 +1334,16 @@ impl Lua {
13361334
13371335 /// Sets Luau feature flag (global setting).
13381336 ///
1337+ /// Flags must be configured before creating any Lua VMs or compiling any Luau code.
1338+ /// This function must not run concurrently with any other Luau operation, including itself.
1339+ /// Changing flags later can cause data races or invalidate compiled bytecode.
1340+ ///
13391341 /// See https://github.com/luau-lang/luau/blob/master/CONTRIBUTING.md#feature-flags for details.
13401342 #[ cfg( feature = "luau" ) ]
13411343 #[ doc( hidden) ]
13421344 #[ allow( clippy:: result_unit_err) ]
13431345 pub fn set_fflag ( name : & str , enabled : bool ) -> StdResult < ( ) , ( ) > {
1346+ // TODO: Make this function unsafe in the next breaking release.
13441347 if let Ok ( name) = std:: ffi:: CString :: new ( name)
13451348 && unsafe { ffi:: luau_setfflag ( name. as_ptr ( ) , enabled as c_int ) != 0 }
13461349 {
0 commit comments