-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Indexing via [v]
does not cast fn items to fn pointers
#40085
Comments
Seems its not doing the coercion. This works: let b :fn() = bar;
S[b]; |
Suspect it has something to do with this line - https://github.com/rust-lang/rust/blob/1.15.1/src/librustc_typeck/check/mod.rs#L3978 Going to try and work on a patch. |
aidanhs
added a commit
to aidanhs/rust
that referenced
this issue
Mar 1, 2017
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Mar 2, 2017
…tsakis Allow types passed to [] to coerce, like .index() Fixes rust-lang#40085 Basically steals the relevant part of [check_argument_types](https://github.com/rust-lang/rust/blob/1.15.1/src/librustc_typeck/check/mod.rs#L2653-L2672).
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Mar 2, 2017
…tsakis Allow types passed to [] to coerce, like .index() Fixes rust-lang#40085 Basically steals the relevant part of [check_argument_types](https://github.com/rust-lang/rust/blob/1.15.1/src/librustc_typeck/check/mod.rs#L2653-L2672).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://is.gd/R97Dc7
The docs for
Index
(https://doc.rust-lang.org/std/ops/trait.Index.html) say:but the error above indicates that this isn't true.
The text was updated successfully, but these errors were encountered: