Skip to content

Fix ICE in label_fn_like for splatted args and add UI tests#1

Closed
Ajay-singh1 wants to merge 2 commits into
teor2345:fn-arg-splat-experimentfrom
Ajay-singh1:pr-153697
Closed

Fix ICE in label_fn_like for splatted args and add UI tests#1
Ajay-singh1 wants to merge 2 commits into
teor2345:fn-arg-splat-experimentfrom
Ajay-singh1:pr-153697

Conversation

@Ajay-singh1
Copy link
Copy Markdown

@Ajay-singh1 Ajay-singh1 commented Jun 3, 2026

This PR builds on top of rust-lang#153697 (teor's #[splat] implementation).

Bug Fix

While writing UI tests for the unhappy path of the overload-at-home example, I discovered an ICE when calling a splatted function with an argument combination that has no registered impl:

foo.method(42i32, 42i32); // no impl for (i32, i32)
// ICE: arg index 1 out of bounds for method with 1 inputs

The condition !tuple_arguments.is_splatted() in label_fn_like was inverted , the safe use_splat_fallback path ran for non-splatted functions, and the span_bug! fired for splatted ones. Fix is removing the !.

After the fix the compiler gives a clean error instead:

error[E0308]: mismatched types expected String, found i32

Copy link
Copy Markdown
Owner

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, it looks good!

I'd like to do a detailed review, but that would be better at rust-lang/rust, so other reviewers can see it.
It will also run the full CI suite.

Can you open a draft PR with this branch at https://github.com/rust-lang/rust/pulls ?
Please say in the description that it's based on rust-lang#153697

Here's an example of another PR that's based on that PR:
rust-lang#155852

@Ajay-singh1
Copy link
Copy Markdown
Author

Ajay-singh1 commented Jun 4, 2026 via email

@Ajay-singh1
Copy link
Copy Markdown
Author

Closing this one in favour of rust-lang#157434

@Ajay-singh1 Ajay-singh1 closed this Jun 4, 2026
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.

2 participants