Getting error[E0658]: use of unstable library feature 'assoc_char_consts': recently added and error[E0658]: or-patterns syntax is experimental error

Hi! I am getting these errors when I am trying to build,

   --> /Users/baner75418/.cargo/registry/src/github.com-1ecc6299db9ec823/grass-0.10.7/src/parse/value/css_function.rs:327:22
    |
327 |                 q @ ('"' | '\'') => {
    |                      ^^^^^^^^^^
    |
    = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: or-patterns syntax is experimental
   --> /Users/baner75418/.cargo/registry/src/github.com-1ecc6299db9ec823/grass-0.10.7/src/parse/value/css_function.rs:363:22
    |
363 |                 c @ (' ' | '\t') => {
    |                      ^^^^^^^^^^
    |
    = note: see issue #54883 <https://github.com/rust-lang/rust/issues/54883> for more information

error[E0658]: use of unstable library feature 'assoc_char_consts': recently added
  --> /Users/baner75418/.cargo/registry/src/github.com-1ecc6299db9ec823/grass-0.10.7/src/parse/value/css_function.rs:94:58
   |
94 |                 '!' | '%' | '&' | '*'..='~' | '\u{80}'..=char::MAX => buf.push(tok.kind),
   |                                                          ^^^^^^^^^
   |
   = note: see issue #71763 <https://github.com/rust-lang/rust/issues/71763> for more information

error: aborting due to 3 previous errors

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

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

This is the full error message, could some one please help me fix it, I have already visited the github links I was guided to from the error message but I didn't have a clue on what it was saying.

Which rustc version are you using?

I think it is rustc 1.51.0

This compiles successfully under rustc 1.54.0:

fn main() {
    match 'f' {
        q @ ('"' | '\'') => {},
        _ => {},
    }
}

If it doesn't for you, then you'll probably need to update to do this.

How do I update rust? cuz I have tried rustup upgrade and it says its on the latest version but rustc still seems to running on 1.51

You may have installed rust twice, both via rustup and something else.

You may also have a directory toolchain override (so try to see if rustc -V's output changes from dir to dir):

  • you can also list the rustup overrides with rustup override list,

  • you can check to see if the current dir or some parent has a rust-toolchain or rust-toolchain.toml file.

Otherwise it's what Alice said, so try to apt remove rust or some equivalent command on your os / distro.

Ok so I did rustup override list and I got this /Users/baner75418/eww nightly-x86_64-apple-darwin what should I do now

You can:

  • update your nightly:

    rustup update nightly
    
  • and/or remove that override (since the code you've showcased works on stable):

    (cd /Users/baner75418/eww && rustup override unset)
    
1 Like

I am still getting an error, after removing the override and updating nightly

What does the command which rustc prints?

/usr/local/bin/rustc

That means it's not installed via rustup. What linux distro you're running? Try sudo apt remove rust or similar.

1 Like

It looks like macOS, so I suspect they might have run brew install rust. If that's the case, @iCraft85, I suggest you run brew uninstall rust. If that uninstalls rustup and/or all your rustcs on your machine, then it means that brew was also responsible for installing rustup or other rust-tangential stuff, which, similarly, is not super desirable: in that case try to also brew uninstall as much rust-related stuff as possible, and then if you were to be missing stuff, you would be able to get it back via rustup (and if you were to be missing rustup itself, you would be able to install it via curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.