Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Compiler panics on latest RLS when compiling crates that depend on bitflags 1.0.5 #1449

Closed
rust-lang/rust
#60649

Description

I'm trying to develop a crate which ends up using nix as a dependency.
I'm getting the following error through RLS since I've updated to the latest stable:
(stable-x86_64-unknown-linux-gnu unchanged - rustc 1.34.1 (fc50f328b 2019-04-24), ArchLinux 5.0.10-arch1-1-ARCH)

Could not compile `nix`.
process didn't exit successfully: `/home/xxx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rls --crate-name nix /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.13.0/src/lib.rs --color never --crate-type lib --emit=dep-info,metadata -C debuginfo=2 -C metadata=e41c62fd44c3a368 -C extra-filename=-e41c62fd44c3a368 --out-dir /home/xxx/bug/target/rls/debug/deps -L dependency=/home/xxx/bug/target/rls/debug/deps --extern bitflags=/home/xxx/bug/target/rls/debug/deps/libbitflags-162b4a56bd08b901.rmeta --extern cfg_if=/home/xxx/bug/target/rls/debug/deps/libcfg_if-dab04317bb5fc6db.rmeta --extern libc=/home/xxx/bug/target/rls/debug/deps/liblibc-98ec97d48b6e5b85.rmeta --extern void=/home/xxx/bug/target/rls/debug/deps/libvoid-e59ad8b8a3ae09b4.rmeta --cap-lints allow --error-format=json --sysroot /home/xxx/.rustup/toolchains/stable-x86_64-unknown-linux-gnu` (exit code: 101)

Using "rust-client.logToFile": true, to get the log, I get this additional information:

{"message":"src/librustc/ty/context.rs:541: node_type: no type for node `expr <Self>::AT_SYMLINK_NOFOLLOW (id=43804)`","code":null,"level":"error: internal compiler error","spans":[],"children":[],"rendered":"error: internal compiler error: src/librustc/ty/context.rs:541: node_type: no type for node `expr <Self>::AT_SYMLINK_NOFOLLOW (id=43804)`\n\n"}
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.34.1 (fc50f328b 2019-04-24) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

I'm unsure whether this is an RLS or Rust bug, but this error does not happen when compiling through cargo check, cargo build, cargo build --release, cargo doc, etc, only through RLS, and I may not be able to give proper information in a rustc issue as to what the precise flags that cause this are.

The following minimal project triggers the bug when opening VSCode with the RLS extension installed :

Cargo.toml:

[package]
name = "bug"
version = "1.0.0"
authors = ["Le me"]
edition = "2018"
publish = false

[dependencies]
nix = "0.13.0"

src/main.rs:

fn main() {
	let hw = "HelloWorld";
	println!("{}", hw);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions