-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
NLL accepts higher-ranked subtype that non-NLL rejects #57642
Comments
I renamed the title to focus on the part I would most like to investigate, which is why this function works but only with feature-nll: // Works, but only with feature(nll)
fn magical() {
let x = <fn (&())>::make_f();
} That seems like a blocker to disabling migration mode. |
cc #58781 |
marking P-medium to reflect that this is solely about |
Update: this is only an issue now with |
|
Diagnostics triage: this is not a diagnostics issue |
This is now a compiler error with
|
Yes, but it should be two compiler errors, one in make_f and one on make_g. |
Looking at this further - why don't we want |
Running this example with my branch from #65232 yields, among some other errors:
This error seems correct. If I had to guess the problem with NLL, though, I would guess that this is working because of the If we want to disallow this example, I think we'll have to extend NLL to have a similarly "graded" notion of |
On the latest nightly, passing I think this is now purely a diagnostic issue, rather than a soundness issue. |
…rk-Simulacrum Add test for bad NLL higher-ranked subtype Fixes rust-lang#57642
The following code example (playground)
produces the output
The second example also unexpectedly compiles in full NLL mode.
The text was updated successfully, but these errors were encountered: