luau/CodeGen/include/Luau
vegorov-rbx 55f3e00938
Sync to upstream/release/687 (#1954)
## What's Changed?

This week we have an update with an implementation for one of the RFCs
we had approved before, an improvement of the new type solver and a
small Lua 5.1 C API compatibility improvement.

* `@deprecated` attribute can now have a custom suggestion for a
replacement and a reason message as described in [deprecated attribute
parameters
RFC](https://rfcs.luau.org/syntax-attribute-functions-deprecated.html)

For example:
```luau
@[deprecated {reason = "foo suffers from performance issues", use = "bar"}]
local function foo()
    ...
end

-- Function 'foo' is deprecated, use 'bar' instead. foo suffers from performance issues
foo()
```

* `lua_cpcall` C API function has been restored both for compatibility
with Lua 5.1 and as a safe way to enter protected call environment to
work with Luau C API functions that may error

Instead of
```
if (!lua_checkstack(L, 2))
    return -1;
lua_pushcfunction(L, test, nullptr);
lua_pushlightuserdata(L, context);
int status = lua_pcall(L, 1, 0, 0);
```
you can simply do 
```
int status = lua_cpcall(L, test, context);
```

* In Luau CLI, required module return values can now have any type

## New Type Solver
- Additional improvements on type refinements used with external types
should fix some reported false positive errors where types refined to
`never`
- Fixed an issue in recursive refinement types in a form of `t1 where t1
= refine<t1, _>` getting 'stuck'
- Fixed an issue in subtyping of generic functions, it is now possible
to assign `<T>(T, (T) -> T) -> T` to `(number, <X>(X) -> X) -> number`
- Fixed an ICE caused by recursive types (Fixes #1686)
- Added additional iteration and recursion limits to stop the type
solver before system resources are used up

## Internal Contributors

Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Annie Tang <annietang@roblox.com>
Co-authored-by: Ariel Weiss <aaronweiss@roblox.com>
Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com>
Co-authored-by: Ilya Rezvov <irezvov@roblox.com>
Co-authored-by: Sora Kanosue <skanosue@roblox.com>
Co-authored-by: Vighnesh Vijay <vvijay@roblox.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
2025-08-15 11:48:43 -07:00
..
AddressA64.h Sync to upstream/release/613 (#1167) 2024-02-15 18:04:39 -08:00
AssemblyBuilderA64.h CodeGen: Rewrite dot product lowering using a dedicated IR instruction (#1512) 2024-11-08 16:23:09 -08:00
AssemblyBuilderX64.h CodeGen: Implement support for math.lerp lowering (#1609) 2025-01-16 10:48:27 -08:00
BytecodeAnalysis.h Sync to upstream/release/625 (#1252) 2024-05-10 11:21:45 -07:00
BytecodeSummary.h Sync to upstream/release/613 (#1167) 2024-02-15 18:04:39 -08:00
CodeAllocator.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
CodeBlockUnwind.h Sync to upstream/release/576 (#928) 2023-05-12 10:50:47 -07:00
CodeGen.h Sync to upstream/release/675 (#1845) 2025-05-27 14:24:46 -07:00
CodeGenCommon.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
CodeGenOptions.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
ConditionA64.h Sync to upstream/release/573 (#903) 2023-04-21 15:14:26 -07:00
ConditionX64.h Sync to upstream/release/613 (#1167) 2024-02-15 18:04:39 -08:00
IrAnalysis.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
IrBuilder.h Sync to upstream/release/678 (#1878) 2025-06-13 09:36:35 -07:00
IrCallWrapperX64.h Sync to upstream/release/572 (#899) 2023-04-14 11:06:22 -07:00
IrData.h Sync to upstream/release/682 (#1912) 2025-07-11 11:36:47 -07:00
IrDump.h Sync to upstream/release/678 (#1878) 2025-06-13 09:36:35 -07:00
IrRegAllocX64.h Sync to upstream/release/596 (#1050) 2023-09-22 12:12:15 -07:00
IrUtils.h Sync to upstream/release/670 (#1779) 2025-04-18 13:44:39 -07:00
IrVisitUseDef.h Sync to upstream/release/678 (#1878) 2025-06-13 09:36:35 -07:00
Label.h Sync to upstream/release/529 (#505) 2022-05-26 15:08:16 -07:00
LoweringStats.h Sync to upstream/release/657 (#1619) 2025-01-17 14:55:39 -08:00
NativeProtoExecData.h Sync to upstream/release/620 (#1223) 2024-04-05 13:45:09 -07:00
OperandX64.h Sync to upstream/release/674 (#1832) 2025-05-16 12:39:58 -07:00
OptimizeConstProp.h Sync to upstream/release/687 (#1954) 2025-08-15 11:48:43 -07:00
OptimizeDeadStore.h Sync to upstream/release/616 (#1184) 2024-03-08 16:47:53 -08:00
OptimizeFinalX64.h Sync to upstream/release/563 (#833) 2023-02-10 11:40:38 -08:00
RegisterA64.h Sync to upstream/release/674 (#1832) 2025-05-16 12:39:58 -07:00
RegisterX64.h Sync to upstream/release/674 (#1832) 2025-05-16 12:39:58 -07:00
SharedCodeAllocator.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
UnwindBuilder.h Sync to upstream/release/674 (#1832) 2025-05-16 12:39:58 -07:00
UnwindBuilderDwarf2.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00
UnwindBuilderWin.h Sync to upstream/release/637 (#1354) 2024-08-02 07:30:04 -07:00