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

Prelude injection should not use gated features #13533

Closed
brson opened this issue Apr 15, 2014 · 8 comments
Closed

Prelude injection should not use gated features #13533

brson opened this issue Apr 15, 2014 · 8 comments
Labels
P-low Low priority

Comments

@brson
Copy link
Contributor

brson commented Apr 15, 2014

Right now the prelude magically uses both #[feature(phase)] and #[feature(globs)] without declaring so. Something as critical as the prelude should not require the use of features that aren't actually part of the stable language. Nominating.

@eddyb
Copy link
Member

eddyb commented Apr 16, 2014

To remove the dependency on #[phase], we might be able to call syntax::ext::expand::load_extern_macros from rustc, but that looks like a hack to me.

If globs are removed, resolve could still special-case prelude(s), without having complicated semi-cycle-aware glob resolution logic (std::prelude would be disallowed from having a prelude).

@klutzy
Copy link
Contributor

klutzy commented Apr 16, 2014

I think glob issue can be solved by managing prelude list at rustc::front::std_inject. POC code here.

@huonw
Copy link
Member

huonw commented Apr 16, 2014

Having the list in std is nice because it means it can be documented, and having this outside the compiler is generally nice too. I'm not sure if either of these two factors are strong enough to override the need to avoid feature gating (in that manner, at least).

@alexcrichton
Copy link
Member

I was under the impression that use foo::bar::*; will be un-gated once pub use foo::bar::*; is removed, and #[phase(syntax)] will be ungated for loading macro_rules! macros. Dropping #[phase(syntax, link)] sounds a little dubious (what if you don't want the macros?), however.

@pnkfelix
Copy link
Member

we can bless the use of certain implementation strategies in the prelude itself, such as in this case using #[feature(phase)] and #[feature(globs)], that are just being used to provide functionality that could be expressed by some other means. As long as we only allow the prelude to employ #[feature(...)] in cases like that, where we can still specify what provided functionality is, without referencing the features themselves that the prelude used.

@pnkfelix
Copy link
Member

(we should avoid adding more feature cruft to the prelude, but if we need to do, it needs to basically adhere to the same constraints that I described above).

@pnkfelix
Copy link
Member

Marking as P-low, not 1.0 milestone.

@alexcrichton
Copy link
Member

Neither of these features are gated any more, so this is no longer an issue.

notriddle pushed a commit to notriddle/rust that referenced this issue Nov 10, 2022
docs: add crates section to the manual

closes rust-lang#13533

Added a section to the user manual, to make it easier for users to find the correct crate.
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 18, 2024
…r=dswij

Fix span issue on `implicit_saturating_sub`

Fixes rust-lang#13524

changelog: [`implicit_saturating_sub`]: Fix span issue on else blocks
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 18, 2024
…r=y21

[`implicit_saturating_sub`] Fix suggestion with a less volatile approach

Related to rust-lang#13533, such and obvious mistake got pass my watch, quite embarassing :/

Revert rust-lang#13533 and implement a more robust solution.

Revert "Fix span issue on `implicit_saturating_sub`
This reverts commit 140a127.

changelog: [`lint_name`]: Fix suggestion for `if {} else if {} else {}` cases

r? `@y21`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-low Low priority
Projects
None yet
Development

No branches or pull requests

6 participants