How do I emit a warning on a parser instance from another module? (Specifically, I'm in the
asm! parsing module.)
I tried doing
p.sess .span_diagnostic .struct_span_warn(p.prev_token.span, "Duplicate option") .emit();
p: &mut Parser<'a>, but nothing happened. I also tried emitting an error instead, but still no error was emitted.
Am I missing something?
Oh wow, I just realized why it didn't work: my test code didn't have that issue in it, so the warning wasn't triggered :face_palm:
Hard-coded warnings are discouraged and should ideally be all replaced with lints or errors.
I'm actually now using an error; I was using a warning because I thought that a breaking change wasn't okay, but it is since I'm working on an unstable feature