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

Don't inherit stability to items in a function body. #19029

Merged
merged 1 commit into from
Nov 18, 2014
Merged

Don't inherit stability to items in a function body. #19029

merged 1 commit into from
Nov 18, 2014

Conversation

elinorbgr
Copy link
Contributor

Items defined in the body of a function has no visibility outside it, and thus have no reason to inherit its stability.

Closes #17488

@aturon
Copy link
Member

aturon commented Nov 17, 2014

@vberger Thanks for the PR!

It seems to me that we just shouldn't apply any stability level to these internal items, since stability is wholly about public APIs. Seems like it should be as easy as halting the recursive walk altogether (which would treat the stability as unmarked). What do you think?

@elinorbgr
Copy link
Contributor Author

@aturon I was not really sure about this, that's why I only prevented inheritance.

But yeah, given stability is only relevant for public APIs, there is no real point in marking these items at all, so halting the recursion is probably a better choice. I'll change it.

Items defined in the body of a function has no visibility
outside it, and thus have no reason to be marked with
stability attributes.

Closes #17488
@bors bors merged commit 5520050 into rust-lang:master Nov 18, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Jan 27, 2025
internal: Skip redundant path search in `resolve_completion_edits`
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.

Items defined in a function inherit the stability of the function and trigger lint checker
3 participants