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

Some crates fail with "failed to parse all tokens" #5

Closed
stusmall opened this issue Jun 21, 2018 · 5 comments
Closed

Some crates fail with "failed to parse all tokens" #5

stusmall opened this issue Jun 21, 2018 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@stusmall
Copy link

I have several dependencies that fail with this. It is easy to reproduce locally with this project: Antti/rust-amqp@234dbdb

I fails with the following output:

amqp v0.1.1 (file:///home/stusmall/Workspace/Upstream/rust-amqp) (0, 4, 1, 0, 0) ☢
├── amq-proto v0.1.0 (0, 0, 65, 0, 0) ☢
│ ├── Failed to parse file: /home/stusmall/.cargo/registry/src/github.com-1ecc6299db9ec823/bit-vec-0.4.4/src/lib.rs, ParseError(Some("failed to parse crate: failed to parse all tokens"))
bit-vec v0.4.4 (0, 0, 0, 0, 0)
│ ├── byteorder v0.5.3 (0, 38, 0, 0, 0) ☢
│ ├── enum_primitive v0.1.1 (0, 0, 0, 0, 0)
│ │ └── num-traits v0.1.43 (0, 0, 0, 0, 0)
│ │ └── num-traits v0.2.5 (0, 10, 0, 0, 0) ☢
│ ├── env_logger v0.3.5 (0, 0, 0, 0, 0)
│ │ ├── log v0.3.9 (1, 10, 0, 0, 0) ☢
│ │ │ └── log v0.4.2 (0, 25, 0, 0, 0) ☢
│ │ │ └── cfg-if v0.1.3 (0, 0, 0, 0, 0)
│ │ └── regex v0.1.80 (0, 20, 1, 0, 3) ☢
│ │ ├── aho-corasick v0.5.3 (0, 12, 0, 0, 0) ☢
│ │ │ └── memchr v0.1.11 (0, 80, 0, 0, 0) ☢
│ │ │ └── libc v0.2.42 (0, 0, 0, 0, 0)
│ │ ├── memchr v0.1.11 (0, 80, 0, 0, 0) ☢
│ │ ├── regex-syntax v0.3.9 (0, 0, 0, 0, 0)
│ │ ├── thread_local v0.2.7 (1, 128, 2, 0, 3) ☢
│ │ │ └── thread-id v2.0.0 (0, 4, 0, 0, 0) ☢
│ │ │ ├── kernel32-sys v0.2.2 (0, 0, 0, 0, 0)
│ │ │ │ └── winapi v0.2.8 (0, 0, 0, 0, 0)
│ │ │ │ [build-dependencies]
│ │ │ │ └── winapi-build v0.1.1 (0, 0, 0, 0, 0)
│ │ │ └── libc v0.2.42 (0, 0, 0, 0, 0)
│ │ └── utf8-ranges v0.1.3 (0, 2, 0, 0, 0) ☢
│ ├── error-chain v0.10.0 (0, 0, 0, 0, 0)
│ │ └── backtrace v0.3.8 (9, 232, 0, 0, 4) ☢
│ │ ├── backtrace-sys v0.1.23 (0, 0, 0, 0, 0)
│ │ │ └── libc v0.2.42 (0, 0, 0, 0, 0)
│ │ │ [build-dependencies]
│ │ │ └── cc v1.0.17 (0, 162, 2, 0, 4) ☢
│ │ ├── cfg-if v0.1.3 (0, 0, 0, 0, 0)
│ │ ├── libc v0.2.42 (0, 0, 0, 0, 0)
│ │ └── rustc-demangle v0.1.8 (0, 0, 0, 0, 0)
│ └── log v0.3.9 (1, 10, 0, 0, 0) ☢
├── env_logger v0.3.5 (0, 0, 0, 0, 0)
├── log v0.3.9 (1, 10, 0, 0, 0) ☢
├── openssl v0.7.14 (14, 1542, 7, 0, 14) ☢
│ ├── bitflags v0.7.0 (0, 0, 0, 0, 0)
│ ├── lazy_static v0.2.11 (0, 17, 2, 0, 0) ☢
│ ├── libc v0.2.42 (0, 0, 0, 0, 0)
│ ├── openssl-sys v0.7.17 (19, 24, 1, 0, 0) ☢
│ │ └── libc v0.2.42 (0, 0, 0, 0, 0)
│ │ [build-dependencies]
│ │ └── pkg-config v0.3.11 (0, 0, 0, 0, 0)
│ └── openssl-sys-extras v0.7.14 (3, 0, 0, 0, 0) ☢
│ ├── libc v0.2.42 (0, 0, 0, 0, 0)
│ └── openssl-sys v0.7.17 (19, 24, 1, 0, 0) ☢
│ [build-dependencies]
│ └── gcc v0.3.54 (0, 162, 2, 0, 4) ☢
│ [build-dependencies]
│ └── gcc v0.3.54 (0, 162, 2, 0, 4) ☢
└── url v1.7.0 (0, 2, 0, 0, 0) ☢
├── idna v0.1.4 (0, 1, 0, 0, 0) ☢
│ ├── matches v0.1.6 (0, 0, 0, 0, 0)
│ ├── unicode-bidi v0.3.4 (0, 0, 0, 0, 0)
│ │ └── matches v0.1.6 (0, 0, 0, 0, 0)
│ └── unicode-normalization v0.1.7 (0, 20, 0, 0, 0) ☢
├── matches v0.1.6 (0, 0, 0, 0, 0)
└── percent-encoding v1.0.1 (0, 3, 0, 0, 0) ☢

@anderejd
Copy link
Contributor

Thanks!

I have seen some of those parse errors too, it seems to be the syn crate that can't parse all Rust yet, but it needs to be verified. Should probably report the parse error directly to the syn project issue tracker.

@anderejd anderejd added bug Something isn't working help wanted Extra attention is needed labels Jun 21, 2018
@vi
Copy link

vi commented Apr 17, 2019

Another parsing error:

Failed to parse file: /home/vi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.16/test/benchmark.rs, Syn(Error { start_span: Span, end_span: Span, message: "LexError" }, "/home/vi/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.16/test/benchmark.rs")

@Nugine
Copy link

Nugine commented Jul 23, 2019

Another

Failed to parse file: /home/nugine/.cargo/registry/src/mirrors.ustc.edu.cn-15f9db60536bad60/mio-0.6.19/test/benchmark.rs, Syn(Error("LexError"), "/home/nugine/.cargo/registry/src/mirrors.ustc.edu.cn-15f9db60536bad60/mio-0.6.19/test/benchmark.rs") 
Failed to parse file: /home/nugine/.cargo/registry/src/mirrors.ustc.edu.cn-15f9db60536bad60/syn-0.15.39/tests/features/error.rs, Syn(Error("expected one of: `extern`, `use`, `static`, `const`, `unsafe`, `async`, `fn`, `mod`, `type`, `existential`, `struct`, `enum`, `union`, `trait`, `auto`, `impl`, `default`, `macro`, identifier, `self`, `super`, `extern`, `crate`, `::`"), "/home/nugine/.cargo/registry/src/mirrors.ustc.edu.cn-15f9db60536bad60/syn-0.15.39/tests/features/error.rs") 

@jmcconnell26
Copy link
Contributor

Landing #161 to bring version of syn used to the latest version.

@pinkforest
Copy link
Collaborator

pinkforest commented Jan 6, 2022

This seems resolved - re-open if still an issue.

I've added general current parsing error tracker @ #240

docker run -ti --rm rust /bin/bash
    cargo install cargo-geiger --git https://github.com/rust-secure-code/cargo-geiger --force
    mkdir app ; cd app
    git clone https://github.com/Antti/rust-amqp.git .
    cargo geiger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants