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

Fails to build from source (Rust 1.41.1) #6667

Closed
grunweg opened this issue Nov 29, 2020 · 3 comments · Fixed by #6961
Closed

Fails to build from source (Rust 1.41.1) #6667

grunweg opened this issue Nov 29, 2020 · 3 comments · Fixed by #6961
Labels
S-actionable Someone could pick this issue up and work on it right now

Comments

@grunweg
Copy link

grunweg commented Nov 29, 2020

Steps to reproduce

Run the following commands in a terminal.

$ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
$ cargo xtask install --server

Expected results

rust-analyzer builds successfully from source.

Actual results

The build fails with the following output.

``` Compiling xshell-macros v0.1.6 Compiling ungrammar v1.1.4 Compiling libc v0.2.80 Compiling crc32fast v1.2.1 Compiling proc-macro2 v1.0.24 Compiling anyhow v1.0.34 Compiling walkdir v2.3.1 error[E0658]: use of unstable library feature 'matches_macro' --> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/xshell-macros-0.1.6/src/lib.rs:25:10 | 25 | if !(matches!(literal, TokenTree::Literal(_)) && literal_text.starts_with('"')) { | ^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/65721

error[E0658]: use of unstable library feature 'matches_macro'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ungrammar-1.1.4/src/lexer.rs:122:5
|
122 | matches!(c, '\' | ''')
| ^^^^^^^
|
= note: for more information, see rust-lang/rust#65721

error[E0658]: use of unstable library feature 'matches_macro'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ungrammar-1.1.4/src/lexer.rs:125:5
|
125 | matches!(c, ' ' | '\t' | '\n')
| ^^^^^^^
|
= note: for more information, see rust-lang/rust#65721

error[E0658]: use of unstable library feature 'matches_macro'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ungrammar-1.1.4/src/lexer.rs:128:5
|
128 | matches!(c, 'a'..='z' | 'A'..='Z' | '_')
| ^^^^^^^
|
= note: for more information, see rust-lang/rust#65721

error[E0658]: use of unstable library feature 'matches_macro'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ungrammar-1.1.4/src/parser.rs:68:16
|
68 | if matches!(node_data.rule, DUMMY_RULE) {
| ^^^^^^^
|
= note: for more information, see rust-lang/rust#65721

error[E0658]: use of unstable library feature 'matches_macro'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ungrammar-1.1.4/src/parser.rs:102:9
|
102 | if !matches!(p.grammar[node].rule, DUMMY_RULE) {
| ^^^^^^^
|
= note: for more information, see rust-lang/rust#65721

Compiling miniz_oxide v0.4.3
error[E0658]: use of unstable library feature 'proc_macro_span'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/xshell-macros-0.1.6/src/lib.rs:161:45
|
161 | ident.set_span(ident.span().resolved_at(span).located_at(span));
| ^^^^^^^^^^^
|
= note: for more information, see rust-lang/rust#54725

error[E0658]: use of unstable library feature 'proc_macro_span'
--> /home/michael/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/xshell-macros-0.1.6/src/lib.rs:161:63
|
161 | ident.set_span(ident.span().resolved_at(span).located_at(span));
| ^^^^^^^^^^
|
= note: for more information, see rust-lang/rust#54725

error: aborting due to 3 previous errors

For more information about this error, try rustc --explain E0658.
error: could not compile xshell-macros.
warning: build failed, waiting for other jobs to finish...
error: aborting due to 5 previous errors

For more information about this error, try rustc --explain E0658.
error: could not compile ungrammar.
warning: build failed, waiting for other jobs to finish...
error: build failed

</details>


## Version information
I'm using rustc and cargo from my distribution (Debian buster).
```$ rustc --version
rustc 1.41.1
$ cargo --version
cargo 1.42.1

Theory

I suppose my rustc version is too old to build rust-analyzer from source (since the matches! macro was only stabilised in 1.42). This comment confirms that only the latest stable version of rustc is supported.

It would be good to document this. The Users' manual, from which my steps above are taken, doesn't mention this; neither could I find it in the developer's docs.

@grunweg
Copy link
Author

grunweg commented Nov 29, 2020

My second half of the comment is collapsed in the Details section for some reason. Here it is again, for ease of reading.

Version information

I'm using rustc and cargo from my distribution (Debian buster).

rustc 1.41.1
$ cargo --version
cargo 1.42.1

Theory

I suppose my rustc version is too old to build rust-analyzer from source (since the matches! macro was only stabilised in 1.42). This comment confirms that only the latest stable version of rustc is supported.

It would be good to document this. The Users' manual, from which my steps above are taken, doesn't mention this; neither could I find it in the developer's docs.

@grunweg grunweg changed the title ## Fails to build from source (Rust 1.41.1) Fails to build from source (Rust 1.41.1) Nov 29, 2020
@lnicola
Copy link
Member

lnicola commented Nov 29, 2020

You're right, only the latest compiler version is supported. This should be checked here, I'm not sure why it's not working for you.

Do you want to submit a PR (to fix the version check and/or to update the docs)?

As an aside, you might be able to use the binaries available on GitHub if you don't want to use rustup.

@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Dec 20, 2020
@lnicola
Copy link
Member

lnicola commented Dec 20, 2020

Filed #6961 to document this. Looks like the version check didn't work because xtask itself fails to compile.

@bors bors bot closed this as completed in 6cfbeb3 Dec 20, 2020
@bors bors bot closed this as completed in #6961 Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants