When emitting notes we perform a special check:
it the snippet of a note exactly matches the snippet of the diagnostic it's attached to, we don't emit it.
The logic being, there's no point to showing the same snippet twice.
However:
We never actually do this. I replaced the check with a panic, and it was never hit. All the tests passed just fine.
We're in control of the snippets. If a note and an error have the same snippet, the correct fix is to just remove the snippet from one! Not leave it as is, but filter it out during error emission.
When emitting notes we perform a special check: it the snippet of a note exactly matches the snippet of the diagnostic it's attached to, we don't emit it. The logic being, there's no point to showing the same snippet twice.
However: