Because it's now assumed that `<T as AsExpression<SomeType>>::Output` is `T`, and there are other bounds required. So now we have 4 errors about traits not being implemented when there should be one, and none of them mention `SomeType` which is the only relevant piece of info.
-
-
Replying to @sgrif
That sounds like a very reasonable thing to change. I wonder if there's an open issue along those lines... Also I'm wondering how it could be changed without it ever being incorrect.
1 reply 0 retweets 0 likes -
Replying to @ekuber
I've got an RFC I'm writing to provide an attribute which can be placed on impls to tell rustc "Please do not recommend this impl". Explicit annotation is the only fix in this case I think. My desired behavior in *this* case is "Follow the impl chain to N-1 places"
1 reply 0 retweets 1 like -
This would also help in cases where you want Rust to recommend another impl, but it doesn't because there are two "possible" cases that could apply (even though one never does)
1 reply 0 retweets 1 like -
There's a few cases like that in Diesel right now, and they're the difference between "<3 page long type>: ExecuteDsl is not satisfied" and "String: FromSql<Integer> is not satisfied"
1 reply 0 retweets 0 likes -
Replying to @sgrif
It does sound like an annotation with "similar" behavior to `rustc_on_unimplemented` would be enough for your case, but it'd be nice if rustc had better behavior for this case by default (I want to minimize how many hints library writers need to add for us to do the right thing).
1 reply 0 retweets 0 likes -
Replying to @ekuber
Heh. The "motivation" section of this RFC specifically talks about how the current behavior causes the "rustc_on_unimplemented" attribute to be shown in places that it shouldn't, where it is specifically harmful
1 reply 0 retweets 1 like -
Replying to @sgrif
There's some work around matching in that attribute to avoid that problem: https://github.com/rust-lang/rust/issues/44755 …
1 reply 0 retweets 0 likes -
(Unless I'm misunderstanding the problem)
1 reply 0 retweets 0 likes -
Replying to @ekuber
That seems like the wrong approach. There's never a case where "`T: Iterator` is not satisfied" is more useful than "Try calling `.iter()` or a similar method". Stating "don't change your error due to this impl" so that we see "`T: IntoIterator` is not satisfied" is more helpful
1 reply 0 retweets 0 likes
Twitter is also a bit too brief to discuss this. That example is flawed because the `rustc_on_unimplemented` attr of `Iterator` probably actually belongs on `IntoIterator`, and is in its current place to work around this general issue. Hopefully I will have the RFC by Friday
-
-
Replying to @sgrif
Will be eager to see it! I feel that the solution is better fitting cases like iterating over a &str, where .iter() doesn't exist, but .chars() does: https://github.com/rust-lang/rust/issues/46216 … I also think that very few of these suggestions should be completely unbounded.
1 reply 0 retweets 0 likes -
Replying to @ekuber
I'm using "a Python programmer who assumes you can iterate over tuples" for my example, but yeah same basic issue
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.