-
Notifications
You must be signed in to change notification settings - Fork 607
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
Display "edition" from manifest on crate-page #1541
Comments
This just requires a recent enough compiler so I don't think this is something we should do this as it's really no different than "this crate requires 1.31" which is a separate discussion (there have been multiple RFCs on that) |
@lukaslueg and @Eh2406, could you elaborate a bit on why this would be nice/useful and different from the compiler version the crate requires? Given a new enough compiler, you can depend on crates that use either edition without needing to care which edition the dependency uses, barring some potential keywords used as functions in the public API that would need the raw identifier syntax. Or do you mean as a potential contributor to the crate, rather than a potential user of it? In other words, if this information was displayed on crates.io, what would you do differently based on it? |
I had not fully thought this thure when I emoted, having read the responses I agree that it is just a weaker form of MSRV. |
Well, this is actually a weak argument in the first place: While there is an ongoing discussion on how to communicate rustc version requirements, the |
I think it would make sense, for the users to know about editions as @lukaslueg mentioned and to advertise the lattest edition (in case someone missed the information) and slightly encourage maintainers to migrate to a more recent edition because it would grant their crate the edtion 2018 badge. |
FWIW I've implemented that on lib.rs: https://lib.rs/crates/tokio-async-await (edit: shown only when the edition is very new or very old, otherwise it was too noisy). |
Since this issue was opened we've started to parse the embedded crates.io/src/controllers/krate/publish.rs Line 143 in ec92708
Doing something similar for the We could then display it like this: |
For myself, I feel like screen real estate is precious: the more you show, the harder it is to use what you've got. Edition is an implementation detail. It should not matter to |
in any case we will want the information in the database at least. how exactly we display it or what we derive from it we can still discuss once we actually have the information :) |
I'm curious, what is helped by having it in the database? |
at the very least it will make it easier to run edition data analysis on the database dump, but as you wrote above, inferring an MSRV from the edition field is also a possibility |
So last this was discussed, the next step was to put it in the database "for reasons" without an end plan for this. Now a PR is merged to show it without any reasoning given in the PR. Yes, its at least in a tooltip so its not taking up space but being tied tg the MSRV tooltip and saying the package requires an Edition at best does nothing (they already have an MSRV) and at worse implies some additionally requirement beyond MSRV. |
some people find it informational and I don't see why we should completely hide the information. if you are not one of those people then that's fine, but I don't see what's wrong with showing this information in the tooltip, since, as you requested above, it's not even using up the precious real estate on the screen. |
This is an example of a crate that has an explicit
edition = "2018"
in it's manifest. It would be nice if the crate-page would show a marker/banner/hint that this crate expects a 2018-environmentThe text was updated successfully, but these errors were encountered: