Skip to content

Fails to build from source (Rust 1.41.1) #6667

Closed
@grunweg

Description

@grunweg

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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.1485827954.workers.dev-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions