attributes: add more compile fail tests #306
Labels
status: needs PR
Issue just needs a Pull Request implementing the changes
type: test
Test coverage or infrastructure improvements
Milestone
now that there's CI infrastructure in place for compile fail tests (added in #293) we should add tests for these scenarios:
timestamp
andpanic_handler
used on a function with the wrong signature. For instance, all these examples are UB (they are rejected at compile time today):global_logger
used on a struct that has fields. I don't think this is much of an issue (unsure if it's even checked today) but the fields won't be accessed bydefmt
so accepting this would be misleading at best.these compile fail tests are also a good place to check the helpfulness of our error messages. For example, this:
should say "error: expected
defmt::Formatter
, foundi32
", ideally with a span that points to the42
expression, instead of the a helpful "methodneeds_tag
not found oni32
value". (not sure what the current error message says)The text was updated successfully, but these errors were encountered: