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

Most (all?) macros are unresolved #9101

Closed
umanwizard opened this issue Jun 1, 2021 · 10 comments · Fixed by #9102
Closed

Most (all?) macros are unresolved #9101

umanwizard opened this issue Jun 1, 2021 · 10 comments · Fixed by #9102

Comments

@umanwizard
Copy link
Contributor

Bisected to f96c1a0 . This makes rust-analyzer basically unusable as even basic things from the prelude like vec![] and todo!() are unresolved.

In case it matters, the code I'm working on is the latest origin/main of https://github.com/MaterializeInc/materialize .

image

@umanwizard
Copy link
Contributor Author

The server logs hundreds of messages like

[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `std::prelude::rust_2015` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `std::prelude::rust_2015` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `std::prelude::rust_2015` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `std::prelude::rust_2015` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::std::prelude::rust_2018` to module (resolved to None)

@jonas-schievink
Copy link
Contributor

Which Rust version are you using?

@flodiebold
Copy link
Member

1.51

@dvdplm
Copy link

dvdplm commented Jun 1, 2021

Seeing something similar although not quite:

[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR hir_def::nameres::collector] could not resolve prelude path `::core::prelude::rust_2018` to module (resolved to None)
[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(Some(ExitStatus(ExitStatus(11)))), server request error: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }

Toolchain:
nightly-x86_64-apple-darwin (default)
rustc 1.54.0-nightly (657bc0188 2021-05-31)

Rust analyzer 4f63e79 (Merge #9097)

FWIW I've seen the proc macro server crashed for some time now (I usually build a fresh rust-analyzer every day).

Happy to provide more debugging information.

@jonas-schievink
Copy link
Contributor

We don't really support Rust versions older than the current stable

@umanwizard
Copy link
Contributor Author

@jonas-schievink Ok, good to know. Feel to close this if you don't consider issues involving old stable to be bugs in rust-analyzer.

@jonas-schievink
Copy link
Contributor

For now, I'm adding a fallback to the legacy prelude in #9102, please test if that fixes your issue

@bors bors bot closed this as completed in dbdfeee Jun 1, 2021
@dvdplm
Copy link

dvdplm commented Jun 1, 2021

#9102 reduces my error log to:

[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(Some(ExitStatus(ExitStatus(11)))), server request error: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }

So that's progress. :)

@jonas-schievink
Copy link
Contributor

Do names resolve correctly? The PR also silences the error

@umanwizard
Copy link
Contributor Author

#9102 fixes the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants