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

[cleanup] Ty::is_ref and Ty::is_region_ptr are identical #109372

Closed
scottmcm opened this issue Mar 20, 2023 · 2 comments · Fixed by #109378
Closed

[cleanup] Ty::is_ref and Ty::is_region_ptr are identical #109372

scottmcm opened this issue Mar 20, 2023 · 2 comments · Fixed by #109378
Assignees
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@scottmcm
Copy link
Member

scottmcm commented Mar 20, 2023

is_ref:

pub fn is_ref(self) -> bool {
matches!(self.kind(), Ref(..))
}

is_region_ptr:

pub fn is_region_ptr(self) -> bool {
matches!(self.kind(), Ref(..))
}

I don't know which name is better, but there probably shouldn't be two is_* helpers doing exactly the same thing.

@compiler-errors
Copy link
Member

I prefer is_ref. We don't really call them "region pointers" anymore.

@compiler-errors compiler-errors added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels Mar 20, 2023
@mu001999
Copy link
Contributor

@rustbot claim

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 21, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 22, 2023
@bors bors closed this as completed in 2ee07a1 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants