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

add support of use alias semantic in definition #4269

Merged
merged 3 commits into from May 4, 2020

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented May 2, 2020

close #4202

bnjjj added 3 commits May 1, 2020 16:26
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@@ -119,6 +119,16 @@ fn classify_name_inner(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Opti

match_ast! {
match parent {
ast::Alias(it) => {
tested_by!(goto_def_for_use_alias; force);
let use_tree = it.syntax().ancestors().find_map(ast::UseTree::cast)?;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let use_tree = it.syntax().ancestors().find_map(ast::UseTree::cast)?;
let use_tree = it.syntax().parent().and_then(ast::UseTree::cast)?;

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise, LGTM

bors r+

@bors
Copy link
Contributor

bors bot commented May 4, 2020

@bors bors bot merged commit b1a5dc8 into rust-lang:master May 4, 2020
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

Successfully merging this pull request may close these issues.

Module alias misidentified as function declaration
2 participants