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

Failed to compile | Rust 1.43.0 | Ubuntu 20.04 - 64bit #48

Closed
DeBarrosDaRapper opened this issue Dec 28, 2020 · 4 comments
Closed

Failed to compile | Rust 1.43.0 | Ubuntu 20.04 - 64bit #48

DeBarrosDaRapper opened this issue Dec 28, 2020 · 4 comments

Comments

@DeBarrosDaRapper
Copy link

DeBarrosDaRapper commented Dec 28, 2020

error[E0658]: `while` is not allowed in a `const fn`
   --> /home/box/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:107:9
    |
107 | /         while i < encode.len() {
108 | |             if base[i] >= 128 {
109 | |                 return Err(Error::NonAsciiCharacter { index: i });
110 | |             }
...   |
120 | |             i += 1;
121 | |         }
    | |_________^
    |
    = note: see issue #52000 <https://github.com/rust-lang/rust/issues/52000> for more information

error[E0658]: `if` is not allowed in a `const fn`
   --> /home/box/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:108:13
    |
108 | /             if base[i] >= 128 {
109 | |                 return Err(Error::NonAsciiCharacter { index: i });
110 | |             }
    | |_____________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `if` is not allowed in a `const fn`
   --> /home/box/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:111:13
    |
111 | /             if decode[base[i] as usize] != 0xFF {
112 | |                 return Err(Error::DuplicateCharacter {
113 | |                     character: base[i] as char,
114 | |                     first: decode[base[i] as usize] as usize,
115 | |                     second: i,
116 | |                 });
117 | |             }
    | |_____________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

error[E0658]: `match` is not allowed in a `const fn`
   --> /home/box/.cargo/registry/src/github.com-1ecc6299db9ec823/bs58-0.4.0/src/alphabet.rs:156:12
    |
156 |           [][match result {
    |  ____________^
157 | |             Ok(alphabet) => return alphabet,
158 | |             Err(_) => 0,
159 | |         }]
    | |_________^
    |
    = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information

   Compiling void v1.0.2
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bs58`.

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

This is what the rustc --explain E0658 outputs:

An unstable feature was used.

Erroneous code example:

#[repr(u128)] // error: use of unstable library feature 'repr128'
enum Foo {
    Bar(u64),
}

If you're using a stable or a beta version of rustc, you won't be able to use
any unstable features. In order to do so, please switch to a nightly version of
rustc (by using rustup).

If you're using a nightly version of rustc, just add the corresponding feature
to be able to use it:

#![feature(repr128)]

#[repr(u128)] // ok!
enum Foo {

@cryptoquick
Copy link
Member

Continuing from our conversation on Discord:

Try compiling with the nightly toolchain, install it using rustup (rustup toolchain install nightly , if i recall correctly), then use cargo +nightly run

If that resolves it, we'll just move towards defaulting to a nightly install. That'll help for frontend development, anyway.

@DeBarrosDaRapper
Copy link
Author

``Sweet, installed rustup. Thank you!
However, I'm still experiencing compiling issues - I'm going to assert the issue is on my local machine.
Even after running the --classic, issue persists on my version of Ubuntu 20.04 LTS

sudo snap install rustup
error: This revision of snap "rustup" was published using classic confinement
and thus may perform arbitrary system changes outside of the security
sandbox that snaps are usually confined to, which may put your system at
risk.

   If you understand and want to proceed repeat the command including
   --classic

Closing issue.``

@cryptoquick
Copy link
Member

@DeBarrosDaRapper to install rust and rustup, I would recommend uninstalling anything else you've installed (including any rust and rustup packages) and then following the instructions here:
https://rustup.rs/

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