Skip to content

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Sep 24, 2025

The previous wording for this restriction was pretty confusing to me. I don't remember what I was thinking when I wrote it, and I can't find any historical explanation either. use paths can use $crate as long as they have more than one segment (use $crate::foo is obviously OK).

I have rewritten this to make it clear it is specifically about use $crate. One could say that restriction is already covered by the previous point that says use crate; requires an as, but for some reason use $crate as foo doesn't work either. So I have left this as a separate rule for now.

cc rust-lang/rust#146972 (comment) for context.

The previous wording for this restriction was pretty confusing to me. I don't remember what I was thinking when I wrote it, and I can't find any historical explanation either. `use` paths can use `$crate` as long as they have more than one segment (`use $crate::foo` is obviously OK). I have rewritten this to make it clear it is specifically about `use $crate`. One could say that restriction is already covered by the previous point that says `use crate;` requires an `as`, but for some reason `use $crate as foo` doesn't work either. So I have left this as a separate rule for now. cc rust-lang/rust#146972 (comment) for context.
@ehuss
Copy link
Contributor Author

ehuss commented Sep 24, 2025

Opening as a draft because I'm wondering how intentional this is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant