Stream: t-compiler/rust-analyzer

Topic: debugging lints


Jade (Dec 15 2020 at 05:26, on Zulip):

Hi! Since, it appears, 0.2.400 or 0.2.408, I am getting a macro-error lint on any asm blocks (repro: unsafe { asm!("") }) which I'd like to fix myself to learn how the project works. I've read the dev docs which say that the usual way of managing this kind of thing is to write a unit test, however, I couldn't quite figure out where to put that test.

The page I read (https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev) said that such things might go in the parser crate, but I don't know what it means by "manual test" and whether that is what I want. It also seems to be that the error for this is generated by something to do with HIR, which makes it unclear to me whether it would be triggered by tests in there.

Can someone give me some pointers on where to start on this?

Edwin Cheng (Dec 15 2020 at 07:31, on Zulip):

Seem like we are not supported asm builtin macro yet, you could follow how PR #6874 works and add a test similar to this

Edwin Cheng (Dec 15 2020 at 07:33, on Zulip):

And I think a dummy implementation for asm macro is okay for now

Jade (Dec 15 2020 at 09:12, on Zulip):

alrighty, thanks for the help! I've filed a PR: https://github.com/rust-analyzer/rust-analyzer/pull/6889

Last update: Jul 28 2021 at 03:15UTC