Let's say there is one warning, such as path_statements , unused_variables . Is there a way to ignore one moment of this without isolating them from a code block or function?
To be clear when there is one warning in the code. I would like it to be quiet, but there was no need to make special changes regarding a specific warning. And without these reassuring warnings somewhere else, even later in the same function.
With GCC, this can be done as follows:
#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat" this_would_raise_Wformat(args); #pragma GCC diagnostic pop
Does Rust have an equivalent capability?
Notice I am asking about the general case, like silent warnings. I know there are ways to resolve an unused var warning, for example.
source share