refactor(ast, linter, semantic, transformer): replace Address::from_ref with UnstableAddress::unstable_address#15701
Merged
graphite-app[bot] merged 1 commit intomainfrom Nov 14, 2025
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Nov 14, 2025
CodSpeed Performance ReportMerging #15701 will not alter performanceComparing Summary
Footnotes |
camc314
approved these changes
Nov 14, 2025
Contributor
Merge activity
|
…ref` with `UnstableAddress::unstable_address` (#15701) Migrate all uses of `Address::from_ptr` and `Address::from_ref` to `UnstableAddress::unstable_address` across whole codebase, except for in `oxc_traverse`, which has particular requirements around aliasing, and can't use `unstable_address`. This makes no difference to behavior or performance, it's just a more reliable API.
graphite-app bot
pushed a commit
that referenced
this pull request
Nov 14, 2025
`Address::from_ptr` is hard to use correctly (as evidenced by rolldown/rolldown#6961). Introduce a new trait `UnstableAddress` which has a few more guardrails. ### Migration We should swap all usage of `Address::from_ptr` for `UnstableAddress::unstable_address`. When `Address::from_ptr` is being used correctly, it can easily be swapped out: ```diff - let address = Address::from_ptr(node); + let address = node.unstable_address(); ``` But if `Address::from_ptr` was being used incorrectly, migrating to `unstable_address` will reveal that problem with a compilation error. `unstable_address` (as the name suggests) does not give the same guarantees about the stability of the `Address` it returns as `GetAddress::address` does. The name of the method makes that explicit. More details in the doc comment in this PR. ### Migration plan * #15701 migrates all usage of `Address::from_ptr` and `Address::from_ref` in Oxc's codebase to `unstable_address` (except in `oxc_traverse`, which has particular requirements around aliasing, and can't use `unstable_address`). * #15702 removes `Address::from_ref`. * Once this PR lands in an Oxc release, we can migrate Rolldown to `unstable_address`. * In next Oxc release after that, we'll make `Address::from_ptr` an unsafe method, to discourage its use. * At a future date, we can migrate `oxc_traverse` to using `NonNull` pointers instead of `*const` pointers, and get rid of `Address::from_ptr` entirely.
29dacc6 to
8a61cfd
Compare
e41fd89 to
ceba085
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Nov 14, 2025
Remove `Address::from_ref` method. #15701 removed all usage in Oxc, and this method was only introduced a few weeks ago, so I doubt it's used in Rolldown either.
Base automatically changed from
11-13-feat_allocator_ast_introduce_unstableaddress_trait
to
main
November 14, 2025 15:07
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
…15700) `Address::from_ptr` is hard to use correctly (as evidenced by rolldown/rolldown#6961). Introduce a new trait `UnstableAddress` which has a few more guardrails. ### Migration We should swap all usage of `Address::from_ptr` for `UnstableAddress::unstable_address`. When `Address::from_ptr` is being used correctly, it can easily be swapped out: ```diff - let address = Address::from_ptr(node); + let address = node.unstable_address(); ``` But if `Address::from_ptr` was being used incorrectly, migrating to `unstable_address` will reveal that problem with a compilation error. `unstable_address` (as the name suggests) does not give the same guarantees about the stability of the `Address` it returns as `GetAddress::address` does. The name of the method makes that explicit. More details in the doc comment in this PR. ### Migration plan * oxc-project#15701 migrates all usage of `Address::from_ptr` and `Address::from_ref` in Oxc's codebase to `unstable_address` (except in `oxc_traverse`, which has particular requirements around aliasing, and can't use `unstable_address`). * oxc-project#15702 removes `Address::from_ref`. * Once this PR lands in an Oxc release, we can migrate Rolldown to `unstable_address`. * In next Oxc release after that, we'll make `Address::from_ptr` an unsafe method, to discourage its use. * At a future date, we can migrate `oxc_traverse` to using `NonNull` pointers instead of `*const` pointers, and get rid of `Address::from_ptr` entirely.
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
…ref` with `UnstableAddress::unstable_address` (oxc-project#15701) Migrate all uses of `Address::from_ptr` and `Address::from_ref` to `UnstableAddress::unstable_address` across whole codebase, except for in `oxc_traverse`, which has particular requirements around aliasing, and can't use `unstable_address`. This makes no difference to behavior or performance, it's just a more reliable API.
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
…15702) Remove `Address::from_ref` method. oxc-project#15701 removed all usage in Oxc, and this method was only introduced a few weeks ago, so I doubt it's used in Rolldown either.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Migrate all uses of
Address::from_ptrandAddress::from_reftoUnstableAddress::unstable_addressacross whole codebase, except for inoxc_traverse, which has particular requirements around aliasing, and can't useunstable_address.This makes no difference to behavior or performance, it's just a more reliable API.