Repository: racer-rust/racer (language: rust)

Issue:
Build Failing with Cargo Nightly
I am getting the following error when running `cargo +nightly install racer`:

```
   Compiling rustc-ap-rustc_data_structures v686.0.0
error[E0107]: wrong number of type arguments: expected 2, found 1
   --> /Users/tobi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/graph/iterate/mod.rs:256:10
    |
256 |     ) -> ControlFlow<Self::BreakVal> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 type arguments

error[E0107]: wrong number of type arguments: expected 2, found 1
   --> /Users/tobi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/graph/iterate/mod.rs:261:51
    |
261 |     fn node_settled(&mut self, _node: G::Node) -> ControlFlow<Self::BreakVal> {
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 type arguments

error[E0107]: wrong number of type arguments: expected 2, found 1
   --> /Users/tobi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/graph/iterate/mod.rs:284:10
    |
284 |     ) -> ControlFlow<Self::BreakVal> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 type arguments

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0107`.
error: could not compile `rustc-ap-rustc_data_structures`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `racer v2.1.40`, intermediate artifacts can be found at `/var/folders/sw/jmc9rg0n17v550p30c7_wqmr0000gp/T/cargo-install8jfGll`

Caused by:
  build failed
```

MacOs:

```
rustup 1.22.1 (b01adbbc3 2020-07-08)
rustc 1.49.0-nightly (ffa2e7ae8 2020-10-24)
cargo 1.49.0-nightly (dd83ae55c 2020-10-20)
```

Thanks
`cargo +nightly build --release` fails on Windows 10 (both on latest and v2.1.36)
Following the instructions on the README, I ran the following commands:

1. `rustup toolchain add nightly`
    <details>
    <summary>output</summary>
  
    ```
    info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-06, rust version 1.51.0-nightly (23adf9fd8 2021-02-05)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-02-05-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-05, rust version 1.51.0-nightly (4f4656d46 2021-02-04)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-02-04-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-04, rust version 1.51.0-nightly (e708cbd91 2021-02-03)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-02-03-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-03, rust version 1.51.0-nightly (368275062 2021-02-02)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-02-02-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-02, rust version 1.51.0-nightly (d4e3570db 2021-02-01)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-02-01-x86_64-pc-windows-msvc'
    info: latest update on 2021-02-01, rust version 1.51.0-nightly (0e63af5da 2021-01-31)
    info: skipping nightly which is missing installed component 'rustfmt'
    info: syncing channel updates for 'nightly-2021-01-31-x86_64-pc-windows-msvc'
    info: latest update on 2021-01-31, rust version 1.51.0-nightly (04caa632d 2021-01-30)
    info: downloading component 'cargo'
    info: downloading component 'clippy'
    info: downloading component 'rust-docs'
    info: downloading component 'rust-std'
    info: downloading component 'rustc'
    info: downloading component 'rustfmt'
    info: installing component 'cargo'
    info: using up to 500.0 MiB of RAM to unpack components
    info: installing component 'clippy'
    info: installing component 'rust-docs'
    info: installing component 'rust-std'
    info: installing component 'rustc'
    info: installing component 'rustfmt'
    
      nightly-x86_64-pc-windows-msvc installed - rustc 1.51.0-nightly (04caa632d 2021-01-30)
    
    info: checking for self-updates
    ```
    </details>

2. `git clone https://github.com/racer-rust/racer.git && cd racer`
3. `cargo +nightly build --release`

    <details>
      <summary>output</summary>
      
    ```
     Downloading crates ...
      Downloaded aho-corasick v0.7.10
      Downloaded getrandom v0.1.14
      Downloaded autocfg v1.0.0
      Downloaded lazycell v1.2.1
      Downloaded indexmap v1.5.2
      Downloaded memchr v2.3.3
      Downloaded rand v0.7.3
      Downloaded rls-span v0.5.2
      Downloaded remove_dir_all v0.5.2
      Downloaded stable_deref_trait v1.1.1
      Downloaded smallvec v1.4.2
      Downloaded quote v1.0.3
      Downloaded tracing-attributes v0.1.11
      Downloaded tracing v0.1.19
      Downloaded log v0.4.8
      Downloaded derive_more v0.99.5
      Downloaded memoffset v0.5.4
      Downloaded ppv-lite86 v0.2.6
      Downloaded lock_api v0.4.1
      Downloaded clap v2.33.0
      Downloaded serde_derive v1.0.105
      Downloaded termcolor v1.1.0
      Downloaded tempfile v3.1.0
      Downloaded vec_map v0.8.1
      Downloaded unicode-xid v0.2.0
      Downloaded serde v1.0.105
      Downloaded instant v0.1.7
      Downloaded proc-macro2 v1.0.10
      Downloaded ryu v1.0.3
      Downloaded serde_json v1.0.50
      Downloaded arrayvec v0.5.1
      Downloaded either v1.5.3
      Downloaded hashbrown v0.8.2
      Downloaded rand_chacha v0.2.2
      Downloaded stacker v0.1.12
      Downloaded sha2 v0.9.2
      Downloaded num_cpus v1.12.0
      Downloaded winapi-util v0.1.4
      Downloaded rand_core v0.5.1
      Downloaded winapi v0.3.8
      Downloaded parking_lot_core v0.8.0
      Downloaded libc v0.2.77
      Downloaded unicode-width v0.1.7
      Downloaded regex-syntax v0.6.17
      Downloaded thread_local v1.0.1
      Downloaded tracing-core v0.1.15
      Downloaded parking_lot v0.11.0
      Downloaded psm v0.1.8
      Downloaded synstructure v0.12.3
      Downloaded cc v1.0.53
      Downloaded humantime v2.0.0
      Downloaded unicode-normalization v0.1.12
      Downloaded regex v1.3.6
      Downloaded sha-1 v0.9.2
      Downloaded syn v1.0.17
      Downloaded itoa v0.4.5
       Compiling cfg-if v0.1.10
       Compiling autocfg v1.0.0
       Compiling proc-macro2 v1.0.10
       Compiling unicode-xid v0.2.0
       Compiling winapi v0.3.8
       Compiling syn v1.0.17
       Compiling lazy_static v1.4.0
       Compiling scopeguard v1.1.0
       Compiling typenum v1.12.0
       Compiling smallvec v1.4.2
       Compiling version_check v0.9.2
       Compiling getrandom v0.1.14
       Compiling cc v1.0.53
       Compiling libc v0.2.77
       Compiling maybe-uninit v2.0.0
       Compiling log v0.4.8
       Compiling ppv-lite86 v0.2.6
       Compiling bitflags v1.2.1
       Compiling rustc-rayon-core v0.3.0
       Compiling opaque-debug v0.3.0
       Compiling unicode-width v0.1.7
       Compiling cfg-if v1.0.0
       Compiling either v1.5.3
       Compiling arrayvec v0.5.1
       Compiling rustc-hash v1.1.0
       Compiling cpuid-bool v0.1.2
       Compiling stable_deref_trait v1.1.1
       Compiling rustc-ap-rustc_graphviz v702.0.0
       Compiling jobserver v0.1.21
       Compiling scoped-tls v1.0.0
       Compiling serde v1.0.105
       Compiling memchr v2.3.3
       Compiling ryu v1.0.3
       Compiling annotate-snippets v0.8.0
       Compiling rustc-ap-rustc_fs_util v702.0.0
       Compiling regex-syntax v0.6.17
       Compiling itoa v0.4.5
       Compiling quick-error v1.2.3
       Compiling strsim v0.8.0
       Compiling vec_map v0.8.1
       Compiling humantime v2.0.0
       Compiling lazycell v1.2.1
       Compiling instant v0.1.7
       Compiling lock_api v0.4.1
       Compiling crossbeam-utils v0.6.6
       Compiling tracing-core v0.1.15
       Compiling thread_local v1.0.1
       Compiling rustc-ap-rustc_arena v702.0.0
    error[E0658]: use of unstable library feature 'array_value_iter'
       --> C:\Users\Scored\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_arena-702.0.0\src\lib.rs:134:40
        |
    134 | impl<T, const N: usize> IterExt<T> for std::array::IntoIter<T, N> {
        |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: see issue #65798 <https://github.com/rust-lang/rust/issues/65798> for more information
        = help: add `#![feature(array_value_iter)]` to the crate attributes to enable
    
    error[E0658]: use of unstable library feature 'array_value_iter_slice'
       --> C:\Users\Scored\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_arena-702.0.0\src\lib.rs:144:18
        |
    144 |             self.as_slice().as_ptr().copy_to_nonoverlapping(start_ptr, len);
        |                  ^^^^^^^^
        |
        = note: see issue #65798 <https://github.com/rust-lang/rust/issues/65798> for more information
        = help: add `#![feature(array_value_iter_slice)]` to the crate attributes to enable
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0658`.
    error: could not compile `rustc-ap-rustc_arena`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    ```
    </details>

4. That failed, so I tried checking the latest release commit: 
    `git checkout 94929a2f0b662465601abbd686bf080252e76009`

    <details>
      <summary>output</summary>
      
    ```
    Note: switching to '94929a2f0b662465601abbd686bf080252e76009'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at 94929a2 Bump version to 2.1.36
    ```
    </details>

5. `cargo +nightly build --release`

    <details>
      <summary>output</summary>
      
    ```
     Downloading crates ...
      Downloaded block-buffer v0.7.3
      Downloaded block-padding v0.1.5
      Downloaded byte-tools v0.3.1
      Downloaded generic-array v0.12.3
      Downloaded fake-simd v0.1.2
      Downloaded once_cell v1.4.0
      Downloaded parking_lot v0.10.2
      Downloaded rustc-ap-rustc_ast_pretty v669.0.0
      Downloaded smallvec v0.6.13
      Downloaded rustc-ap-rustc_graphviz v669.0.0
      Downloaded indexmap v1.3.2
      Downloaded memmap v0.7.0
      Downloaded md-5 v0.8.0
      Downloaded rustc-ap-rustc_ast v669.0.0
      Downloaded rustc-ap-rustc_data_structures v669.0.0
      Downloaded measureme v0.7.1
      Downloaded libc v0.2.68
      Downloaded rustc-ap-rustc_fs_util v669.0.0
      Downloaded rustc-ap-rustc_arena v669.0.0
      Downloaded sha-1 v0.8.2
      Downloaded semver v0.9.0
      Downloaded digest v0.8.1
      Downloaded parking_lot_core v0.6.2
      Downloaded rustc-ap-rustc_session v669.0.0
      Downloaded semver-parser v0.7.0
      Downloaded smallvec v1.2.0
      Downloaded parking_lot v0.9.0
      Downloaded opaque-debug v0.2.3
      Downloaded parking_lot_core v0.7.2
      Downloaded rustc-ap-rustc_serialize v669.0.0
      Downloaded byteorder v1.3.4
      Downloaded rustc-ap-rustc_span v669.0.0
      Downloaded rustc-ap-rustc_feature v669.0.0
      Downloaded stacker v0.1.9
      Downloaded rustc-ap-rustc_index v669.0.0
      Downloaded rustc_version v0.2.3
      Downloaded rustc-ap-rustc_macros v669.0.0
      Downloaded rustc-ap-rustc_errors v669.0.0
      Downloaded rustc-ap-rustc_lexer v669.0.0
      Downloaded lock_api v0.3.4
      Downloaded rustc-ap-rustc_parse v669.0.0
      Downloaded rustc-ap-rustc_target v669.0.0
       Compiling winapi v0.3.8
       Compiling semver-parser v0.7.0
       Compiling syn v1.0.17
       Compiling byteorder v1.3.4
       Compiling smallvec v1.2.0
       Compiling libc v0.2.68
       Compiling byte-tools v0.3.1
       Compiling rustc-ap-rustc_graphviz v669.0.0
       Compiling opaque-debug v0.2.3
       Compiling fake-simd v0.1.2
       Compiling rustc-ap-rustc_ast v669.0.0
       Compiling rustc-ap-rustc_target v669.0.0
       Compiling rustc-ap-rustc_fs_util v669.0.0
       Compiling memoffset v0.5.4
       Compiling crossbeam-utils v0.7.2
       Compiling crossbeam-epoch v0.8.2
       Compiling indexmap v1.3.2
       Compiling proc-macro2 v1.0.10
       Compiling maybe-uninit v2.0.0
       Compiling lock_api v0.3.4
       Compiling psm v0.1.8
       Compiling stacker v0.1.9
       Compiling typenum v1.12.0
       Compiling log v0.4.8
       Compiling rustc-rayon-core v0.3.0
       Compiling bitflags v1.2.1
       Compiling getopts v0.2.21
       Compiling textwrap v0.11.0
       Compiling serde v1.0.105
       Compiling memchr v2.3.3
       Compiling rustc-ap-rustc_lexer v669.0.0
       Compiling block-padding v0.1.5
       Compiling ryu v1.0.3
       Compiling humantime v1.3.0
       Compiling semver v0.9.0
       Compiling unicode-normalization v0.1.12
       Compiling crossbeam-queue v0.1.2
       Compiling rustc_version v0.2.3
       Compiling smallvec v0.6.13
       Compiling ena v0.14.0
       Compiling quote v1.0.3
       Compiling aho-corasick v0.7.10
       Compiling num_cpus v1.12.0
       Compiling generic-array v0.12.3
       Compiling parking_lot_core v0.6.2
       Compiling parking_lot v0.9.0
       Compiling rustc-ap-rustc_serialize v669.0.0
       Compiling block-buffer v0.7.3
       Compiling digest v0.8.1
       Compiling sha-1 v0.8.2
       Compiling md-5 v0.8.0
       Compiling crossbeam-deque v0.7.3
       Compiling regex v1.3.6
       Compiling rustc-rayon v0.3.0
       Compiling rustc-ap-rustc_index v669.0.0
       Compiling parking_lot_core v0.7.2
       Compiling memmap v0.7.0
       Compiling atty v0.2.14
       Compiling winapi-util v0.1.4
       Compiling termize v0.1.1
       Compiling parking_lot v0.10.2
       Compiling clap v2.33.0
       Compiling termcolor v1.1.0
       Compiling once_cell v1.4.0
       Compiling measureme v0.7.1
       Compiling env_logger v0.7.1
       Compiling rustc-ap-rustc_data_structures v669.0.0
    error[E0557]: feature has been removed
      --> C:\Users\Scored\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_data_structures-669.0.0\lib.rs:16:12
       |
    16 | #![feature(optin_builtin_traits)]
       |            ^^^^^^^^^^^^^^^^^^^^ feature has been removed
       |
       = note: renamed to `auto_traits`
    
    error[E0658]: auto traits are experimental and possibly buggy
      --> C:\Users\Scored\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_data_structures-669.0.0\sync.rs:30:9
       |
    30 |         pub auto trait Send {}
       |         ^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
       = help: add `#![feature(auto_traits)]` to the crate attributes to enable
    
    error[E0658]: auto traits are experimental and possibly buggy
      --> C:\Users\Scored\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_data_structures-669.0.0\sync.rs:31:9
       |
    31 |         pub auto trait Sync {}
       |         ^^^^^^^^^^^^^^^^^^^^^^
       |
       = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
       = help: add `#![feature(auto_traits)]` to the crate attributes to enable
    
       Compiling synstructure v0.12.3
    error: aborting due to 3 previous errors
    
    Some errors have detailed explanations: E0557, E0658.
    For more information about an error, try `rustc --explain E0557`.
    error: could not compile `rustc-ap-rustc_data_structures`
    
    To learn more, run the command again with --verbose.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
    ```
    </details>




Discussion / hints:
me too
me too
opensuse 15.2
rustup 1.22.1 (b01adbbc3 2020-07-08)
rustc 1.49.0-nightly (ffa2e7ae8 2020-10-24)
cargo 1.49.0-nightly (dd83ae55c 2020-10-20)

me too, on popOs 20
If you do `rustup update --force` (this may mean you don't get all the components you have already installed) you should get a more up-to-date `nightly` (say `2020-10-31`).

That one should build `racer` just fine.

This problem seems to be due to `rust-ap-rustc_data_structures` having been released on a newer rust src than what you have available in your `rustup`.
Thanks, @nlopes. I just checked, your temporary solution works fine!
Can confirm that [@nlopes' suggestion](https://github.com/racer-rust/racer/issues/1141#issuecomment-720090525) works for me too! Thanks! =D
Yes ty for @nlopes suggestion! Rust really has a friendly community
@nlopes advise works.
I can confirm that the solution works.
same here
I have tried [@nlopes' suggestion](https://github.com/racer-rust/racer/issues/1141#issuecomment-720090525) but i still get errors when building racer.

```
rustup 1.23.0 (00924c9ba 2020-11-27)
rustc 1.50.0-nightly (6a889570e 2020-11-27)
cargo 1.50.0-nightly (bfca1cd22 2020-11-24)
```
Error when running `cargo +nightly install racer`:
```
   Compiling rustc-ap-rustc_data_structures v686.0.0
error[E0557]: feature has been removed
  --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/lib.rs:18:12
   |
18 | #![feature(optin_builtin_traits)]
   |            ^^^^^^^^^^^^^^^^^^^^ feature has been removed
   |
   = note: renamed to `auto_traits`

error[E0658]: auto traits are experimental and possibly buggy
  --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/sync.rs:30:9
   |
30 |         pub auto trait Send {}
   |         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
   = help: add `#![feature(auto_traits)]` to the crate attributes to enable

error[E0658]: auto traits are experimental and possibly buggy
  --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/sync.rs:31:9
   |
31 |         pub auto trait Sync {}
   |         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
   = help: add `#![feature(auto_traits)]` to the crate attributes to enable

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0557, E0658.
For more information about an error, try `rustc --explain E0557`.
error: could not compile `rustc-ap-rustc_data_structures`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `racer v2.1.40`, intermediate artifacts can be found at `/tmp/cargo-installN6A2q8`

Caused by:
  build failed
```
I think you just need to build it from the latest master.
> I think you just need to build it from the latest master.

I thought the command `cargo +nightly install racer` was doing that. I can see the version 2.1.40 in the output which match the latest release on the GitHub page.
> I have tried [@nlopes' suggestion](https://github.com/racer-rust/racer/issues/1141#issuecomment-720090525) but i still get errors when building racer.
> 
> ```
> rustup 1.23.0 (00924c9ba 2020-11-27)
> rustc 1.50.0-nightly (6a889570e 2020-11-27)
> cargo 1.50.0-nightly (bfca1cd22 2020-11-24)
> ```
> 
> Error when running `cargo +nightly install racer`:
> 
> ```
>    Compiling rustc-ap-rustc_data_structures v686.0.0
> error[E0557]: feature has been removed
>   --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/lib.rs:18:12
>    |
> 18 | #![feature(optin_builtin_traits)]
>    |            ^^^^^^^^^^^^^^^^^^^^ feature has been removed
>    |
>    = note: renamed to `auto_traits`
> 
> error[E0658]: auto traits are experimental and possibly buggy
>   --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/sync.rs:30:9
>    |
> 30 |         pub auto trait Send {}
>    |         ^^^^^^^^^^^^^^^^^^^^^^
>    |
>    = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
>    = help: add `#![feature(auto_traits)]` to the crate attributes to enable
> 
> error[E0658]: auto traits are experimental and possibly buggy
>   --> /home/polensky/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_data_structures-686.0.0/src/sync.rs:31:9
>    |
> 31 |         pub auto trait Sync {}
>    |         ^^^^^^^^^^^^^^^^^^^^^^
>    |
>    = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
>    = help: add `#![feature(auto_traits)]` to the crate attributes to enable
> 
> error: aborting due to 3 previous errors
> 
> Some errors have detailed explanations: E0557, E0658.
> For more information about an error, try `rustc --explain E0557`.
> error: could not compile `rustc-ap-rustc_data_structures`
> 
> To learn more, run the command again with --verbose.
> warning: build failed, waiting for other jobs to finish...
> error: failed to compile `racer v2.1.40`, intermediate artifacts can be found at `/tmp/cargo-installN6A2q8`
> 
> Caused by:
>   build failed
> ```

Same problem.

```
> rustup -V
rustup 1.23.1 (3df2264a9 2020-11-30)
> rustc -V
rustc 1.52.0-nightly (9778068cb 2021-02-07)
> cargo -V
cargo 1.51.0-nightly (34170fcd6 2021-02-04)
```
> If you do `rustup update --force` (this may mean you don't get all the components you have already installed) you should get a more up-to-date `nightly` (say `2020-10-31`).
> 
> That one should build `racer` just fine.
> 
> This problem seems to be due to `rust-ap-rustc_data_structures` having been released on a newer rust src than what you have available in your `rustup`.

This work for me too, thx!
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.51.0 (2fd73fabe 2021-03-23)
nightly-x86_64-unknown-linux-gnu updated - rustc 1.54.0-nightly (4de757209 2021-05-01) (from rustc 1.53.0-nightly (42816d61e 2021-04-24))
ubuntu 20.04

```
error[E0658]: unsizing casts to types besides slices are not allowed in const fn
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_ast-712.0.0/src/ptr.rs:136:37
    |
136 |                 std::mem::transmute(NonNull::<[T; 0]>::dangling() as NonNull<[T]>)
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #64992 <https://github.com/rust-lang/rust/issues/64992> for more information
    = help: add `#![feature(const_fn_unsize)]` to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `rustc-ap-rustc_ast`
```
@lm-w1n5t0n  brawskii, i have found the solution!
simply uninstall rust 'rustup self uninstall'
reinstall it 'curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh'
clone the repo 'git clone https://github.com/racer-rust/racer.git'
cd into it 'cd racer'
then finally run 'cargo build --release'

worked a 💯 persento for me 🥖 👨‍🎨
Duplicate of #1154

Note that rustup skips pulling newer nightlies that missing installed components and falls back to previous releases, so you need to include `--force` when running update. There were also some subsequent upstream changes in the rustc crates that cause issues on the latest nightly (will be resolved by #1159), but latest on master should build with `nightly-2021-02-03`
Just tried installing again today and I'm still unable to do so via `cargo update`
@koalazub brawskiiiii, did you follow the guide i provided?

@quadroli I have not, but I'll give it a shot right after work. Cheers for sharing the trick mate!

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 20690fe6..76097083 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -28,9 +28,9 @@ dependencies = [
 
 [[package]]
 name = "arrayvec"
-version = "0.5.1"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
+checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7"
 
 [[package]]
 name = "atty"
@@ -119,7 +119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"
 dependencies = [
  "crossbeam-epoch",
- "crossbeam-utils",
+ "crossbeam-utils 0.7.2",
  "maybe-uninit",
 ]
 
@@ -131,7 +131,7 @@ checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
 dependencies = [
  "autocfg",
  "cfg-if 0.1.10",
- "crossbeam-utils",
+ "crossbeam-utils 0.7.2",
  "lazy_static",
  "maybe-uninit",
  "memoffset",
@@ -145,7 +145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
 dependencies = [
  "cfg-if 0.1.10",
- "crossbeam-utils",
+ "crossbeam-utils 0.7.2",
  "maybe-uninit",
 ]
 
@@ -160,6 +160,17 @@ dependencies = [
  "lazy_static",
 ]
 
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278"
+dependencies = [
+ "autocfg",
+ "cfg-if 1.0.0",
+ "lazy_static",
+]
+
 [[package]]
 name = "derive_more"
 version = "0.99.5"
@@ -229,11 +240,11 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
-version = "0.1.14"
+version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
  "libc",
  "wasi",
 ]
@@ -388,6 +399,15 @@ dependencies = [
  "winapi",
 ]
 
+[[package]]
+name = "memmap2"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "397d1a6d6d0563c0f5462bbdae662cf6c784edf5e828e40c7257f85d82bf56dd"
+dependencies = [
+ "libc",
+]
+
 [[package]]
 name = "memoffset"
 version = "0.5.4"
@@ -434,7 +454,7 @@ dependencies = [
  "cloudabi",
  "instant",
  "libc",
- "redox_syscall",
+ "redox_syscall 0.1.56",
  "smallvec",
  "winapi",
 ]
@@ -450,9 +470,9 @@ dependencies = [
 
 [[package]]
 name = "ppv-lite86"
-version = "0.2.6"
+version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
 
 [[package]]
 name = "proc-macro2"
@@ -537,11 +557,10 @@ dependencies = [
 
 [[package]]
 name = "rand"
-version = "0.7.3"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
 dependencies = [
- "getrandom",
  "libc",
  "rand_chacha",
  "rand_core",
@@ -550,9 +569,9 @@ dependencies = [
 
 [[package]]
 name = "rand_chacha"
-version = "0.2.2"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
 dependencies = [
  "ppv-lite86",
  "rand_core",
@@ -560,18 +579,18 @@ dependencies = [
 
 [[package]]
 name = "rand_core"
-version = "0.5.1"
+version = "0.6.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
 dependencies = [
  "getrandom",
 ]
 
 [[package]]
 name = "rand_hc"
-version = "0.2.0"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
 dependencies = [
  "rand_core",
 ]
@@ -582,6 +601,15 @@ version = "0.1.56"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
 
+[[package]]
+name = "redox_syscall"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85dd92e586f7355c633911e11f77f3d12f04b1b1bd76a198bd34ae3af8341ef2"
+dependencies = [
+ "bitflags",
+]
+
 [[package]]
 name = "regex"
 version = "1.3.6"
@@ -620,9 +648,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_arena"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "259cca0e975ecb05fd289ace45280c30ff792efc04e856a7f18b7fc86a3cb610"
+checksum = "526610f47139efa440178239553b59ea805ff57a532b4e295c71d2a9b18fd676"
 dependencies = [
  "rustc-ap-rustc_data_structures",
  "smallvec",
@@ -630,9 +658,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_ast"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb9be435d50c88e94bbad6ea468c8680b52c5043bb298ab8058d05251717f8f8"
+checksum = "cf6a9dda0804a7243b0282e3b75a8cf4654c7a61f033e587751941e1fe39391b"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_data_structures",
@@ -647,9 +675,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_ast_pretty"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79bede0b44bed453fd0034b7ba492840391f6486bf3e17a1af12922f0b98d4cc"
+checksum = "82f5019be8b41a58664169fd2f4b1a37fe82705681db394b76419e4e87d40ab1"
 dependencies = [
  "rustc-ap-rustc_ast",
  "rustc-ap-rustc_span",
@@ -658,19 +686,20 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_data_structures"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cbfa7f82517a1b2efe7106c864c3f930b1da8aff07a27fd317af2f36522fd2e"
+checksum = "a701717fb14549331085756b9741ae3b4bf35808489f1887d72c1d0e0fe52b77"
 dependencies = [
  "arrayvec",
  "bitflags",
  "cfg-if 0.1.10",
- "crossbeam-utils",
+ "crossbeam-utils 0.8.4",
  "ena",
  "indexmap",
  "jobserver",
  "libc",
  "measureme",
+ "memmap2",
  "parking_lot",
  "rustc-ap-rustc_graphviz",
  "rustc-ap-rustc_index",
@@ -689,9 +718,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_errors"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58a272a5101843bcb40900cc9ccf80ecfec62830bb1f4a242986da4a34c0da89"
+checksum = "e3182ce85e8bfc96443475547f2f5aa2b5e67655d9b88721795f36f0ba9e265a"
 dependencies = [
  "annotate-snippets",
  "atty",
@@ -709,9 +738,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_feature"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e931cd1580ae60c5737d3fa57633034935e885414e794d83b3e52a81021985c"
+checksum = "eed033b93270126ef60963c3ebbd0e026bf53b985172b6366c7b0e7881c9d507"
 dependencies = [
  "rustc-ap-rustc_data_structures",
  "rustc-ap-rustc_span",
@@ -719,21 +748,21 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_fs_util"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fe9422e10d5b441d2a78202667bc85d7cf713a087b9ae6cdea0dfc825d79f07"
+checksum = "28ee6531986a205101e09fd143d7bf31897388f33b1814d4bcc45fd62211dca6"
 
 [[package]]
 name = "rustc-ap-rustc_graphviz"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffffffdef9fd51db69c1d4c045ced8aaab999be5627f2d3a0ce020d74c1f1e50"
+checksum = "3398fddc0e23d2db89c036f8952ddf78cadc597f7059752116e69483e164a5b6"
 
 [[package]]
 name = "rustc-ap-rustc_index"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f6f53afc4f7111c82295cb7ea3878f520bbac6a2c5a12e125b4ca9156498cff"
+checksum = "dca4e27eb5b701f6bbd47d8fc9d242378fca3e4107a519a28415c2989c4a3bd3"
 dependencies = [
  "arrayvec",
  "rustc-ap-rustc_macros",
@@ -742,18 +771,18 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_lexer"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8056b05346dff7e39164d0434c6ec443a14ab5fbf6221bd1a56e5abbeae5f60c"
+checksum = "786bbfe9d4d5264294c1819dbf1497a2480b583d5eda1ca9ae22e12d6661f5df"
 dependencies = [
  "unicode-xid",
 ]
 
 [[package]]
 name = "rustc-ap-rustc_lint_defs"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "364c3fb7b3cbdfe3fbb21d4078ff2cb3c58df63cda27995f8b064d21ee6dede5"
+checksum = "be2f045e2b999c154ec505d5fea69c994b742f3ebd2f552d11a6c81723921e47"
 dependencies = [
  "rustc-ap-rustc_ast",
  "rustc-ap-rustc_data_structures",
@@ -766,9 +795,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_macros"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4607d6879cae3bae4d0369ca4b3a7510fd6295ac32eec088ac975208ba96ca45"
+checksum = "27789cd26d6b9e2fdfa68a262a20664d79ca67d31a3886d40fb88ebf6935869c"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -778,9 +807,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_parse"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78d22889bff7ca2346037c9df7ea55c66ffb714f5b50fb62b41975f8ac7a2d70"
+checksum = "1dc331f4958350679679e619d63a891e8d5d34ef99087068c89aa9e657d52caa"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_ast",
@@ -798,9 +827,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_serialize"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d33c710120953c0214f47a6caf42064d7e241003b4af36c98a6d6156e70335f1"
+checksum = "e9a6824a462c4c1a379e911b0faf86d303a54bcf8673d4cc445195085966a4a4"
 dependencies = [
  "indexmap",
  "smallvec",
@@ -808,9 +837,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_session"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d35919041429a90713c8f704fa5209ba159cb554ce74d95722cbc18ac4b4c6f"
+checksum = "a782a5f6ada0dbe089c6416ad0104f0b8a8bdb4bd26ea95e5fefaec67aed5e8a"
 dependencies = [
  "bitflags",
  "getopts",
@@ -830,9 +859,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_span"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73b12170c69603c0bf4b50e5c25fd348aae13b8c6465aa0ef4389c9eaa568e51"
+checksum = "a257546cb264b250c7abdb81239bb02f18a274a966211755a3ea89411b122214"
 dependencies = [
  "cfg-if 0.1.10",
  "md-5",
@@ -850,9 +879,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_target"
-version = "712.0.0"
+version = "718.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a8329d92e7dc24b974f759e6c6e97e2bbc47b18d0573343028f8135ca367200"
+checksum = "b5a72dd689421bcb5750f3ed0dedf367076e714ef0ba56c02ed391b9a8582862"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_data_structures",
@@ -888,7 +917,7 @@ checksum = "e94187d9ea3e8c38fafdbc38acb94eafa7ce155867f6ccb13830466a0d0db8c6"
 dependencies = [
  "crossbeam-deque",
  "crossbeam-queue",
- "crossbeam-utils",
+ "crossbeam-utils 0.7.2",
  "lazy_static",
  "num_cpus",
 ]
@@ -1024,14 +1053,14 @@ dependencies = [
 
 [[package]]
 name = "tempfile"
-version = "3.1.0"
+version = "3.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
+checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
  "libc",
  "rand",
- "redox_syscall",
+ "redox_syscall 0.2.7",
  "remove_dir_all",
  "winapi",
 ]
@@ -1145,9 +1174,9 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
 
 [[package]]
 name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
+version = "0.10.2+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
 
 [[package]]
 name = "winapi"
diff --git a/Cargo.toml b/Cargo.toml
index cfd0ce68..257e74f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,31 +39,31 @@ path = "metadata"
 
 [dependencies.rustc_ast_pretty]
 package = "rustc-ap-rustc_ast_pretty"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_data_structures]
 package = "rustc-ap-rustc_data_structures"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_errors]
 package = "rustc-ap-rustc_errors"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_parse]
 package = "rustc-ap-rustc_parse"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_session]
 package = "rustc-ap-rustc_session"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_span]
 package = "rustc-ap-rustc_span"
-version = "712.0.0"
+version = "718.0.0"
 
 [dependencies.rustc_ast]
 package = "rustc-ap-rustc_ast"
-version = "712.0.0"
+version = "718.0.0"
 
 [dev-dependencies.racer-testutils]
 version = "0.1"
diff --git a/rust-toolchain b/rust-toolchain
index 0cb2de6a..7fc2f8f8 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,1 +1,1 @@
-nightly-2021-03-26
+nightly-2021-05-01
diff --git a/src/racer/snippets.rs b/src/racer/snippets.rs
index 9fde2cec..4e3d35c8 100644
--- a/src/racer/snippets.rs
+++ b/src/racer/snippets.rs
@@ -3,6 +3,7 @@ use crate::core::{Match, Session};
 use crate::typeinf::get_function_declaration;
 
 use rustc_ast::ast::AssocItemKind;
+use rustc_parse::parser::ForceCollect;
 
 /// Returns completion snippets usable by some editors
 ///
@@ -56,7 +57,7 @@ impl MethodInfo {
 
         trace!("MethodInfo::from_source_str: {:?}", decorated);
         with_error_checking_parse(decorated, |p| {
-            if let Ok(Some(Some(method))) = p.parse_impl_item() {
+            if let Ok(Some(Some(method))) = p.parse_impl_item(ForceCollect::No) {
                 if let AssocItemKind::Fn(ref fn_kind) = method.kind {
                     let decl = &fn_kind.1.decl;
                     return Some(MethodInfo {


Test patch: