Skip to content

v0.25.58

Choose a tag to compare

@Goldziher Goldziher released this 21 Jun 14:34
· 41 commits to main since this release
v0.25.58
2c6aa0d

Fixed

  • codegen: long signatures preserve backend-aware parameter types: the free-function
    generator wraps a signature across multiple lines once its single-line parameter list
    exceeds 100 characters. That wrapped path recomputed each parameter's type with a generic
    Option<T> promotion, discarding the backend-specific mapping used for the single-line form
    (notably extendr's Nullable<&T> for optional/promoted non-opaque DTO parameters). The
    recomputed signature then disagreed with the generated body — which still marshalled the
    parameter via Nullable::into_option() — producing E0599/E0277 in the binding crate. The
    wrapped path now reuses the exact per-parameter strings computed for the single-line form, so
    long and short signatures are always type-identical. PyO3 output is unchanged (both paths
    already produced the same Option<T> promotion). Surfaced as a non-compiling extendr binding
    for functions like check_format_limits whose parameter list crosses the wrap threshold.
  • ffi/java: export named opaque static constructors: static methods on opaque
    types that return Self or Result<Self, E> are now emitted as C constructor
    exports using the Rust method name, such as {prefix}_{type}_compile, instead
    of only recognizing new. The Java downcall template now reports the missing
    symbol names and feature hint in ExceptionInInitializerError when a native
    export is absent.
  • r/extendr: improve optional and by-reference DTO argument marshalling:
    optional non-opaque named parameters use extendr_api::Nullable<&T> in the
    binding surface (now consistently, including wrapped long signatures — see the
    codegen fix above), clone through the referenced wrapper, and participate in JSON
    bridging when a named return type already requires JSON serialization. Call
    arguments now preserve whether the core function expects by-value, &T, or
    &mut T, and by-value passing no longer forces an erroneous & (fixes
    score_confidence). Some extendr binding paths remain incomplete (slice &[&str]
    parameters, Nullable<&T>::into_option trait bounds, uint→i32 call-site
    cast-back, and KreuzbergError → extendr_api::Error conversion); the R crate is
    not yet fully compiling and is tracked separately.
  • elixir/rustler: fix sync argument conversions and enum atoms: optional
    binary parameters now convert to Option<&[u8]> or owned Vec<u8> correctly,
    JSON string parameters deserialize to serde_json::Value, borrowed BTreeMap
    parameters get a stable local binding, and serde-renamed enum variants with
    punctuation emit quoted atoms in @type while reserved Elixir words still get
    safe public accessor names.
  • swift: expose first-class struct bridge aliases: first-class Swift DTOs now
    emit deterministic public typealias TypeRef and TypeRefMut aliases to their
    RustBridge counterparts so generated initializers and intoRust() helpers
    can reference the swift-bridge class hierarchy.
  • kotlin-android: keep optional byte inputs typed as bytes: optional
    Bytes/Vec<u8> facade parameters are now declared as ByteArray? instead of
    String?, while bridge calls continue to base64-encode the value.
  • ruby/magnus: bind named DTO parameters consistently: when Vec<Named>
    arguments force the _core call-argument path, scalar named DTO parameters now
    receive matching {name}_core let bindings so generated call sites resolve.
  • php: keep cfg-gated methods visible to #[php_impl]: generated PHP static
    methods wrap source cfg predicates in an always-true cfg expression so
    ext-php-rs can resolve method signatures during macro expansion.
  • typescript e2e: dispose plugin stubs during cleanup: generated cleanup code
    now calls dispose() after unregistering plugin bridges to release retained
    TSFN references.
  • go: alias the host capsule import so goimports cannot strip it: a
    capsule return type ([crates.go.capsule_types]) whose host package name
    differs from the import path's last element (e.g. package tree_sitter from
    github.com/tree-sitter/go-tree-sitter) was emitted as an unaliased import.
    In the cgo binding file goimports cannot resolve the package name from the
    path, treats the import as unused, and removes it — leaving the body
    referencing tree_sitter.* with no import, which fails to compile. Emit the
    import with an explicit alias derived from host_type (tree_sitter "…") so
    it is matched syntactically and survives formatting. Surfaced as a broken Go
    binding after prek/goimports ran in a consumer repo.
  • go: mark the generated cmd/download_ffi/main.go tool as generated: 0.25.x
    dropped the //go:build ignore guard from the download tool so it can be run
    directly (go run ./cmd/download_ffi). Without the build guard golangci-lint
    began linting it and failing on issues inherent to a downloader (gosec
    G107/G304/G110, errcheck on deferred Close, goconst), which the
    guard had previously hidden. The scaffold-generated .golangci.yml already
    excludes generated files via generated: lax, but the tool carried no
    generated marker, so it was linted as ordinary source. Emit the standard
    // This file is auto-generated by alef — DO NOT EDIT. header line so
    generated: lax skips it, matching every other generated Go file. Surfaced as
    golangci-lint/godoc-lint failures in consumer repos after the regen.