Skip to content
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

provide on_unimplemented hint for ops::Index #31062

Closed
durka opened this issue Jan 20, 2016 · 6 comments
Closed

provide on_unimplemented hint for ops::Index #31062

durka opened this issue Jan 20, 2016 · 6 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@durka
Copy link
Contributor

durka commented Jan 20, 2016

As discussed on IRC. cc @steveklabnik

If you do slice[2i32] you get an error that tells you what is wrong (Index<i32> is not implemented for [T]) but not how to fix it (slices are indexed by usize). A quick fix would be to use #[rustc_on_unimplemented]; it would look like this.

If you are indexing something that isn't [T] then the message would be a false positive.

@steveklabnik steveklabnik added A-libs C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jan 20, 2016
@brson brson added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jan 21, 2016
@GuillaumeGomez
Copy link
Member

It looks like fun, I take it.

@durka
Copy link
Contributor Author

durka commented May 12, 2016

Fixed by #33401 \o/

@durka durka closed this as completed May 12, 2016
@pnkfelix
Copy link
Member

PR #33491 is going to regress this issue; reopen when it lands

@arielb1
Copy link
Contributor

arielb1 commented May 17, 2016

@pnkfelix

No it's not. It is going to give the same error message on ranges (which is debatable), but it will give the correct error message with slices.

@GuillaumeGomez
Copy link
Member

@arielb1: This feature isn't just for ranges and slices. So for now, this is a regression.

@pnkfelix
Copy link
Member

@arielb1 I inferred that something regressed from the fact that you removed one of unit tests in #33491, but I guess I am not clear on how much of a regression occurred.

@GuillaumeGomez GuillaumeGomez removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label May 18, 2016
bors added a commit that referenced this issue May 19, 2016
implement fuzzy matching in on_unimplemented

Fixes #31062

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

6 participants