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

Issue:
`cargo install +nightly racer` fails on macOS 11.2
For several days now I can't compile `racer`. Force updated nightly minutes before running the command, too.

<details>
<summary>Output of `cargo install +nightly racer`</summary>

```
    Updating crates.io index
  Installing racer v2.1.43
   Compiling libc v0.2.85
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.24
   Compiling cfg-if v1.0.0
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.60
   Compiling lazy_static v1.4.0
   Compiling scopeguard v1.1.0
   Compiling version_check v0.9.2
   Compiling cfg-if v0.1.10
   Compiling typenum v1.12.0
   Compiling maybe-uninit v2.0.0
   Compiling smallvec v1.6.1
   Compiling cc v1.0.66
   Compiling getrandom v0.2.2
   Compiling log v0.4.14
   Compiling ppv-lite86 v0.2.10
   Compiling bitflags v1.2.1
   Compiling hashbrown v0.9.1
   Compiling rustc-rayon-core v0.3.0
   Compiling unicode-width v0.1.8
   Compiling opaque-debug v0.3.0
   Compiling either v1.6.1
   Compiling pin-project-lite v0.2.4
   Compiling arrayvec v0.5.2
   Compiling rustc-hash v1.1.0
   Compiling cpuid-bool v0.1.2
   Compiling remove_dir_all v0.5.3
   Compiling stable_deref_trait v1.2.0
   Compiling rustc-ap-rustc_graphviz v702.0.0
   Compiling scoped-tls v1.0.0
   Compiling serde_derive v1.0.123
   Compiling serde v1.0.123
   Compiling memchr v2.3.4
   Compiling termcolor v1.1.2
   Compiling ryu v1.0.5
   Compiling once_cell v1.5.2
   Compiling tinyvec_macros v0.1.0
   Compiling annotate-snippets v0.8.0
   Compiling serde_json v1.0.62
   Compiling regex-syntax v0.6.22
   Compiling itoa v0.4.7
   Compiling quick-error v1.2.3
   Compiling rustc-ap-rustc_fs_util v702.0.0
   Compiling ansi_term v0.11.0
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling humantime v2.1.0
   Compiling lazycell v1.3.0
   Compiling instant v0.1.9
   Compiling lock_api v0.4.2
   Compiling crossbeam-utils v0.6.6
   Compiling tracing-core v0.1.17
   Compiling getopts v0.2.21
   Compiling textwrap v0.11.0
   Compiling rustc-ap-rustc_arena v702.0.0
   Compiling tinyvec v1.1.1
   Compiling rustc-ap-rustc_lexer v702.0.0
   Compiling generic-array v0.14.4
   Compiling thread_local v1.1.3
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.6
   Compiling crossbeam-epoch v0.8.2
   Compiling indexmap v1.6.1
   Compiling humantime v1.3.0
   Compiling crossbeam-queue v0.1.2
   Compiling ena v0.14.0
   Compiling aho-corasick v0.7.15
   Compiling psm v0.1.12
   Compiling stacker v0.1.13
   Compiling parking_lot_core v0.8.2
   Compiling num_cpus v1.13.0
   Compiling jobserver v0.1.21
   Compiling atty v0.2.14
   Compiling termize v0.1.1
   Compiling quote v1.0.8
   Compiling rand_core v0.6.1
   Compiling clap v2.33.3
   Compiling unicode-normalization v0.1.16
   Compiling parking_lot v0.11.1
   Compiling rand_chacha v0.3.0
   Compiling rustc-ap-rustc_serialize v702.0.0
   Compiling measureme v9.0.0
   Compiling rand v0.8.3
   Compiling crossbeam-deque v0.7.3
error[E0658]: use of unstable library feature 'int_bits_const'
   --> /Users/dimi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_serialize-702.0.0/src/leb128.rs:142:25
    |
142 |             if (shift < <$int_ty>::BITS) && ((byte & 0x40) != 0) {
    |                         ^^^^^^^^^^^^^^^
...
152 | impl_read_signed_leb128!(read_i16_leb128, i16);
    | ----------------------------------------------- in this macro invocation
    |
    = note: see issue #76904 <https://github.com/rust-lang/rust/issues/76904> for more information
    = help: add `#![feature(int_bits_const)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'int_bits_const'
   --> /Users/dimi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_serialize-702.0.0/src/leb128.rs:142:25
    |
142 |             if (shift < <$int_ty>::BITS) && ((byte & 0x40) != 0) {
    |                         ^^^^^^^^^^^^^^^
...
153 | impl_read_signed_leb128!(read_i32_leb128, i32);
    | ----------------------------------------------- in this macro invocation
    |
    = note: see issue #76904 <https://github.com/rust-lang/rust/issues/76904> for more information
    = help: add `#![feature(int_bits_const)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'int_bits_const'
   --> /Users/dimi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_serialize-702.0.0/src/leb128.rs:142:25
    |
142 |             if (shift < <$int_ty>::BITS) && ((byte & 0x40) != 0) {
    |                         ^^^^^^^^^^^^^^^
...
154 | impl_read_signed_leb128!(read_i64_leb128, i64);
    | ----------------------------------------------- in this macro invocation
    |
    = note: see issue #76904 <https://github.com/rust-lang/rust/issues/76904> for more information
    = help: add `#![feature(int_bits_const)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'int_bits_const'
   --> /Users/dimi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_serialize-702.0.0/src/leb128.rs:142:25
    |
142 |             if (shift < <$int_ty>::BITS) && ((byte & 0x40) != 0) {
    |                         ^^^^^^^^^^^^^^^
...
155 | impl_read_signed_leb128!(read_i128_leb128, i128);
    | ------------------------------------------------- in this macro invocation
    |
    = note: see issue #76904 <https://github.com/rust-lang/rust/issues/76904> for more information
    = help: add `#![feature(int_bits_const)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'int_bits_const'
   --> /Users/dimi/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_serialize-702.0.0/src/leb128.rs:142:25
    |
142 |             if (shift < <$int_ty>::BITS) && ((byte & 0x40) != 0) {
    |                         ^^^^^^^^^^^^^^^
...
156 | impl_read_signed_leb128!(read_isize_leb128, isize);
    | --------------------------------------------------- in this macro invocation
    |
    = note: see issue #76904 <https://github.com/rust-lang/rust/issues/76904> for more information
    = help: add `#![feature(int_bits_const)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `rustc-ap-rustc_serialize`

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.43`, intermediate artifacts can be found at `/var/folders/kw/x1xjdlfj08g62bsnxplpgz700000gn/T/cargo-installCYzGEb`

Caused by:
  build failed
```
</details>

Anything obvious I am missing?


Discussion / hints:
I'm experiencing this same build error on Debian Bullseye.
@bbugyi200 @dimitarvp brawskizzz, 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 🥖 👨‍🎨
@quadroli Nice! This solution might be overkill though.

I was actually able to get this working by just running `cargo install racer` insted of `cargo +nightly install racer`. Perhaps the installation instructions in the README needs to be updated?

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 2465780c..22994682 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -604,18 +604,18 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_arena"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b4ef3cb8e2471ed0beee8fa7dec927e5a04671605b606b5d650cedaeabcfd5"
+checksum = "93575affa286089b92c8208aea4e60fe9fdd251a619a09b566d6e4e2cc123212"
 dependencies = [
  "smallvec",
 ]
 
 [[package]]
 name = "rustc-ap-rustc_ast"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2e60ae0420757f5e8304a36e9ee61848b3cdeab702e2cc91e275fa71194fac9"
+checksum = "4c700f2d3b25aa8d6446dd2936048737b08b2d547bd86e2a70afa9fee4e9c522"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_data_structures",
@@ -630,9 +630,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_ast_pretty"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c615111df0b80d1ec7fa1ddbc099cf1b5b885498c3ddeef6a455f456bef6aa60"
+checksum = "99d644c69c55deb24257cb0cb5261265fe5134f6f545e9062e1c18b07e422c68"
 dependencies = [
  "rustc-ap-rustc_ast",
  "rustc-ap-rustc_span",
@@ -641,9 +641,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_data_structures"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4f0f2d7b238d9de2bcdd365e765d61309d71bcfa1a9619e22a61bc3916310a7"
+checksum = "5d840c4e6198b57982a54543ae604d634c7ceb7107f0c75970b88ebaff077ac5"
 dependencies = [
  "arrayvec",
  "bitflags",
@@ -672,9 +672,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_errors"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c681cea52a193059f6a2d4d1d9d5a49af6d417a7d87c654c78acf34e8eb1d9d2"
+checksum = "2f2f99bdc828ad417636d9016611dc9047b641fadcb7f533b8b0e9616d81f90b"
 dependencies = [
  "annotate-snippets",
  "atty",
@@ -692,9 +692,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_feature"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8199d34846af059ff2e387934916277fdffbed92fbbcd693df4179d4f2c51e76"
+checksum = "6bb47b53670f1263ed1389dda932d5b5a6daf98579c1f076c2ee7d7f22709b7c"
 dependencies = [
  "rustc-ap-rustc_data_structures",
  "rustc-ap-rustc_span",
@@ -702,21 +702,21 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_fs_util"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce35d2a03e56e6a01f00d8e33b760363f05085859f0340d5caa39823f8cd9a44"
+checksum = "cdaddc4bae5ffab17037553e172f5014686db600050429aaa60aec14fe780e84"
 
 [[package]]
 name = "rustc-ap-rustc_graphviz"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9626d1928e8639fe327cdfa3a4b6696de9c84ac04dd8f1d010879dba4524a8d6"
+checksum = "3d73c72543311e88786f7380a3bfd946395579c1a0c0441a879a97fcdea79130"
 
 [[package]]
 name = "rustc-ap-rustc_index"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "364c76daf3da8ea105daaea6a92fed6ad89a9366267f4828d1406fc39a65745b"
+checksum = "bba8d74ed4bad44a5b4264cf2a51ad0bd458ed56caa5bb090e989b8002ec6327"
 dependencies = [
  "arrayvec",
  "rustc-ap-rustc_macros",
@@ -725,18 +725,18 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_lexer"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47cfdb02425aed8c56f85692975d262cb438ea0388e0c8cd254e73bd22bb6539"
+checksum = "3a030d00510966cd31e13dca5e6c1bd40d303a932c54eca40e854188bca8c49e"
 dependencies = [
  "unicode-xid",
 ]
 
 [[package]]
 name = "rustc-ap-rustc_lint_defs"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "158d326d78e86105c934dd9bdc1fd7afcf21f41a51acb065ac7e1ecbb4663788"
+checksum = "bdff95da1b5d979183ef5c285817ba6cc67a1ac11296ef1e87b1b5bbaf57213c"
 dependencies = [
  "rustc-ap-rustc_ast",
  "rustc-ap-rustc_data_structures",
@@ -749,9 +749,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_macros"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a16139dc0677c0417bd969dc816e820f348b1a5f8d6663c7ab0b4c526c3427d"
+checksum = "fe3ed7401bf6f5a256d58cd0e1c1e2e77eec25e60a0d7ad75313962edcb4e396"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -761,9 +761,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_parse"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b917704d699b6e5f4e9d35fcb25c8443e3229c4a3e11f4f347fbe7a964dfdbac"
+checksum = "609a624baffa3f99847d57d30c96ee6732ce0912f8df4be239b6fd91533910d6"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_ast",
@@ -781,9 +781,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_serialize"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55b6bfa271ab3778a33d3dc9c1655d6aec7bdd02d327dd80f0fb05199801a2f9"
+checksum = "bc232e2a351d8131c8f1386ce372ee22ef7b1b0b897bbf817a8ce4792029a564"
 dependencies = [
  "indexmap",
  "smallvec",
@@ -791,9 +791,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_session"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d8bcdbf64ccca1c93ce4c1b186d680fab897d936755c1c46108335066a4b3df"
+checksum = "18acf94c820cd0c64ee1cbd811fd1f4d5ba18987c457c88771359b90cb1a12f5"
 dependencies = [
  "bitflags",
  "getopts",
@@ -813,9 +813,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_span"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57c255026e999472912f5104881672003623537d5ce675d591fba38632a8b59d"
+checksum = "d3479f453a38b6a5572938d035fc2b3cb6ec379c57f598b8682b512eb90c7858"
 dependencies = [
  "cfg-if 0.1.10",
  "md-5",
@@ -833,9 +833,9 @@ dependencies = [
 
 [[package]]
 name = "rustc-ap-rustc_target"
-version = "702.0.0"
+version = "705.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d3def54a9c21135316cb84aca7c99439b60864e6ac72ba27934473e95d6787c"
+checksum = "78cacaf829778cf07bb97a9f4604896789de12392175f3743e74a30ed370f1c1"
 dependencies = [
  "bitflags",
  "rustc-ap-rustc_data_structures",
diff --git a/Cargo.toml b/Cargo.toml
index 26fb73d3..60bd2992 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,31 +39,31 @@ path = "metadata"
 
 [dependencies.rustc_ast_pretty]
 package = "rustc-ap-rustc_ast_pretty"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_data_structures]
 package = "rustc-ap-rustc_data_structures"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_errors]
 package = "rustc-ap-rustc_errors"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_parse]
 package = "rustc-ap-rustc_parse"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_session]
 package = "rustc-ap-rustc_session"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_span]
 package = "rustc-ap-rustc_span"
-version = "702.0.0"
+version = "705.0.0"
 
 [dependencies.rustc_ast]
 package = "rustc-ap-rustc_ast"
-version = "702.0.0"
+version = "705.0.0"
 
 [dev-dependencies.racer-testutils]
 version = "0.1"
diff --git a/rust-toolchain b/rust-toolchain
index edd49109..09ed3829 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,1 +1,1 @@
-nightly-2021-02-03
+nightly-2021-02-06
diff --git a/src/racer/ast.rs b/src/racer/ast.rs
index 5c264b27..4daf543a 100644
--- a/src/racer/ast.rs
+++ b/src/racer/ast.rs
@@ -896,10 +896,12 @@ pub struct TypeVisitor<'s> {
 
 impl<'ast, 's> visit::Visitor<'ast> for TypeVisitor<'s> {
     fn visit_item(&mut self, item: &ast::Item) {
-        if let ItemKind::TyAlias(_, _, _, Some(ref ty)) = item.kind {
-            self.name = Some(item.ident.name.to_string());
-            self.type_ = Ty::from_ast(&ty, self.scope);
-            debug!("typevisitor type is {:?}", self.type_);
+        if let ItemKind::TyAlias(ref ty_kind) = item.kind {
+            if let Some(ref ty) = ty_kind.3 {
+                self.name = Some(item.ident.name.to_string());
+                self.type_ = Ty::from_ast(&ty, self.scope);
+                debug!("typevisitor type is {:?}", self.type_);
+            }
         }
     }
 }
@@ -939,13 +941,13 @@ impl<'p> ImplVisitor<'p> {
 
 impl<'ast, 'p> visit::Visitor<'ast> for ImplVisitor<'p> {
     fn visit_item(&mut self, item: &ast::Item) {
-        if let ItemKind::Impl {
-            ref generics,
-            ref of_trait,
-            ref self_ty,
-            ..
-        } = item.kind
-        {
+        if let ItemKind::Impl(ref impl_kind) = item.kind {
+            let ast::ImplKind {
+                ref generics,
+                ref of_trait,
+                ref self_ty,
+                ..
+            } = **impl_kind;
             let impl_start = self.offset + get_span_start(item.span).into();
             self.result = ImplHeader::new(
                 generics,
@@ -1278,9 +1280,9 @@ where
     P: AsRef<Path>,
 {
     fn visit_item(&mut self, item: &ast::Item) {
-        if let ItemKind::Trait(_, _, _, ref bounds, _) = item.kind {
+        if let ItemKind::Trait(ref trait_kind) = item.kind {
             self.result = Some(TraitBounds::from_generic_bounds(
-                bounds,
+                &trait_kind.3,
                 &self.file_path,
                 self.offset,
             ));
diff --git a/src/racer/snippets.rs b/src/racer/snippets.rs
index 6dc3dcd3..9fde2cec 100644
--- a/src/racer/snippets.rs
+++ b/src/racer/snippets.rs
@@ -57,8 +57,8 @@ 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 AssocItemKind::Fn(_, ref msig, _, _) = method.kind {
-                    let decl = &msig.decl;
+                if let AssocItemKind::Fn(ref fn_kind) = method.kind {
+                    let decl = &fn_kind.1.decl;
                     return Some(MethodInfo {
                         // ident.as_str calls Ident.name.as_str
                         name: method.ident.name.to_string(),


Test patch: