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

could not compile rustc-ap-rustc_ast when installing last version #1120

Open
gasabr opened this issue Jul 19, 2020 · 5 comments
Open

could not compile rustc-ap-rustc_ast when installing last version #1120

gasabr opened this issue Jul 19, 2020 · 5 comments

Comments

@gasabr
Copy link

gasabr commented Jul 19, 2020

I'm trying to install racer both from cargo and from sources and receive error:

$~/r/racer (master)> cargo +nightly build --release
...
error: `std::intrinsics::transmute` is not yet stable as a const fn
   --> /home/gasabr/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_ast-669.0.0/ptr.rs:136:17
    |
136 |                 std::mem::transmute(NonNull::<[T; 0]>::dangling() as NonNull<[T]>)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(const_transmute)]` to the crate attributes to enable

error: aborting due to previous error

error: could not compile `rustc-ap-rustc_ast`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

env:
I'm on ubuntu 18.04 under wsl

gasabr@DESKTOP-9TJPKDL ~/r/racer (master) [1]> rustup toolchain list
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.45.0-x86_64-unknown-linux-gnu

I've tried to change toolchain, install 2.0.13, 2.0.14 neither of that worked:(

@emuhr
Copy link

emuhr commented Jul 19, 2020

I can confirm the same issue on arch using the latest rustup from the official arch repository (1.22.1-1).
$ rustup toolchain list stable-x86_64-unknown-linux-gnu (default) nightly-x86_64-unknown-linux-gnu

@chenyanming
Copy link

Same issue in windows.

$ cargo +nightly build --release
   Compiling serde v1.0.105
   Compiling rustc-ap-rustc_ast v669.0.0
   Compiling rustc-ap-rustc_errors v669.0.0
error: `std::intrinsics::transmute` is not yet stable as a const fn
   --> C:\Users\elecm\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc-ap-rustc_ast-669.0.0\ptr.rs:136:17
    |
136 |                 std::mem::transmute(NonNull::<[T; 0]>::dangling() as NonNull<[T]>)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(const_transmute)]` to the crate attributes to enable

error: aborting due to previous error

error: could not compile `rustc-ap-rustc_ast`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@arjansingh
Copy link

Same issue in OSX. Similar messages to what everyone has above.

@p870613
Copy link

p870613 commented Jul 21, 2020

Same issue in Ubuntu20.04.
error: std::intrinsics::transmute is not yet stable as a const fn
--> /home/lin/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_ast-669.0.0/ptr.rs:136:17
|
136 | std::mem::transmute(NonNull::<[T; 0]>::dangling() as NonNull<[T]>)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(const_transmute)] to the crate attributes to enable

error: aborting due to previous error

error: could not compile rustc-ap-rustc_ast.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@thezealousfool
Copy link

As the error message says, it is a problem with rustc_ast. I tried upgrading the version of rustc_ast racer depends on, but that did not help either.

The following changes worked for me:
rustc_ast (v669.0.0, default for racer right now):
Change ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_ast-669.0.0/lib.rs line 13
from #![cfg_attr(not(bootstrap), feature(const_fn_transmute))] to #![feature(const_transmute)]

rustc_ast (v670.0.0, latest):
Change ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_ast-670.0.0/lib.rs line 12
from #![feature(const_fn_transmute)] to #![feature(const_transmute)]

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

6 participants