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

prelude unavailable in latest rust-analyzer releases #18423

Closed
indietyp opened this issue Oct 28, 2024 · 13 comments
Closed

prelude unavailable in latest rust-analyzer releases #18423

indietyp opened this issue Oct 28, 2024 · 13 comments
Labels
C-bug Category: bug

Comments

@indietyp
Copy link

indietyp commented Oct 28, 2024

Since a couple of days, the prelude has been missing from my installation, a complete re-install via rustup, removing the target folder (either by deleting it or cargo clean), and clearing cargo cache all didn't help.

I did a tiny bit of dissecting, and the problem started appearing between rust-analyzer 1.84.0-nightly (3ed6e3cc 2024-10-17) and rust-analyzer 1.84.0-nightly (e92993db 2024-10-18), using any rust-analyzer version prior to 2024-10-18 does not result in the issue.

The issue is that the prelude is seemingly missing, prelude types such as Option are not imported/shown. I've attached examples of what I mean.

This also propagates to macros such as tracing, where I am getting errors, such as: unresolved macro line (macro-error), see the picture below.

The logs seem to indicate that RA is stuck during some kind of resolution (the log has been uploaded as an LFS object into the regression repository).

rust-analyzer version: rust-analyzer 1.84.0-nightly (df4ca44d 2024-10-27)

rustc version: rustc 1.84.0-nightly (df4ca44d3 2024-10-27)

editor or extension: Zed, replicated in Zed Preview and VSCode

relevant settings: RA_LOG=info

repository link: https://github.com/indietyp/rust-analyzer-regressions/tree/prelude-missing, branch prelude missing

Image
Image
Image

@indietyp indietyp added the C-bug Category: bug label Oct 28, 2024
@Veykril
Copy link
Member

Veykril commented Oct 28, 2024

This does indeed look like chalk hanging up, though we haven't done anything special here I think. Given the very new rustc version it might be some change in the standard library

@flodiebold
Copy link
Member

Unresolved macros don't indicate Chalk though, do they 🤔

The example project has a rust-toolchain.toml with specific components, I'm not sure whether that means rust-src will be included?

@Veykril
Copy link
Member

Veykril commented Oct 28, 2024

Unresolved macros don't indicate Chalk though, do they 🤔

The example project has a rust-toolchain.toml with specific components, I'm not sure whether that means rust-src will be included?

i was going off of the linked log (in the rep) but that might not even be relevant on a second look

@indietyp
Copy link
Author

I just tried to explicitly add rust-src (it's being installed), no change.

info: syncing channel updates for 'nightly-2024-10-28-aarch64-apple-darwin'
info: latest update on 2024-10-28, rust version 1.84.0-nightly (df4ca44d3 2024-10-27)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'llvm-tools'
info: downloading component 'miri'
info: downloading component 'rust-analyzer'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'llvm-tools'
info: installing component 'miri'
info: installing component 'rust-analyzer'
info: installing component 'rust-docs'
info: installing component 'rust-src'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'

@indietyp
Copy link
Author

Unresolved macros don't indicate Chalk though, do they 🤔

but the problem during resolve is simply that line! (a macro that is in the prelude) couldn't be found. So it isn't really a macro error. Expansion errors out because it can't fine the line (and after that file) macro

@chrisp60
Copy link

I imagine this doesn't help much but I am also seeing similar / identical issues on neovim.

:MasonInstall rust-analyzer@nightly

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.84.0-nightly (df4ca44d3 2024-10-27)

I noticed the issue by None being linted as a false positive for non_snake_case, while hover info showing its path as core::option::Option. When messing with things I would also come across RA completely dropping requests with an error close to "server stopped request", but that part could be unrelated / my own configuration issues.

@Veykril
Copy link
Member

Veykril commented Oct 28, 2024

Is this happening for older rust nightlies as well? (since both of you posted rustc 1.84.0-nightly (df4ca44d3 2024-10-27))

@indietyp
Copy link
Author

I accidentally actually used rust-analyzer 1.84.0-nightly (df4ca44d 2024-10-27) on the toolchain of 2024-10-17, and that seemed to work. This leads to me believe that something in the std changed that makes chalk freak out.

Hope that helps!

@indietyp
Copy link
Author

indietyp commented Oct 30, 2024

Using cargo-bisect-rustc I was able to pin down the commit (sadly not the unrolled commit) to rust-lang/rust@db8043b.

This commit is the likely candidate where it all stopped working.

(The command I used was: cargo-bisect-rustc --start=2024-10-17 --end=2024-10-28 --prompt --with-src --with-dev -c rust-analyzer, then changing the toolchain each time, restarting RA and seeing if I get any hints / errors).

I was sadly not able to drill down further which commit is the culprit. I'll investigate further.

To verify that I did this correctly - I did the bisection twice, with the same result.

I got - when trying to see if the unrolled builds worked:

Attempting to search unrolled perf builds
Found commits ["063f44fa", "9207519c", "fd205304", "469779c9", "ac038306"]
installing 063f44fa4f7355b5bcf8731b2a5b5736a8d01695
uninstalling 063f44fa4f7355b5bcf8731b2a5b5736a8d01695
installing 9207519c2f38c33b28774d7518141d39b7edb7d1
uninstalling 9207519c2f38c33b28774d7518141d39b7edb7d1
installing fd2053041260a98dde80baba0d8d83a9b08f2b48
uninstalling fd2053041260a98dde80baba0d8d83a9b08f2b48
installing 469779c91d9df5a514f715b79b8f9ef0e815606a
uninstalling 469779c91d9df5a514f715b79b8f9ef0e815606a
installing ac03830635242ccb6bc5f5ba2cf970e1ceb5575b
uninstalling ac03830635242ccb6bc5f5ba2cf970e1ceb5575b
ERROR: none of the toolchains satisfied the predicate
cargo-bisect-rustc --start=2024-10-17 --end=2024-10-28 --prompt --with-src --with-dev -c rust-analyzer
checking the start range to find a passing nightly
installing nightly-2024-10-17
rust-std-nightly-aarch64-apple-darwin: 25.75 MB / 25.75 MB [=====================] 100.00 % 7.95 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.94s


nightly-2024-10-17 finished with exit code Some(0).
please select an action to take:
RESULT: nightly-2024-10-17, ===> Successfully compiled
uninstalling nightly-2024-10-17

checking the end range to verify it does not pass
installing nightly-2024-10-28
rust-std-nightly-aarch64-apple-darwin: 25.77 MB / 25.77 MB [=====================] 100.00 % 2.18 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.62s


nightly-2024-10-28 finished with exit code Some(0).
please select an action to take:
RESULT: nightly-2024-10-28, ===> Compile error
uninstalling nightly-2024-10-28

6 versions remaining to test after this (roughly 3 steps)
installing nightly-2024-10-22
rust-std-nightly-aarch64-apple-darwin: 25.76 MB / 25.76 MB [====================] 100.00 % 11.03 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.00s


nightly-2024-10-22 finished with exit code Some(0).
please select an action to take:
RESULT: nightly-2024-10-22, ===> Compile error
uninstalling nightly-2024-10-22

3 versions remaining to test after this (roughly 2 steps)
installing nightly-2024-10-19
rust-std-nightly-aarch64-apple-darwin: 25.82 MB / 25.82 MB [====================] 100.00 % 11.04 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.90s


nightly-2024-10-19 finished with exit code Some(0).
please select an action to take:
RESULT: nightly-2024-10-19, ===> Compile error
uninstalling nightly-2024-10-19

1 versions remaining to test after this (roughly 1 steps)
installing nightly-2024-10-18
rust-std-nightly-aarch64-apple-darwin: 25.73 MB / 25.73 MB [====================] 100.00 % 10.80 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.88s


nightly-2024-10-18 finished with exit code Some(0).
please select an action to take:
RESULT: nightly-2024-10-18, ===> Successfully compiled
uninstalling nightly-2024-10-18

searched toolchains nightly-2024-10-17 through nightly-2024-10-28


********************************************************************************
Regression in nightly-2024-10-19
********************************************************************************

fetching https://static.rust-lang.org/dist/2024-10-18/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2024-10-18: 40 B / 40 B [=====================================] 100.00 % 269.78 KB/s converted 2024-10-18 to 3ed6e3cc69857129c1d314daec00119ff47986ed
fetching https://static.rust-lang.org/dist/2024-10-19/channel-rust-nightly-git-commit-hash.txt
nightly manifest 2024-10-19: 40 B / 40 B [=====================================] 100.00 % 230.01 KB/s converted 2024-10-19 to e92993dbb43f0a5d17fe56e2d82f90435d6521c8
looking for regression commit between 2024-10-18 and 2024-10-19
fetching (via remote github) commits from max(3ed6e3cc69857129c1d314daec00119ff47986ed, 2024-10-16) to e92993dbb43f0a5d17fe56e2d82f90435d6521c8
ending github query because we found starting sha: 3ed6e3cc69857129c1d314daec00119ff47986ed
get_commits_between returning commits, len: 9
  commit[0] 2024-10-17: Auto merge of #131848 - matthiaskrgr:rollup-l29a75j, r=matthiaskrgr
  commit[1] 2024-10-17: Auto merge of #131572 - cuviper:ub-index_range, r=thomcc
  commit[2] 2024-10-18: Auto merge of #131869 - matthiaskrgr:rollup-xrkz174, r=matthiaskrgr
  commit[3] 2024-10-18: Auto merge of #131362 - Kobzol:ci-free-runners-linux-4c, r=Mark-Simulacrum
  commit[4] 2024-10-18: Auto merge of #131887 - jieyouxu:rollup-ftik4ni, r=jieyouxu
  commit[5] 2024-10-18: Auto merge of #13561 - flip1995:rustup, r=flip1995
  commit[6] 2024-10-18: Auto merge of #131841 - paulmenage:futex-abstraction, r=joboet
  commit[7] 2024-10-18: Auto merge of #131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
  commit[8] 2024-10-18: Auto merge of #131892 - flip1995:clippy-subtree-update, r=Manishearth
validated commits found, specifying toolchains

checking the start range to verify it passes
installing 3ed6e3cc69857129c1d314daec00119ff47986ed
rust-std-nightly-aarch64-apple-darwin: 26.61 MB / 26.61 MB [====================] 100.00 % 11.20 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.88s


3ed6e3cc69857129c1d314daec00119ff47986ed finished with exit code Some(0).
please select an action to take:
RESULT: 3ed6e3cc69857129c1d314daec00119ff47986ed, ===> Successfully compiled
uninstalling 3ed6e3cc69857129c1d314daec00119ff47986ed

checking the end range to verify it does not pass
installing e92993dbb43f0a5d17fe56e2d82f90435d6521c8
rust-std-nightly-aarch64-apple-darwin: 26.54 MB / 26.54 MB [====================] 100.00 % 11.07 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.96s


e92993dbb43f0a5d17fe56e2d82f90435d6521c8 finished with exit code Some(0).
please select an action to take:
RESULT: e92993dbb43f0a5d17fe56e2d82f90435d6521c8, ===> Compile error
uninstalling e92993dbb43f0a5d17fe56e2d82f90435d6521c8

4 versions remaining to test after this (roughly 3 steps)
installing 1350eead10c46b9d3c2007fe0ea7892b7d7337ab
rust-std-nightly-aarch64-apple-darwin: 26.52 MB / 26.52 MB [====================] 100.00 % 11.07 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.92s


1350eead10c46b9d3c2007fe0ea7892b7d7337ab finished with exit code Some(0).
please select an action to take:
RESULT: 1350eead10c46b9d3c2007fe0ea7892b7d7337ab, ===> Compile error
uninstalling 1350eead10c46b9d3c2007fe0ea7892b7d7337ab

2 versions remaining to test after this (roughly 2 steps)
installing db8043bb199705e72246ca43d4af1e9dbe7d55be
rust-std-nightly-aarch64-apple-darwin: 26.51 MB / 26.51 MB [====================] 100.00 % 11.00 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.99s


db8043bb199705e72246ca43d4af1e9dbe7d55be finished with exit code Some(0).
please select an action to take:
RESULT: db8043bb199705e72246ca43d4af1e9dbe7d55be, ===> Compile error
uninstalling db8043bb199705e72246ca43d4af1e9dbe7d55be

1 versions remaining to test after this (roughly 1 steps)
installing d9c4b8d475360b52e6debead2cd710e9fe3c7110
rust-std-nightly-aarch64-apple-darwin: 26.58 MB / 26.58 MB [====================] 100.00 % 10.80 MB/s testing...
   Compiling proc-macro2 v1.0.89
   Compiling unicode-ident v1.0.13
   Compiling once_cell v1.20.2
   Compiling pin-project-lite v0.2.15
   Compiling tracing-core v0.1.32
   Compiling quote v1.0.37
   Compiling syn v2.0.85
   Compiling tracing-attributes v0.1.27
   Compiling tracing v0.1.40
   Compiling regressions v0.1.0 (/Users/bmahmoud/Sync/projects/development/rust-analyzer/regressions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.88s


d9c4b8d475360b52e6debead2cd710e9fe3c7110 finished with exit code Some(0).
please select an action to take:
RESULT: d9c4b8d475360b52e6debead2cd710e9fe3c7110, ===> Successfully compiled
uninstalling d9c4b8d475360b52e6debead2cd710e9fe3c7110

searched toolchains 3ed6e3cc69857129c1d314daec00119ff47986ed through e92993dbb43f0a5d17fe56e2d82f90435d6521c8


********************************************************************************
Regression in db8043bb199705e72246ca43d4af1e9dbe7d55be
********************************************************************************

Attempting to search unrolled perf builds
Found commits ["063f44fa", "9207519c", "fd205304", "469779c9", "ac038306"]
installing 063f44fa4f7355b5bcf8731b2a5b5736a8d01695
uninstalling 063f44fa4f7355b5bcf8731b2a5b5736a8d01695
installing 9207519c2f38c33b28774d7518141d39b7edb7d1
uninstalling 9207519c2f38c33b28774d7518141d39b7edb7d1
installing fd2053041260a98dde80baba0d8d83a9b08f2b48
uninstalling fd2053041260a98dde80baba0d8d83a9b08f2b48
installing 469779c91d9df5a514f715b79b8f9ef0e815606a
uninstalling 469779c91d9df5a514f715b79b8f9ef0e815606a
installing ac03830635242ccb6bc5f5ba2cf970e1ceb5575b
uninstalling ac03830635242ccb6bc5f5ba2cf970e1ceb5575b
ERROR: none of the toolchains satisfied the predicate
==================================================================================
= Please file this regression report on the rust-lang/rust GitHub repository     =
=        New issue: https://github.com/rust-lang/rust/issues/new                 =
=     Known issues: https://github.com/rust-lang/rust/issues                     =
= Copy and paste the text below into the issue report thread.  Thanks!           =
==================================================================================

searched nightlies: from nightly-2024-10-17 to nightly-2024-10-28
regressed nightly: nightly-2024-10-19
searched commit range: https://github.com/rust-lang/rust/compare/3ed6e3cc69857129c1d314daec00119ff47986ed...e92993dbb43f0a5d17fe56e2d82f90435d6521c8
regressed commit: https://github.com/rust-lang/rust/commit/db8043bb199705e72246ca43d4af1e9dbe7d55be

@indietyp
Copy link
Author

My current hunch is that it has something to do with: rust-lang/rust#131857, I enabled debug logs in VSCode and looked through it, and I found a bunch of repeating CoerceUnsized. Now I don't know if that is coincidence, or something - but might(?) be the reason. I am just guessing at this point^^

@lnicola
Copy link
Member

lnicola commented Oct 30, 2024

The lockfile version bump also looks interesting, but it doesn't seem to cause problems in stable Cargo. I don't see a way for rust-lang/rust#131857 to affect us.

@Veykril
Copy link
Member

Veykril commented Oct 30, 2024

That PR has no effect for us, it doesnt touch the std lib nor any compiler crates we use

@indietyp
Copy link
Author

indietyp commented Nov 1, 2024

Okay, so, I got a bit desperate and removed a bunch of old cargo binaries, while doing so it turned out that my default toolchain (nightly) was way behind (1.77-nightly) updating the default toolchain to the newest one (2024-11-01) seems to have solved the problem. I do not know how that solved the problem, and also don't understand how the default toolchain installed via rustup would influence RA.

Mysterious.

@lnicola lnicola closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

5 participants