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

bump rustc-ap crates to v705 #1159

Merged
merged 2 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2021-02-03
nightly-2021-02-06
28 changes: 15 additions & 13 deletions src/racer/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
Comment on lines -899 to +904
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustc is going to box itemkind variants to reduce the memory footprint, and the updated rustc-ap crate versions pull in some of changes that have started down that path.

if you'd prefer, we could enable the box_patterns feature gate for some cleaner matching, but I elected to avoid doing so in this PR

}
}
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
));
Expand Down
4 changes: 2 additions & 2 deletions src/racer/snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down