#Get lint for optional features?

16 messages · Page 1 of 1 (latest)

ashen widget
#

If I have optional cfg features in a library, how would I enable the lint for them even if I'm not using the feature in question? I'm using rust-analyzer.

elfin cliff
#

I’d recommend configuring RA to always run Cargo with --all-features

ashen widget
#

its on, and it still shows that

elfin cliff
#

oh right. well that’s platform-specific stuff. you can set rust-analyzer.cargo.target = "wasm32-unknown-unknown"

#

don’t think you can check multiple platform simultaneously

ashen widget
elfin cliff
ashen widget
#

I was updating a library and I only realized it broke on wasm after I locally ran CLI for the project...

elfin cliff
#

it should be easy to do that

ashen widget
finite latch
#

I recommend having a script that runs checks/tests for all the targets you care about

#

it's possible to convince RA to build a library for multiple targets, though

finite latch
#

you can use rust-analyzer.linkedProjects to have it check multiple workspaces/packages, and if one of them has a config file specifying a different target and a path dep on the code in the other workspace, then it will run checks for both targets on the same code

#

however, this of course takes twice as long, and you get duplicated diagnostics.