-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Confusing impl Trait
limitation
#104526
Comments
@rustbot label +T-compiler +A-diagnostics D-confusing |
There are 2 stages to fixing this issue. Everything happens in
|
@rustbot claim |
A wording change and an applicable suggestion to write something like this would be great. |
What does "only allowed in function and inherent method return types" actually mean? According to RFC1951 the major compilation error we deal with here should be "ERROR All RFC1522-related tests seems to be outdated, e.g. ui/impl-trait/where-allowed.rs. I'm trying to address above-mentioned issues, so discussion above is what I have thought of so far, I'm writing it down in case I miss anything. |
I think that the current message means “only allowed in function [return types] and inherent method return types” but I agree that it is no longer correct because |
TBH, it should suggest adding a type param. |
https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-trait/where-allowed.rs#L13 |
Closing due to the lack of activity |
This is being tracked in rust-lang/impl-trait-initiative#15 and rust-lang/impl-trait-initiative#16, I believe. |
For some reason,
impl Trait
is allowed in a type's first mention but not in awhere
clause.Besides, the error message isn't very helpful.
The text was updated successfully, but these errors were encountered: