You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As pointed out by @paulmure in #793, the current view API for concrete ident is limited.
As discussed there, we might either (1) expose the raw types as #793 suggests or (2) build a more expressive API.
I'm in favor of (2) because:
the representation of concrete idents in the engine is complex: it's basically rustc DefIds + a kind we compute in import_thir
there are invariants on those concrete idents, I'd like them to be contained in this module
the view API exists because I want to ensure monolithically that we don't produce a same backend identifier for two different Rust identifiers.
The danger of (2) is to end up with a complex and messy view API.
The purpose of this issue is to describe the various missing functionality of this view API, and to track refactoring work to make it more modular.
Expressiveness: name policy
reserved words: a list of keywords that should be escaped (valid identifiers in Rust are not always valid in the target backend)
transform numeric fields on structs: tuple structs can be accessed via e.g. x.1 in Rust, sometimes not in the backend, so we need to rename
control prefixes added by the name API (as suggested by @paulmure in Raw view on concrete_ident #793). We currently hardcode many rules, e.g. rename constructor that begins with anything else but an uppercase Latin letter. We should be able to configure those rules: what prefix is added, when.
control how much of the fully qualified path is used based on what’s currently imported (quoting @paulmure)
Please comment if you think about something here!
The text was updated successfully, but these errors were encountered:
This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.
As pointed out by @paulmure in #793, the current view API for concrete ident is limited.
As discussed there, we might either (1) expose the raw types as #793 suggests or (2) build a more expressive API.
I'm in favor of (2) because:
DefId
s + a kind we compute in import_thirThe danger of (2) is to end up with a complex and messy view API.
The purpose of this issue is to describe the various missing functionality of this view API, and to track refactoring work to make it more modular.
Expressiveness: name policy
x.1
in Rust, sometimes not in the backend, so we need to renameconcrete_ident
#793). We currently hardcode many rules, e.g. rename constructor that begins with anything else but an uppercase Latin letter. We should be able to configure those rules: what prefix is added, when.The text was updated successfully, but these errors were encountered: