Skip to content

Replace auto and chained .build().value() with explicit rs_std::Result types in security/regex - #202

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1004390468
Oct 23, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1004390468

Conversation

@copybara-service

Copy link
Copy Markdown

Replace auto and chained .build().value() with explicit rs_std::Result types in security/regex

With Crubit's movable_return_values feature, cc_bindings_from_rs returns rs_std::Result<T, E> by value wrapped in ::rs::Movable<rs_std::Result<T, E>>, which implicitly converts to rs_std::Result<T, E> via operator rs_std::Result<T, E>() &&. Using auto or calling .value() directly on the return value of build() accesses ::rs::Movable instead of rs_std::Result. Materializing the result into an explicit rs_std::Result<...> variable works both before and after movable_return_values is enabled.

…Result` types in `security/regex`

With Crubit's `movable_return_values` feature, `cc_bindings_from_rs` returns `rs_std::Result<T, E>` by value wrapped in `::rs::Movable<rs_std::Result<T, E>>`, which implicitly converts to `rs_std::Result<T, E>` via `operator rs_std::Result<T, E>() &&`. Using `auto` or calling `.value()` directly on the return value of `build()` accesses `::rs::Movable` instead of `rs_std::Result`. Materializing the result into an explicit `rs_std::Result<...>` variable works both before and after `movable_return_values` is enabled.

PiperOrigin-RevId: 1005780449
@copybara-service
copybara-service Bot merged commit 6be4c62 into main Oct 23, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_1004390468 branch October 23, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant