Commit 1df5c48
committed
fix(lower): don't double-borrow a read-PARAM passed as a read argument
A read-PARAM already lowers to &T, but the read-arg lowering added another & ->
&&T, producing ill-typed Rust (E0308) when e.g. pushing a read-param into an owned
collection (list_push(&mut v, &&node)) or building a recursive node from read children.
Mirror the existing mut-param case: when the read value is an ident bound to a read
param, emit the ident directly (already &T). Also generalized the managed_handle_arg
retain arms via lower_managed_read_ref. Unblocks ergonomic recursive-IR/graph code.
Regression fixture: tests/fixtures/pass/read-param-into-owned-collection.rss. cargo test green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent f49ac9a commit 1df5c48
2 files changed
Lines changed: 47 additions & 2 deletions
File tree
- crates/rsscript
- src/rust_lower
- tests/fixtures/pass
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
3072 | 3072 | | |
3073 | 3073 | | |
3074 | 3074 | | |
3075 | | - | |
| 3075 | + | |
3076 | 3076 | | |
3077 | 3077 | | |
3078 | 3078 | | |
| |||
3149 | 3149 | | |
3150 | 3150 | | |
3151 | 3151 | | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3152 | 3160 | | |
3153 | 3161 | | |
3154 | 3162 | | |
| |||
3349 | 3357 | | |
3350 | 3358 | | |
3351 | 3359 | | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
3352 | 3374 | | |
3353 | 3375 | | |
3354 | 3376 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments