Skip to content

Incorrect "operation requires unsafe block" (regression) #12839

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

Closed
massimiliano-mantione opened this issue Jul 21, 2022 · 2 comments
Closed

Incorrect "operation requires unsafe block" (regression) #12839

massimiliano-mantione opened this issue Jul 21, 2022 · 2 comments

Comments

@massimiliano-mantione
Copy link

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)

rust-analyzer version: 0.3.1131-standalone (897a7ec 2022-07-17)

rustc version: (eg. output of rustc -V)

rustc 1.56.1

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)

Nothing relevant, vscode on Linux, but see below about a rust-toolchain file.

This is a sort of regression of #5996.
I have a workspace where I lock rust version using a rust-toolchain file, to be sure that I use the same one as CI does.

I had the version still locked to 1.56.1, and now I am affected by #5996.
Downgrading rust-analyzer by one single release, or switching to the prerelease, did not fix the issue.

However, upgrading rust to 1.62.1 (e092d0b6b 2022-07-16) (putting 1.62.1 in the rust-toolchain file) fixes the issue.
I will likely keep the upgrade as a workaround (sooner or later I would have upgraded anyway, and I am in the position to also upgrade the CI Dockerfile).

I am reporting this because I think the expectation is that rust-analyzer works with any rustc version, even older ones, and not just the current one.

@lnicola
Copy link
Member

lnicola commented Jul 21, 2022

I take it you haven't seen the discussion in #12719?

I think the expectation is that rust-analyzer works with any rustc version, even older ones, and not just the current one.

That's a quite a lot to ask for. We don't support pre-1.47 sysroots, and just dropped proc macro support for a bunch of versions in #12798.

@jonas-schievink
Copy link
Contributor

Our Rust support policy is documented in the manual:

Only the latest stable standard library source is officially supported for use with rust-analyzer. If you are using an older toolchain or have an override set, rust-analyzer may fail to understand the Rust source. You will either need to update your toolchain or use an older version of rust-analyzer that is compatible with your toolchain.

Hence, closing.

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

No branches or pull requests

3 participants