-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Indexing via [v]
does not cast fn items to fn pointers
#40085
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
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).
# for free
to join this conversation on GitHub.
Already have an account?
# 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: