The following generates a warning that the local variable stream is unused, but when the using keyword is present, the _ discard cannot be used.
void Foo(string path)
{
using var stream = File.Create(path);
}
The following fails to compile:
using File.Create(path);
And the following (correctly) generates a different sonar warning that the {} is empty
using (File.Create(path)) {}