-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove unnecessary unstable features from libsyntax (and all transitive dependencies) to allow rustfmt to work on stable and enable the deprecation of syntex #41732
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
Comments
ping #41729 |
Tracking issue for stabilizing i128: #35118 |
I'm also in favour of this solution, we were independently discussing it on twitter last night :-) The other major Syntex client is bindgen. I don't think forcing Rustfmt and Bindgen into the rustup distro model (necessary for stability) is a good idea, really. IIRC actually making libsyntax stable is a bigger job than we might think, perhaps @erickt or @dtolnay could give estimates of how much work, but a few hours seems wildly on the low side. Nominating for compiler team meeting. |
@nrc maybe not a couple of hours, but I believe someone could do it within a week, given stable |
Could i128 simply be |
@kennytm you'd have to have some sort of replacement, which means using a struct, which means |
It wouldn't be a huge deal, but it would be a deal. |
@ubsan Is it possible to use the (Basically I wouldn't like to see i128 rushed to stablization by this, given that AtomicU128 and FFI are still not quite solved, and I don't like to see this being blocked by i128.) |
@kennytm that seems... bad? |
@ubsan Sufficient if the crippled libsyntax won't touch 128-bit literals 😄. The 128-bit types are used solely for If a custom structure is needed, it only needs to provide The dependencies of libsyntax is in a worse shape though, in particular [dependencies]
serialize = { path = "../libserialize" }
log = "0.3"
rustc_bitflags = { path = "../librustc_bitflags" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_errors = { path = "../librustc_errors" }
rustc_data_structures = { path = "../librustc_data_structures" } Ignoring rust/src/libsyntax_pos$ git grep '\[feature'
lib.rs:26:#![feature(const_fn)]
lib.rs:27:#![feature(custom_attribute)]
lib.rs:28:#![feature(optin_builtin_traits)]
lib.rs:30:#![feature(rustc_private)]
lib.rs:31:#![feature(staged_api)]
lib.rs:32:#![feature(specialization)]
rust/src/librustc_error$ git grep '\[feature'
lib.rs:20:#![feature(custom_attribute)]
lib.rs:22:#![feature(rustc_private)]
lib.rs:23:#![feature(staged_api)]
lib.rs:24:#![feature(range_contains)]
lib.rs:25:#![feature(libc)]
rust/src/librustc_data_structures$ git grep '\[feature'
lib.rs:28:#![feature(shared)]
lib.rs:29:#![feature(collections_range)]
lib.rs:30:#![feature(nonzero)]
lib.rs:31:#![feature(rustc_private)]
lib.rs:32:#![feature(staged_api)]
lib.rs:33:#![feature(unboxed_closures)]
lib.rs:34:#![feature(fn_traits)]
lib.rs:35:#![feature(untagged_unions)]
lib.rs:36:#![feature(associated_consts)]
lib.rs:37:#![feature(unsize)]
lib.rs:38:#![feature(i128_type)]
lib.rs:39:#![feature(conservative_impl_trait)]
lib.rs:40:#![feature(discriminant_value)]
lib.rs:41:#![feature(specialization)]
lib.rs:42:#![feature(manually_drop)]
lib.rs:43:#![feature(struct_field_attributes)]
rust/src/libsyntax$ git grep rustc_data_structures
Cargo.toml:17:rustc_data_structures = { path = "../librustc_data_structures" }
ast.rs:26:use rustc_data_structures::indexed_vec;
lib.rs:44:extern crate rustc_data_structures;
ptr.rs:46:use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
util/rc_slice.rs:15:use rustc_data_structures::stable_hasher::{StableHasher, StableHasherResult,
util/small_vector.rs:11:use rustc_data_structures::small_vec::SmallVec; |
|
This is no longer needed - we're using rustup for rustfmt. |
rustfmt needs to parse Rust code. Its options are libsyntax and syntex. @erickt (and everyone else) wants to deprecate syntex now that it's no longer needed for Serde. But libsyntax uses unstable features, which means that it will make people require a nightly compiler in the same vein that clippy currently does (i.e. will need to have one installed, but will not infect user code with nightliness). One option is to just ship rustfmt officially and not care that it can't be built on stable, in the same vein as libstd. But @ubsan would prefer to get libsyntax running on stable, and she believes that it would not be prohibitively difficult to do so.
Excerpted conversation for reference:
TL;DR: stabilize "i128" and "unicode", make the "rustc" features conditional on being used in rustc, and remove everything else. Should take "maybe a few hours of work". :P
The text was updated successfully, but these errors were encountered: