Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Include bounds from promoted constants in NLL #57202
Previously a promoted function wouldn't have its bound propagated out to
This is a quicker and less clean fix than the one suggested fix in the FIXME in the code. We just visit the MIR of all of the promoted constants as part of typeck, treating all relations as happening at the point where the promoted is used. This saves us from having to work out the constraints for each promoted item individually and propagating them outwards.
I have an alternative approach that does the location adjustment in the