Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguate the associated function Into implementation not recognized and not automatically selected #6858

Open
bitzoic opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged

Comments

@bitzoic
Copy link
Member

bitzoic commented Jan 23, 2025

#6857 introduces Into<Bytes> for a number of stack types. However, if the following syntax is used the compiler will not automatically recognize which Into implementation is the correct one.

let my_asset = AssetId::zero();
let my_bytes: Bytes = my_asset.into();
Image

As a result, the following is required as a work around.

let my_asset = AssetId::zero();
let my_bytes: Bytes = <AssetId as Into<Bytes>>::into(my_asset);

The compiler should automatically determine which Into implementation is appropriate.

@bitzoic bitzoic added bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged labels Jan 23, 2025
@bitzoic bitzoic changed the title Correct Into implementation not recognized and not automatically used Correct Into implementation not recognized and not automatically selected Jan 23, 2025
@bitzoic bitzoic changed the title Correct Into implementation not recognized and not automatically selected Disambiguate the associated function Into implementation not recognized and not automatically selected Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

No branches or pull requests

1 participant