feat: respect user provided borrow annotations#12830
Conversation
|
!bench |
|
Benchmark results for d72df3e against 68ea28c are in! @hargoniX
Small changes (2🟥)
|
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
fc73a4b to
b420b35
Compare
|
!bench |
|
Benchmark results for d939de5 against 0917260 are in. Significant changes detected! @hargoniX
Large changes (5✅)
Medium changes (17✅)
Small changes (20✅, 2🟥) Too many entries to display here. View the full report on radar instead. |
|
!bench |
|
Benchmark results for 162987d against 0917260 are in. Significant changes detected! @hargoniX
Large changes (9✅)
Medium changes (30✅) Too many entries to display here. View the full report on radar instead. Small changes (1169✅, 3🟥) Too many entries to display here. View the full report on radar instead. |
|
!bench |
|
Benchmark results for 22476d4 against 0917260 are in. Significant changes detected! @hargoniX
No significant changes detected. |
|
!bench |
22476d4 to
74b71dc
Compare
|
Benchmark results for 74b71dc against 0917260 are in. Significant changes detected! @hargoniX
Large changes (9✅)
Medium changes (37✅) Too many entries to display here. View the full report on radar instead. Small changes (1229✅, 2🟥) Too many entries to display here. View the full report on radar instead. |
11f3364 to
c6145e6
Compare
|
!bench |
c6145e6 to
3b22c54
Compare
|
Benchmark results for 3b22c54 against 5e1b6ed are in. Significant changes detected! @hargoniX
Medium changes (1✅)
Small changes (21✅, 3🟥) Too many entries to display here. View the full report on radar instead. |
3b22c54 to
f45f5e7
Compare
This PR enables support for respecting user provided borrow annotations. This allows user to mark arguments of their definitions or local functions with
(x : @&Ty)and have the borrow inference try its best to preserve this annotation, thus potentially reducing RC pressure. Note that in some cases this might not be possible. For example, the compiler prioritizes preserving tail calls over preserving borrow annotations. A precise reasoning of why the compiler chose to make its inference decisions can be obtained withtrace.Compiler.inferBorrow.The implementation consists of two parts: