Repository navigation
Conversation
…d time duration calls (fixes limitlessprojects#4308) Convert the inline `encoding/hex` and `time.{milliseconds,seconds,minutes,hours}` arity guards in `buildable.rs` into spread-first `else if` checks matching the landed limitlessprojects#4271 / limitlessprojects#4273 idiom so `hex.encode_to_string(xs...)`, `hex.decode(dst, xs...)`, and `time.seconds(ns...)` fail closed with HYB-E1002 instead of escaping to `go build`.
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.
Fixes #4308
Summary
Extends the inline
encoding/hex(#4238) andtime.{milliseconds,seconds,minutes,hours}call checks incompiler/crates/hy-check/src/buildable.rswith the same spread-firstif args.iter().any(|a| a.spread)guard landed in #4271 and #4273 (GUARANTEES.mdRow 13BUILDABLE):...) on all 10 non-variadicencoding/hexfunctions (encode,encode_to_string,decode_string,dump,dumper,encoded_len,decoded_len,new_encoder,new_decoder,decode) withHYB-E1002....) ontime.milliseconds,time.seconds,time.minutes, andtime.hourswithHYB-E1002, while keeping all non-spread numeric calls accepted.compiler/crates/hy-check/tests/hex_member_arity_buildable_4085.rs(hex_non_variadic_spread_rejected_e1002andtime_duration_constructors_reject_variadic_spread_e1002).Verification
cargo test -p hy-check --test hex_member_arity_buildable_4085(8 passed; 0 failed)