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 @@ -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, { 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(),