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

MIR basic_block should not be accessed via function #1626

Closed
Hoblovski opened this issue Mar 1, 2023 · 1 comment · Fixed by #1631
Closed

MIR basic_block should not be accessed via function #1626

Hoblovski opened this issue Mar 1, 2023 · 1 comment · Fixed by #1631

Comments

@Hoblovski
Copy link
Contributor

I'm reading the section on Identifiers in the compiler and it claims

BasicBlock identifies a basic block. It points to an instance of BasicBlockData, which can be retrieved by indexing into Body::basic_blocks() (note that you must call a function; the field is private).

However as of March 2023, I see rust-lang/rust/master is no longer using the function basic_block(), but instead directly accessing the field (yeah it's public now).

Am I missing anything or should we update this sentence? Thank you.

@JohnTitor
Copy link
Member

JohnTitor commented Mar 3, 2023

Thanks for reporting!
You're right, the field is now public and the method has been removed, see #1631 's description.

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 a pull request may close this issue.

2 participants