Skip to content

Commit 8508279

Browse files
Update Microsoft.Net.Compilers.Toolset (#31403)
1 parent 0ada833 commit 8508279

File tree

12 files changed

+31
-24
lines changed

12 files changed

+31
-24
lines changed

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
</PropertyGroup>
159159
<PropertyGroup Label="Manual">
160160
<!-- Packages from dotnet/roslyn -->
161-
<MicrosoftNetCompilersToolsetVersion>3.8.0-5.20519.18</MicrosoftNetCompilersToolsetVersion>
161+
<MicrosoftNetCompilersToolsetVersion>3.10.0-1.final</MicrosoftNetCompilersToolsetVersion>
162162
<!-- DiagnosticAdapter package pinned temporarily until migrated/deprecated -->
163163
<MicrosoftExtensionsDiagnosticAdapterVersion>5.0.0-preview.4.20180.4</MicrosoftExtensionsDiagnosticAdapterVersion>
164164
<!-- Build tool dependencies -->

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#nullable enable
22
*REMOVED*static Microsoft.AspNetCore.Components.ParameterView.FromDictionary(System.Collections.Generic.IDictionary<string!, object!>! parameters) -> Microsoft.AspNetCore.Components.ParameterView
33
*REMOVED*virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo! fieldInfo, System.EventArgs! eventArgs) -> System.Threading.Tasks.Task!
4+
*REMOVED*readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string!
45
Microsoft.AspNetCore.Components.ComponentApplicationState
56
Microsoft.AspNetCore.Components.ComponentApplicationState.OnPersisting -> Microsoft.AspNetCore.Components.ComponentApplicationState.OnPersistingCallback!
67
Microsoft.AspNetCore.Components.ComponentApplicationState.OnPersistingCallback
@@ -35,4 +36,4 @@ Microsoft.AspNetCore.Components.RenderTree.Renderer.GetEventArgsType(ulong event
3536
override Microsoft.AspNetCore.Components.LayoutComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) -> System.Threading.Tasks.Task!
3637
static Microsoft.AspNetCore.Components.ParameterView.FromDictionary(System.Collections.Generic.IDictionary<string!, object?>! parameters) -> Microsoft.AspNetCore.Components.ParameterView
3738
virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo? fieldInfo, System.EventArgs! eventArgs) -> System.Threading.Tasks.Task!
38-
*REMOVED*readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string
39+
readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string?

src/Components/Components/src/RenderTree/RenderTreeEdit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public readonly struct RenderTreeEdit
4848
/// If the <see cref="Type"/> value is <see cref="RenderTreeEditType.RemoveAttribute"/>,
4949
/// gets the name of the attribute that is being removed.
5050
/// </summary>
51-
[FieldOffset(16)] public readonly string RemovedAttributeName;
51+
[FieldOffset(16)] public readonly string? RemovedAttributeName;
5252

5353
private RenderTreeEdit(RenderTreeEditType type) : this()
5454
{

src/Components/Ignitor/src/ElementHive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private void ApplyEdits(RenderBatch batch, ContainerNode parent, int childIndex,
149149
var node = parent.Children[childIndexAtCurrentDepth + siblingIndex];
150150
if (node is ElementNode element)
151151
{
152-
var attributeName = edit.RemovedAttributeName;
152+
var attributeName = edit.RemovedAttributeName!;
153153

154154
// First try to remove any special property we use for this attribute
155155
if (!TryApplySpecialProperty(batch, element, attributeName, default))

src/DataProtection/DataProtection/src/KeyManagement/IKeyManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public interface IKeyManager
5959
/// This method will not mutate existing IKey instances. After calling this method,
6060
/// all existing IKey instances should be discarded, and GetAllKeys should be called again.
6161
/// </remarks>
62-
void RevokeKey(Guid keyId, string reason = null);
62+
void RevokeKey(Guid keyId, string? reason = null);
6363

6464
/// <summary>
6565
/// Revokes all keys created before a specified date and persists the revocation to the
@@ -72,6 +72,6 @@ public interface IKeyManager
7272
/// This method will not mutate existing IKey instances. After calling this method,
7373
/// all existing IKey instances should be discarded, and GetAllKeys should be called again.
7474
/// </remarks>
75-
void RevokeAllKeys(DateTimeOffset revocationDate, string reason = null);
75+
void RevokeAllKeys(DateTimeOffset revocationDate, string? reason = null);
7676
}
7777
}

src/DataProtection/DataProtection/src/Managed/ManagedAuthenticatedEncryptor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ public byte[] Decrypt(ArraySegment<byte> protectedPayload, ArraySegment<byte> ad
229229
macOffset = eofOffset - _validationAlgorithmDigestLengthInBytes;
230230
}
231231

232-
correctHash = hashAlgorithm.ComputeHash(protectedPayload.Array, ivOffset, macOffset - ivOffset);
232+
correctHash = hashAlgorithm.ComputeHash(protectedPayload.Array!, ivOffset, macOffset - ivOffset);
233233
}
234234

235235
// Step 4: Validate the MAC provided as part of the payload.
236236

237-
if (!CryptoUtil.TimeConstantBuffersAreEqual(correctHash, 0, correctHash.Length, protectedPayload.Array, macOffset, eofOffset - macOffset))
237+
if (!CryptoUtil.TimeConstantBuffersAreEqual(correctHash, 0, correctHash.Length, protectedPayload.Array!, macOffset, eofOffset - macOffset))
238238
{
239239
throw Error.CryptCommon_PayloadInvalid(); // integrity check failure
240240
}
@@ -247,7 +247,7 @@ public byte[] Decrypt(ArraySegment<byte> protectedPayload, ArraySegment<byte> ad
247247
var outputStream = new MemoryStream();
248248
using (var cryptoStream = new CryptoStream(outputStream, cryptoTransform, CryptoStreamMode.Write))
249249
{
250-
cryptoStream.Write(protectedPayload.Array, ciphertextOffset, macOffset - ciphertextOffset);
250+
cryptoStream.Write(protectedPayload.Array!, ciphertextOffset, macOffset - ciphertextOffset);
251251
cryptoStream.FlushFinalBlock();
252252

253253
// At this point, outputStream := { plaintext }, and we're done!
@@ -349,7 +349,7 @@ public byte[] Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> additiona
349349
var mac = validationAlgorithm.ComputeHash(underlyingBuffer, KEY_MODIFIER_SIZE_IN_BYTES, checked((int)outputStream.Length - KEY_MODIFIER_SIZE_IN_BYTES));
350350
outputStream.Write(mac, 0, mac.Length);
351351

352-
// At this point, outputStream := { keyModifier || IV || ciphertext || MAC(IV || ciphertext) }
352+
// At this point, outputStream := { keyModifier || IV || ciphertext || MAC(IV || ciphertext) }
353353
// And we're done!
354354
return outputStream.ToArray();
355355
}

src/DataProtection/DataProtection/src/PublicAPI.Unshipped.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
*REMOVED*static Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.DefaultKeyStorageDirectory.get -> System.IO.DirectoryInfo!
2929
*REMOVED*static Microsoft.AspNetCore.DataProtection.Repositories.RegistryXmlRepository.DefaultRegistryKey.get -> Microsoft.Win32.RegistryKey!
3030
*REMOVED*virtual Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver.ResolveCertificate(string! thumbprint) -> System.Security.Cryptography.X509Certificates.X509Certificate2!
31+
*REMOVED*Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeAllKeys(System.DateTimeOffset revocationDate, string! reason = null) -> void
32+
*REMOVED*Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeKey(System.Guid keyId, string! reason = null) -> void
3133
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptorFactory.CreateEncryptorInstance(Microsoft.AspNetCore.DataProtection.KeyManagement.IKey! key) -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
3234
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory.CreateEncryptorInstance(Microsoft.AspNetCore.DataProtection.KeyManagement.IKey! key) -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
3335
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptorFactory.CreateEncryptorInstance(Microsoft.AspNetCore.DataProtection.KeyManagement.IKey! key) -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
@@ -38,6 +40,8 @@ Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryp
3840
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory.CreateEncryptorInstance(Microsoft.AspNetCore.DataProtection.KeyManagement.IKey! key) -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
3941
Microsoft.AspNetCore.DataProtection.DataProtectionOptions.ApplicationDiscriminator.get -> string?
4042
Microsoft.AspNetCore.DataProtection.KeyManagement.IKey.CreateEncryptor() -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
43+
Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeAllKeys(System.DateTimeOffset revocationDate, string? reason = null) -> void
44+
Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeKey(System.Guid keyId, string? reason = null) -> void
4145
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution.DefaultKey -> Microsoft.AspNetCore.DataProtection.KeyManagement.IKey?
4246
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution.FallbackKey -> Microsoft.AspNetCore.DataProtection.KeyManagement.IKey?
4347
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager.RevokeSingleKey(System.Guid keyId, System.DateTimeOffset revocationDate, string? reason) -> void
@@ -56,4 +60,4 @@ Microsoft.AspNetCore.DataProtection.XmlEncryption.NullXmlEncryptor.NullXmlEncryp
5660
static Microsoft.AspNetCore.DataProtection.DataProtectionUtilityExtensions.GetApplicationUniqueIdentifier(this System.IServiceProvider! services) -> string?
5761
static Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.DefaultKeyStorageDirectory.get -> System.IO.DirectoryInfo?
5862
static Microsoft.AspNetCore.DataProtection.Repositories.RegistryXmlRepository.DefaultRegistryKey.get -> Microsoft.Win32.RegistryKey?
59-
virtual Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver.ResolveCertificate(string! thumbprint) -> System.Security.Cryptography.X509Certificates.X509Certificate2?
63+
virtual Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver.ResolveCertificate(string! thumbprint) -> System.Security.Cryptography.X509Certificates.X509Certificate2?

src/Hosting/TestHost/src/TestWebSocket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public override async Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byt
118118
ThrowIfInputClosed();
119119
ValidateSegment(buffer);
120120
// TODO: InvalidOperationException if any receives are currently in progress.
121-
121+
122122
Message? receiveMessage = _receiveMessage;
123123
_receiveMessage = null;
124124
if (receiveMessage == null)
@@ -148,7 +148,7 @@ public override async Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byt
148148
Array.Copy(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset, buffer.Array!, buffer.Offset, count);
149149
if (!endOfMessage)
150150
{
151-
receiveMessage.Buffer = new ArraySegment<byte>(receiveMessage.Buffer.Array, receiveMessage.Buffer.Offset + count, receiveMessage.Buffer.Count - count);
151+
receiveMessage.Buffer = new ArraySegment<byte>(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset + count, receiveMessage.Buffer.Count - count);
152152
_receiveMessage = receiveMessage;
153153
}
154154
endOfMessage = endOfMessage && receiveMessage.EndOfMessage;
@@ -257,7 +257,7 @@ private class ReceiverSenderBuffer
257257
private bool _disposed;
258258
private readonly SemaphoreSlim _sem;
259259
private readonly Queue<Message> _messageQueue;
260-
260+
261261
public ReceiverSenderBuffer()
262262
{
263263
_sem = new SemaphoreSlim(0);

src/Http/Headers/src/BaseHeaderParser.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public sealed override bool TryParseValue(StringSegment value, ref int index, ou
4646
return SupportsMultipleValues;
4747
}
4848

49-
T result;
50-
var length = GetParsedValueLength(value, current, out result);
49+
var length = GetParsedValueLength(value, current, out var result);
5150

5251
if (length == 0)
5352
{

src/Http/Headers/src/HttpHeaderParser.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public bool SupportsMultipleValues
3838

3939
// If a parser returns 'null', it means there was no value, but that's valid (e.g. "Accept: "). The caller
4040
// can ignore the value.
41-
T result;
42-
if (!TryParseValue(value, ref index, out result))
41+
if (!TryParseValue(value, ref index, out var result))
4342
{
4443
throw new FormatException(string.Format(CultureInfo.InvariantCulture,
4544
"The header contains invalid values at index {0}: '{1}'", index, value.Value ?? "<null>"));
@@ -75,15 +74,14 @@ protected virtual bool TryParseValues(IList<string>? values, bool strict, [NotNu
7574

7675
while (!string.IsNullOrEmpty(value) && index < value.Length)
7776
{
78-
T output;
79-
if (TryParseValue(value, ref index, out output))
77+
if (TryParseValue(value, ref index, out var output))
8078
{
8179
// The entry may not contain an actual value, like " , "
8280
if (output != null)
8381
{
8482
if (results == null)
8583
{
86-
results = new List<T>(); // Allocate it only when used
84+
results = new List<T>(); // Allocate it only when used
8785
}
8886
results.Add(output);
8987
}
@@ -133,8 +131,7 @@ protected virtual IList<T> ParseValues(IList<string>? values, bool strict)
133131

134132
while (!string.IsNullOrEmpty(value) && index < value.Length)
135133
{
136-
T output;
137-
if (TryParseValue(value, ref index, out output))
134+
if (TryParseValue(value, ref index, out var output))
138135
{
139136
// The entry may not contain an actual value, like " , "
140137
if (output != null)

src/JSInterop/Microsoft.JSInterop/src/Infrastructure/TaskGenericsUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void SetResult(object tcs, object? result)
9191
// If necessary, attempt a cast
9292
var typedResult = result is T resultT
9393
? resultT
94-
: (T)Convert.ChangeType(result, typeof(T), CultureInfo.InvariantCulture);
94+
: (T)Convert.ChangeType(result, typeof(T), CultureInfo.InvariantCulture)!;
9595

9696
typedTcs.SetResult(typedResult!);
9797
}

src/Mvc/test/Mvc.IntegrationTests/ValidationWithRecordIntegrationTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,9 @@ public async Task Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParame
22982298

22992299
private static void Validation_InifnitelyRecursiveModel_ValidationOnTopLevelParameterMethod([Required] RecursiveModel model) { }
23002300

2301+
#pragma warning disable CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23012302
private record RecordTypeWithValidatorsOnProperties(string Property1)
2303+
#pragma warning restore CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23022304
{
23032305
[Required]
23042306
public string Property1 { get; init; }
@@ -2335,7 +2337,9 @@ public async Task Validation_ValidatorsDefinedOnRecordTypeProperties()
23352337
Assert.Equal(expected, ex.Message);
23362338
}
23372339

2340+
#pragma warning disable CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23382341
private record RecordTypeWithValidatorsOnPropertiesAndParameters([Required] string Property1)
2342+
#pragma warning restore CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23392343
{
23402344
[Required]
23412345
public string Property1 { get; init; }
@@ -2372,7 +2376,9 @@ public async Task Validation_ValidatorsDefinedOnRecordTypePropertiesAndParameter
23722376
Assert.Equal(expected, ex.Message);
23732377
}
23742378

2379+
#pragma warning disable CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23752380
private record RecordTypeWithValidatorsOnMixOfPropertiesAndParameters([Required] string Property1, string Property2)
2381+
#pragma warning restore CS8907 // Parameter is unread. Did you forget to use it to initialize the property with that name?
23762382
{
23772383
[Required]
23782384
public string Property2 { get; init; }

0 commit comments

Comments
 (0)