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

Request: always import from core when possible #12979

Closed
Lokathor opened this issue Aug 8, 2022 · 1 comment · Fixed by #13212
Closed

Request: always import from core when possible #12979

Lokathor opened this issue Aug 8, 2022 · 1 comment · Fixed by #13212
Labels
A-completion autocompletion A-config configuration C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@Lokathor
Copy link

Lokathor commented Aug 8, 2022

Now that we no longer need to use extern crate core to use paths into the core crate, I would like an RA setting to always select the core path for an item whenever possible. For example, if importing Debug, prefer core::fmt::Debug to std::fmt::Debug.

I often want to develop crates that are fundamentally no_std, but use printing during debugging, so I don't actually turn on no_std until the moment of publishing, at which point I have to fix any imports that RA made. If RA could just always prefer core this would help me.

@bjorn3 bjorn3 added A-completion autocompletion C-feature Category: feature request labels Aug 8, 2022
@Veykril Veykril added the A-config configuration label Aug 8, 2022
@jonas-schievink jonas-schievink added the S-actionable Someone could pick this issue up and work on it right now label Aug 8, 2022
bors added a commit that referenced this issue Sep 12, 2022
Add config to unconditionally prefer core imports over std

Fixes #12979
@bors bors closed this as completed in 7d19971 Sep 12, 2022
@lnicola
Copy link
Member

lnicola commented Sep 12, 2022

I thought we actually had some form of auto-detection here. It would be nice to automatically use core if the current file already has imports from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion A-config configuration C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants