Skip to content

feat: import trait with alias #15788

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

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Conversation

Young-Flash
Copy link
Member

@Young-Flash Young-Flash commented Oct 22, 2023

close #15684

import_trait_with_alias

cc @Veykril

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 22, 2023
@Young-Flash
Copy link
Member Author

can anyone help review this?

thanks

@lnicola
Copy link
Member

lnicola commented Oct 31, 2023

Was check_assist picking the last one? I didn't look.

Anyway, the tests are probably overkill, but LGTM. Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 31, 2023

📌 Commit 929544e has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 31, 2023

⌛ Testing commit 929544e with merge 99e94d2...

@lnicola lnicola marked this pull request as draft October 31, 2023 14:49
@lnicola lnicola marked this pull request as ready for review October 31, 2023 14:49
@lnicola
Copy link
Member

lnicola commented Oct 31, 2023

Sorry, I marked the wrong PR as draft by mistake.

@bors
Copy link
Contributor

bors commented Oct 31, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 99e94d2 to master...

@bors bors merged commit 99e94d2 into rust-lang:master Oct 31, 2023
@Young-Flash
Copy link
Member Author

Was check_assist picking the last one? I didn't look.

check_assist doesn't specify label, when use check_assist, assist_label is None.

pub(crate) fn check_assist(assist: Handler, ra_fixture_before: &str, ra_fixture_after: &str) {
let ra_fixture_after = trim_indent(ra_fixture_after);
check(assist, ra_fixture_before, ExpectedResult::After(&ra_fixture_after), None);
}

and it just get the pop out one
let assist = match assist_label {
Some(label) => res.into_iter().find(|resolved| resolved.label == label),
None => res.pop(),
};

here should use check_assist_by_label instead.

@Young-Flash Young-Flash deleted the import_anonymously branch November 1, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import assist for traits on unresolved trait item should offer importing anonymously
4 participants