Commit 08bcd6d
rsscript: reserve
Generated helpers (`__TupleN`, `__rss_*` desugar temporaries, `__rsscript_*`
runtime symbols) all use a `__` prefix but the namespace wasn't reserved, so a
user declaration could collide. Reject user-declared function/type/sum/alias/
const names whose leaf begins with `__` (RS0015), exempting the synthetic
`__TupleN` structs the tuple desugar injects. No real code uses `__` names.
Test: fixtures/fail/reserved-double-underscore-name.rss; tuples still pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>__ prefix for compiler-generated helpers1 parent fd547c3 commit 08bcd6d
3 files changed
Lines changed: 49 additions & 9 deletions
File tree
- crates/rsscript
- src
- tests/fixtures/fail
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
| |||
1243 | 1250 | | |
1244 | 1251 | | |
1245 | 1252 | | |
| 1253 | + | |
1246 | 1254 | | |
1247 | 1255 | | |
1248 | 1256 | | |
1249 | 1257 | | |
1250 | 1258 | | |
1251 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1252 | 1288 | | |
1253 | 1289 | | |
1254 | 1290 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
| |||
0 commit comments