-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Builtin indexing not used with non-trivial indices. #33903
Labels
A-const-fn
Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
Mark-Simulacrum
added
the
A-const-fn
Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.
label
Jun 23, 2017
Mark-Simulacrum
added
the
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
label
Jul 25, 2017
bors
added a commit
that referenced
this issue
Jan 10, 2018
Fix built-in indexing not being used where index type wasn't "obviously" usize Fixes #33903 Fixes #46095 This PR was made possible thanks to the generous help of @eddyb Following the example of binary operators, builtin checking for indexing has been moved from the typecheck stage to a writeback stage, after type constraints have been resolved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-const-fn
Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
It appears that when it's not obvious the index type is
usize
, we fall back to overloaded indexing:Fails in constant checking, on stable:
And also with the new MIR-based constant checker, on nightly:
The text was updated successfully, but these errors were encountered: