tracing icon indicating copy to clipboard operation
tracing copied to clipboard

tracing: deprecate outdated macro syntax

Open hawkw opened this issue 4 years ago • 1 comments

Feature Request

Crates

  • tracing

Motivation

Currently, tracing's event macros support outdated syntax where fields are delimited using { }. This was added due to parsing ambiguities in the macros which we have since resolved, and it is no longer necessary when writing events with messages and fields. The macros continue to support this syntax for backwards-compatibility reasons. This adds unnecessary complexity to the macros.

Proposal

In preparation for an eventual breaking change to tracing, we should consider deprecating this syntax. We could have the macro arms that use it generate an import of a hidden deprecated type, or something, so that users get a deprecation warning. Then, when we release 0.2, we can stop supporting backwards compatibility with this syntax.

Alternatives

Alternatively, we can not do this. There are two potential ways we would "not do this".

  1. We could just not drop support for this syntax in 0.2. The macros would continue to support the curly brace syntax. This would mean we would continue having to support this complexity, but we could remove it in a hypothetical future 0.3 release or something.

  2. We could just remove this syntax as part of 0.2 without deprecating it first. This is technically semver-compliant. However, I'd prefer to do a proper deprecation cycle, since it gives users a warning that they should remove uses of this syntax, before we just remove it.

hawkw avatar Apr 09 '20 16:04 hawkw

We might want to deprecate it because curly braces are also used for evaluating const names and so the usage may become ambiguous to the parser.

See #2837

mladedav avatar Feb 18 '24 00:02 mladedav