bugfix - materialize imported const str arguments (#638)#639
Merged
dannymeijer merged 1 commit intoMay 22, 2026
Merged
Conversation
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.
Summary
This PR fixes imported public
const strvalues at owned Incanstrcall sites. Public const metadata can arrive as a frozen string shape while the generated Rust item is still&'static str; the backend now treats borrowed/static/frozen string-like IR shapes as owned-string materialization candidates at Incan sinks, and string method receivers useAsRef<str>instead of emitting unstable.as_str()on raw&strconstants.It also bumps the release candidate to
0.3.0-rc8and records #638 in the v0.3 release notes.Type of change
docs/RFCs/*)Area(s)
Select the primary areas touched (used for review routing; labels are managed separately):
Key details
from registry import TOKENwhereTOKENispub const TOKEN: str = "token"now works instrarguments, explicitTOKEN.to_string(), localstrassignment, and ordinary string methods.StaticStr,StrRef, andFrozenStr, avoiding the priorStaticStr-only materialization gap.FrozenStrreceiver lowering now relies onAsRef<str>, which is intentionally broader than.as_str()and covered by both explicitFrozenStrsmoke coverage and the imported-const repro.Testing / verification
make test/cargo testmake examples(if relevant)incan fmt --check .(if relevant)Manual verification notes:
cargo test e2e_imported_const_str_materializes_at_test_call_sitescargo test frozen_str_var_to_stringtarget/debug/incan test testsin/private/tmp/incan-638-imported-const-strtarget/debug/incan run -c <FrozenStr smoke>git diff --checkmake pre-commitmake -C /Users/danny/Development/encero/InQL ci INCAN=/Users/danny/Development/encero/tmp/incan-636-api-metadata-decorated-signatures/target/debug/incanDocs impact
If docs updated:
workspaces/docs-site/docs/release_notes/0_3.mdChecklist
Closes #638