-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Possible regression on use of Self in generics ("mismatched types") #69611
Comments
Yeah, this was caused by a bug fix to type checking of |
Closing as expected breakage and "wontfix". |
rye
added a commit
to rye/motion-planning
that referenced
this issue
Mar 20, 2020
See rust-lang/rust#69611. This is necessary because > Using `Self` should always refer to the `Self` type, just as using > `Self {...}` would. In other words, your code should never have > compiled. This'll fix the recurring build failure on nightly Rusts. Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
The following code (also on playground) compiles fine on Stable and Beta
rustc
, but has started no longer compiling on latest nightly (2020-02-28
,2020-02-29
both have this issue).I would expect this code snippet to compile with no errors as it currently does in stable and beta Rust.
Instead, on recent nightlies (02-28 and 02-29 were tested), an error is produced:
For what it's worth, the substitution
resolves the error.
I believe this is because
rustc
is erroneously pickingSelf
to beContainer<V>
(the type for which theimpl
is being specified) instead of usingContainer
and inferring the (formerly correct) output type ofContainer<T>
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: