Annotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)
authorStephen Toub <stoub@microsoft.com>
Tue, 18 Jul 2023 13:38:21 +0000 (09:38 -0400)
committerGitHub <noreply@github.com>
Tue, 18 Jul 2023 13:38:21 +0000 (09:38 -0400)
commitfddb5d8c1815edbd3bc93a9a1fd6be6dc9bf1605
tree19bd9b35cea1928e2a0ec75cad6bf0f916abc4b0
parent04bb7e53b4c2c24776c3ce0a690a15f6f6f0b166
Annotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)

As with Debug.Assert/Fail, by default failures result in fail fasts.  It's possible for other trace listeners to be plugged in instead, but there's no way to model that with nullable reference types.  There's no reason Trace should be on a different plan from Debug, so this moves it to having the same annotations Debug has had for years.
src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Trace.cs
src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceInternal.cs