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

INT: add intention to substitute an associated type #5643

Merged
merged 1 commit into from
Aug 2, 2020

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Jun 23, 2020

This PR adds an intention to substitute an associated type with its value.

Fixes: #2766

@Kobzol Kobzol added the feature label Jun 23, 2020
@Kobzol Kobzol force-pushed the int-substitute-associated-type branch from b76ecb1 to 52de4c9 Compare July 12, 2020 09:16
@Kobzol Kobzol requested a review from mchernyavsky July 12, 2020 09:16
@mchernyavsky mchernyavsky self-assigned this Jul 12, 2020
Copy link
Member

@mchernyavsky mchernyavsky left a comment

Choose a reason for hiding this comment

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

Let's check if the substituted type not in the scope and import it if needed.

image

@Kobzol Kobzol force-pushed the int-substitute-associated-type branch from 52de4c9 to 236580a Compare August 2, 2020 13:01
@Kobzol
Copy link
Member Author

Kobzol commented Aug 2, 2020

Good point, thanks. I added a call to RsImportHelper.importTypeReferencesFromTy(insertedPath, typeRef.type).

Copy link
Member

@mchernyavsky mchernyavsky left a comment

Choose a reason for hiding this comment

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

Thanks!

bors r+

bors bot added a commit that referenced this pull request Aug 2, 2020
5643: INT: add intention to substitute an associated type r=mchernyavsky a=Kobzol

This PR adds an intention to substitute an associated type with its value.

Fixes: #2766

Co-authored-by: Jakub Beránek <berykubik@gmail.com>
@mchernyavsky mchernyavsky added this to the v128 milestone Aug 2, 2020
@bors
Copy link
Contributor

bors bot commented Aug 2, 2020

Build failed:

  • check

@Kobzol
Copy link
Member Author

Kobzol commented Aug 2, 2020

bors retry

@bors
Copy link
Contributor

bors bot commented Aug 2, 2020

Build succeeded:

@bors bors bot merged commit b263ab3 into intellij-rust:master Aug 2, 2020
@Kobzol Kobzol deleted the int-substitute-associated-type branch August 2, 2020 20:26
@dima74 dima74 mentioned this pull request Sep 29, 2022
bors bot added a commit that referenced this pull request Oct 13, 2022
9429: REF: Inline type alias r=ortem a=dima74

Add refactoring "Inline type alias" in addition to existing intention "Substitute type alias" (#5643, #7345). The refactoring allows to inline all usages.

Fixes #5756
Related: #824

<img src="https://user-images.githubusercontent.com/6505554/188242081-5550dd76-ac57-44d4-a62e-853f42e888d9.gif" width="50%">

changelog: Add refactoring `Inline type alias`


Co-authored-by: Dmitry Murzin <diralik@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intention: substitute associated type
2 participants