rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Error detecting variable type

Open shootingsyh opened this issue 6 years ago • 4 comments

Sorry I didn't get a clear repro here. Here is the file containing the problem: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=073305de6384df0e7ba6e11bdf798189 at line 80.

Or you may download git project at https://github.com/shootingsyh/rxstream, and open vs code with rust plugin and rust-analyser setup. See file with_latest_from.rs.

queued_source is a pin project field, and should be of type Option. When calling the Option::take function, rust-analyser think it is a stream and expect it to have one argument.

shootingsyh avatar Jul 27 '20 02:07 shootingsyh

is a pin project field

We don't support proc macros other than custom derives.

lnicola avatar Jul 27 '20 08:07 lnicola

It causes an explicit syntax error in the IDE. If proc macro is not supported, should we mark it just as unknown and not issuing an error?

发自我的iPhone

在 2020年7月27日,上午1:32,Laurențiu Nicola [email protected] 写道:

 is a pin project field

We don't support proc macros other than custom derives.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

shootingsyh avatar Jul 27 '20 15:07 shootingsyh

It's not a syntax error, but rather a false positive in a "wrong argument count" check. The check can be disabled in the latest release using the rust-analyzer.diagnostics.enableExperimental setting.

lnicola avatar Jul 27 '20 15:07 lnicola

Closing this as a duplicate of #6029 since it's caused by an unexpanded proc macro attribute.

flodiebold avatar Dec 21 '20 21:12 flodiebold