Silencing rust-analyzer 'not implemented' errors

Hi all,

I'm testing out the excellent inline-python crate, with the following code:

use inline_python::python;

fn main() {
    let x_max = 10;

    python! {
        import matplotlib.pyplot as plt
        import numpy as np

        x = np.linspace(0, 'x_max, 1000)
        y = x**2

        plt.plot(x, y)
        plt.show()
    }
}

This works as expected, and creates a plot just as native Python would. However I'm running into an issue where the rust-analyzer extension on VSCode will squiggle underneath the entire python command:

image

with an associated error:

image

I understand that the code I'm running is experimental—to run this code requires Rust +nightly. But, short of disabling the extension, is there a method to silence an error such as this for certain sections of code? Thanks!

Update: I did some more digging in the settings for rust-analyzer in VSCode and the best method I have found is to add 'macro-error' to the list of disabled diagnostics, which appears to remove the error from my Rust code.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.