Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Add warning about using stdweb::unstable::TryInto #21

Closed
wants to merge 1 commit into from
Closed

Add warning about using stdweb::unstable::TryInto #21

wants to merge 1 commit into from

Conversation

HeyZoos
Copy link

@HeyZoos HeyZoos commented Feb 1, 2020

Co-authored-by: @jplatte
Adds a warning to alert users to a subtle error caused by using the stdweb::unstable::TryIntro trait with NodeRef's try_into function.

image

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
@HeyZoos HeyZoos requested a review from jstarry February 1, 2020 23:22
@jstarry
Copy link
Member

jstarry commented Feb 2, 2020

@HeyZoos does this not happen when std::convert::TryInto is in scope?

@HeyZoos
Copy link
Author

HeyZoos commented Feb 4, 2020

No longer relevant due to yewstack/yew#917

@HeyZoos HeyZoos closed this Feb 4, 2020
@jplatte
Copy link

jplatte commented Feb 4, 2020

I found out why the compiler prefered the trait method over the inherent method when the former was in scope: Because resolving to the inherent method would require autoref, while resolving to the trait method didn't. See this playground.

I have no idea whether this is intended behavior, let's see what the rustc devs think about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants