-
Notifications
You must be signed in to change notification settings - Fork 13.3k
NLL doesn't check user type annotations are well-formed #54620
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
Comments
(Related: #54105) I imagine that the way to fix this is that we have to prove a rust/src/librustc_mir/borrow_check/nll/type_check/mod.rs Lines 1284 to 1288 in 1c5e9c6
Probably the place to do this is on the rust/src/librustc_mir/borrow_check/nll/type_check/mod.rs Lines 946 to 953 in 1c5e9c6
One complication, though, is that the user-given type is a "canonical type":
which means that it might have rust/src/librustc_mir/borrow_check/nll/type_check/relate_tys.rs Lines 128 to 139 in 1c5e9c6
I guess what we would need to do is -- after equating, relating, whatever -- to instantiate the canonical type with these final values (presumably using the |
[NLL] Check user types are well-formed Also contains a change of span for AscribeUserType. I'm not quite sure if this was what @nikomatsakis was thinking. Closes #54620 r? @nikomatsakis
For example, this code is accepted with NLL enabled:
rust/src/test/ui/regions/regions-free-region-ordering-caller.rs
Lines 19 to 30 in f1694ea
cc #47184
The text was updated successfully, but these errors were encountered: