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

Compilation error on latest Rust version #104

Closed
jaxx opened this issue Jan 4, 2015 · 2 comments
Closed

Compilation error on latest Rust version #104

jaxx opened this issue Jan 4, 2015 · 2 comments

Comments

@jaxx
Copy link
Contributor

jaxx commented Jan 4, 2015

Hi,

I'm getting the following error when compiling using latest rustc.

C:\Rust\racer>rustc -O -o bin/racer src/main.rs
src\racer\codeiter.rs:22:10: 22:32 error: wrong number of type arguments: expected 0, found 1
src\racer\codeiter.rs:22 impl<'a> Iterator<(uint, uint)> for StmtIndicesIter<'a> {
@ChrisJan00
Copy link

I just pulled this project and found the same problem when building. I managed to get it working, but I'm a total noob with rust, just starting to learn now.

In codeiter.rs, starting at line 22, change Iterator declaration and insert "type Item" declaration:

impl<'a> Iterator for StmtIndicesIter<'a> {
    type Item = (uint, uint);
    #[inline]
    fn next(&mut self) -> Option<(uint, uint)> {

In codecleaner.rs, starting at line 38, same changes:

impl<'a> Iterator for CodeIndicesIter<'a> {
    type Item = (uint, uint);
    #[inline]
    fn next(&mut self) -> Option<(uint, uint)> {

In main.rs, add new attribute:

#![feature(associated_types)]

That did it for me, hope this helps.
The latest racer commit I pulled is 389d84c. The versions of rustc and cargo that I have:

rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)
cargo 0.0.1-pre-nightly (4657875 2015-01-03 23:29:22 +0000)

@jaxx
Copy link
Contributor Author

jaxx commented Jan 6, 2015

Problem solved with this merge, thanks!

@jaxx jaxx closed this as completed Jan 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants