Errata RFC 4004: Discourage locally recursive accessible(..) - #4004
Draft
dingxiangfei2009 wants to merge 1 commit into
Draft
Errata RFC 4004: Discourage locally recursive accessible(..)#4004dingxiangfei2009 wants to merge 1 commit into
accessible(..)#4004dingxiangfei2009 wants to merge 1 commit into
Conversation
Darksonn
reviewed
Aug 27, 2026
Comment on lines
+360
to
+366
| Most importantly, restricting accessibility condition allows us to reject the | ||
| following code that is impossible to compile. | ||
|
|
||
| ```rust | ||
| #[cfg(not(accessible(MyTy)))] | ||
| pub type MyTy = u8; | ||
| ``` |
Member
There was a problem hiding this comment.
Do we want to blanket disallow all usage within the same crate, or just disallow cyclic usage? I think it could be useful for one module to say cfg(accessible(crate::other_module)) to see if another module is available.
Author
There was a problem hiding this comment.
Is the availability of crate::other_module unconditional or is it a gadget to evaluate some large cfg expression?
Contributor
|
Since RFCs are generally kept alone minus typos + links to future RFCs, I think what would make more sense is to create an RFC for the final merged version of |
Errata: We discourage locally recursive accessible(..).A
dingxiangfei2009
force-pushed
the
rfc-2523-no-local
branch
from
August 27, 2026 12:59
a2eca51 to
e010f74
Compare
accessible(..)accessible(..)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Since RFCs involve many conversations at once that can be difficult to follow, please use review comment threads on the text changes instead of direct comments on the RFC.
If you don't have a particular section of the RFC to comment on, you can click on the "Comment on this file" button on the top-right corner of the diff, to the right of the "Viewed" checkbox. This will create a separate thread even if others have commented on the file too.
Related to rust-lang/rust#64797
Rendered