Skip to content

group_imports: add ExternalCrate #5343

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatchMixolydic
Copy link
Contributor

@PatchMixolydic PatchMixolydic commented May 16, 2022

This is similar to the existing StdExternalCrate, but doesn't give std, core, and alloc their own group. Conceptually, std and friends are just external libraries (though they have some magical abilities thanks to lang items and rustc_attrs), so this is the style I naturally gravitated towards. Unfortunately, I'm not sure how common this pattern is throughout the ecosystem, and it even took one person by surprise when I brought it up. Nevertheless, at least four people seem to agree with this ordering at the time of writing, so I do hope this option will be useful to someone other than me.

This is similar to the existing `StdExternalCrate`, but doesn't give
`std`, `core`, and `alloc` their own group. Conceptually, `std` and
friends are just external libraries (though they have some magical
abilities thanks to lang items and `rustc_attrs`), so this is the style
I naturally gravitated towards. I'm not sure how common this pattern is
throughout the ecosystem, but I do hope this will be useful to someone
other than me.
@calebcartwright
Copy link
Member

Thank you for the PR. Haven't had a chance to look at the diff and given the current backlog it may be a bit before we get to it. However, do want to acknowledge both having seen this as well as our openness to supporting other group_imports variants

@calebcartwright
Copy link
Member

I think it would probably be worth some bikeshedding on the variant name. This might suffice in isolation, but we need to think about the variant name in the context of the other variants, and my concern is that ExternCrate doesn't implicitly connote how it differs from the existing StdExternCrate.

I can't think of a good name offhand either, but the style to me feels like a flavor of "everything else, and then crate" so I'd love to come up with a variant name that better reflects that

@calebcartwright
Copy link
Member

Something like NoncrateCrate is perhaps more descriptive but a real mouthful 🤔

@PatchMixolydic
Copy link
Contributor Author

Sorry for the delay ^^;

Unfortunately, I haven't been able to think of a better name than NoncrateCrate in the past seven months. However, #5632 might obviate the need for a name (and this PR) altogether, so I'd like to see how that goes before pushing this PR further.

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

Successfully merging this pull request may close these issues.

3 participants