Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies from dotnet/roslyn #110105

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8cf386f
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 22, 2024
ae6fee2
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 23, 2024
2a13a6f
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 24, 2024
ba99bdf
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 26, 2024
96ae4f3
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 27, 2024
f6364ee
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 28, 2024
089fcd0
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 29, 2024
535c884
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 30, 2024
2e73b10
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Dec 1, 2024
68215e4
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Dec 2, 2024
edd325f
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Dec 3, 2024
d84efa9
Use explicit AsSpan
am11 Dec 3, 2024
fe444d6
Merge branch 'main' into darc-main-19369168-1f4a-490d-90eb-b9e754971a1a
am11 Dec 4, 2024
0b69315
Fix LibraryImportGenerator.UnitTests
am11 Dec 4, 2024
2879dab
Fix regex tests
am11 Dec 4, 2024
a2a1b52
Adjust trimming test for new codegen
sbomer Dec 9, 2024
263d5eb
Merge branch 'main' into darc-main-19369168-1f4a-490d-90eb-b9e754971a1a
am11 Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,17 @@
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>4daef9f8f673c1d0bbec273f2bcda1ab9074ef75</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-2.24570.4">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-3.24602.26">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>94fff7ad4f11977f903f435b0d97dcf0f2183710</Sha>
<Sha>089e61c59dcb3d46fe766abc85176ef8e42e4d58</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.13.0-2.24570.4">
<Dependency Name="Microsoft.CodeAnalysis" Version="4.13.0-3.24602.26">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>94fff7ad4f11977f903f435b0d97dcf0f2183710</Sha>
<Sha>089e61c59dcb3d46fe766abc85176ef8e42e4d58</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-2.24570.4">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-3.24602.26">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>94fff7ad4f11977f903f435b0d97dcf0f2183710</Sha>
<Sha>089e61c59dcb3d46fe766abc85176ef8e42e4d58</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.12.0-beta1.24559.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
Expand All @@ -397,9 +397,9 @@
<Sha>5435ba7b1037f21237adc1b3845f97e9fdbc075d</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-2.24570.4">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-3.24602.26">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>94fff7ad4f11977f903f435b0d97dcf0f2183710</Sha>
<Sha>089e61c59dcb3d46fe766abc85176ef8e42e4d58</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="10.0.100-alpha.1.24480.5">
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure
they do not break the local dev experience.
-->
<MicrosoftCodeAnalysisCSharpVersion>4.13.0-2.24570.4</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.13.0-2.24570.4</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.13.0-2.24570.4</MicrosoftNetCompilersToolsetVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.13.0-3.24602.26</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.13.0-3.24602.26</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.13.0-3.24602.26</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>
<!--
For source generator support we need to target multiple versions of Roslyn in order to be able to run on older versions of Roslyn.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ReachabilityInstrumentationFilter(string profileDataFileName, ILProvider
int numTokens = reader.ReadInt32();

bool[] tokenStates = new bool[numTokens];
if (reader.Read(MemoryMarshal.Cast<bool, byte>(tokenStates)) != numTokens)
if (reader.Read(MemoryMarshal.Cast<bool, byte>(tokenStates.AsSpan())) != numTokens)
throw new IOException("Unexpected end of file");

_reachabilityInfo.Add(new Guid(guidBytes), tokenStates);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr
}

Assert.Equal(writerBytes.Length, n);
AssertExtensions.SequenceEqual(writerBytes, readerBytes.AsSpan(0, writerBytes.Length));
AssertExtensions.SequenceEqual(writerBytes.AsSpan(), readerBytes.AsSpan(0, writerBytes.Length));

await writes;
}
Expand Down Expand Up @@ -3069,7 +3069,7 @@ public virtual async Task ZeroByteRead_PerformsZeroByteReadOnUnderlyingStreamWhe

if (FlushGuaranteesAllDataWritten)
{
AssertExtensions.SequenceEqual(data, buffer.AsSpan(0, bytesRead));
AssertExtensions.SequenceEqual(data.AsSpan(), buffer.AsSpan(0, bytesRead));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ internal static IReadOnlyList<T> DecodePrimitiveTypes(BinaryReader reader, int c
{
if (typeof(T) == typeof(short) || typeof(T) == typeof(ushort))
{
Span<short> span = MemoryMarshal.Cast<T, short>(result);
Span<short> span = MemoryMarshal.Cast<T, short>(result.AsSpan());
#if NET
BinaryPrimitives.ReverseEndianness(span, span);
#else
Expand All @@ -173,7 +173,7 @@ internal static IReadOnlyList<T> DecodePrimitiveTypes(BinaryReader reader, int c
}
else if (typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(float))
{
Span<int> span = MemoryMarshal.Cast<T, int>(result);
Span<int> span = MemoryMarshal.Cast<T, int>(result.AsSpan());
#if NET
BinaryPrimitives.ReverseEndianness(span, span);
#else
Expand All @@ -185,7 +185,7 @@ internal static IReadOnlyList<T> DecodePrimitiveTypes(BinaryReader reader, int c
}
else if (typeof(T) == typeof(long) || typeof(T) == typeof(ulong) || typeof(T) == typeof(double))
{
Span<long> span = MemoryMarshal.Cast<T, long>(result);
Span<long> span = MemoryMarshal.Cast<T, long>(result.AsSpan());
#if NET
BinaryPrimitives.ReverseEndianness(span, span);
#else
Expand All @@ -201,7 +201,7 @@ internal static IReadOnlyList<T> DecodePrimitiveTypes(BinaryReader reader, int c
{
// See DontCastBytesToBooleans test to see what could go wrong.
bool[] booleans = (bool[])(object)result;
Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result);
Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result.AsSpan());
for (int i = 0; i < booleans.Length; i++)
{
// We don't use the bool array to get the value, as an optimizing compiler or JIT could elide this.
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Linq/tests/RangeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static void Validate(IEnumerable<int> e, int[] expected)
list.CopyTo(actual, 1);
Assert.Equal(0, actual[0]);
Assert.Equal(0, actual[^1]);
AssertExtensions.SequenceEqual(expected, actual.AsSpan(1, expected.Length));
AssertExtensions.SequenceEqual(expected.AsSpan(), actual.AsSpan(1, expected.Length));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Linq/tests/RepeatTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static void Validate(IEnumerable<int> e, int[] expected)
list.CopyTo(actual, 1);
Assert.Equal(0, actual[0]);
Assert.Equal(0, actual[^1]);
AssertExtensions.SequenceEqual(expected, actual.AsSpan(1, expected.Length));
AssertExtensions.SequenceEqual(expected.AsSpan(), actual.AsSpan(1, expected.Length));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public static void Base64_AllMethodsRoundtripConsistently()
Span<byte> decodedBytes = new byte[original.Length];
int decoded = Base64Url.DecodeFromChars(encodedArray, decodedBytes);
Assert.Equal(original.Length, decoded);
AssertExtensions.SequenceEqual(original, decodedBytes);
AssertExtensions.SequenceEqual(original.AsSpan(), decodedBytes);

byte[] actualBytes = new byte[original.Length];
Assert.True(Base64Url.TryDecodeFromChars(encodedSpan, actualBytes, out int bytesWritten));
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Memory/tests/Span/SearchValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ static SearchValuesTestHelper()
s_randomLatin1Chars[i] = (char)rng.Next(0, 256);
}

rng.NextBytes(MemoryMarshal.Cast<char, byte>(s_randomChars));
rng.NextBytes(MemoryMarshal.Cast<char, byte>(s_randomChars.AsSpan()));

s_randomAsciiBytes = Encoding.ASCII.GetBytes(s_randomAsciiChars);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ public StringSearchValuesTestHelper(IndexOfAnySearchDelegate expected, SearchVal
}));
}

rng.NextBytes(MemoryMarshal.Cast<char, byte>(_randomChars));
rng.NextBytes(MemoryMarshal.Cast<char, byte>(_randomChars.AsSpan()));
}

public void StressRandomInputs(TimeSpan duration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ public void AcceptAsync_WithReceiveBuffer_Success()

Assert.Equal(acceptBufferDataSize, acceptArgs.BytesTransferred);

AssertExtensions.SequenceEqual(sendBuffer, acceptArgs.Buffer.AsSpan(0, acceptArgs.BytesTransferred));
AssertExtensions.SequenceEqual(sendBuffer.AsSpan(), acceptArgs.Buffer.AsSpan(0, acceptArgs.BytesTransferred));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void FromManaged(ManagedType m) {}
public nint ToUnmanaged() => default;
public void Free() {}
public Span<T> GetUnmanagedValuesDestination() => default;

public ReadOnlySpan<nint> GetManagedValuesSource()
{
throw new NotImplementedException();
Expand Down Expand Up @@ -602,7 +602,6 @@ public void FromManaged(ManagedType m, Span<byte> buffer) {}
public void Free() {}
public ReadOnlySpan<byte> GetManagedValuesSource() => default;
public Span<T> GetUnmanagedValuesDestination() => default;

public static int BufferSize
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ public void FromManaged(ManagedType m, Span<byte> b) {}
public int ToUnmanaged() => default;

public void Free() {}

public static int BufferSize
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ static class MarshallerType<T>
public static ReadOnlySpan<int> GetManagedValuesSource(ManagedType m) => default;

public static Span<T> GetUnmanagedValuesDestination(nint unmanaged, int numElements) => default;

public static int BufferSize
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ class ManagedType {}
static class MarshallerType
{
public static nint ConvertToUnmanaged(ManagedType m, Span<byte> b) => default;

public static int BufferSize
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,32 +527,32 @@ public void ListSetCount()
CollectionsMarshal.SetCount(list, 3);
Assert.Equal(3, list.Count);
Assert.Throws<ArgumentOutOfRangeException>(() => list[3]);
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list), new int[] { 1, 2, 3 });
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list), new int[] { 1, 2, 3 }.AsSpan());
Assert.True(Unsafe.AreSame(ref intRef, ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(list))));

// make sure that size increase preserves content and doesn't clear
CollectionsMarshal.SetCount(list, 5);
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list), new int[] { 1, 2, 3, 4, 5 });
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list), new int[] { 1, 2, 3, 4, 5 }.AsSpan());
Assert.True(Unsafe.AreSame(ref intRef, ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(list))));

// make sure that reallocations preserve content
int newCount = list.Capacity * 2;
CollectionsMarshal.SetCount(list, newCount);
Assert.Equal(newCount, list.Count);
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list)[..3], new int[] { 1, 2, 3 });
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(list)[..3], new int[] { 1, 2, 3 }.AsSpan());
Assert.True(!Unsafe.AreSame(ref intRef, ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(list))));

List<string> listReference = new() { "a", "b", "c", "d", "e" };
ref string stringRef = ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(listReference));
CollectionsMarshal.SetCount(listReference, 3);

// verify that reference types aren't cleared
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(listReference), new string[] { "a", "b", "c" });
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(listReference), new string[] { "a", "b", "c" }.AsSpan());
Assert.True(Unsafe.AreSame(ref stringRef, ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(listReference))));
CollectionsMarshal.SetCount(listReference, 5);

// verify that removed reference types are cleared
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(listReference), new string[] { "a", "b", "c", null, null });
AssertExtensions.SequenceEqual(CollectionsMarshal.AsSpan(listReference), new string[] { "a", "b", "c", null, null }.AsSpan());
Assert.True(Unsafe.AreSame(ref stringRef, ref MemoryMarshal.GetReference(CollectionsMarshal.AsSpan(listReference))));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public BigInteger(ReadOnlySpan<byte> value, bool isUnsigned = false, bool isBigE
// The bytes parameter is in little-endian byte order.
// We can just copy the bytes directly into the uint array.

value.Slice(0, wholeUInt32Count * 4).CopyTo(MemoryMarshal.AsBytes<uint>(val));
value.Slice(0, wholeUInt32Count * 4).CopyTo(MemoryMarshal.AsBytes<uint>(val.AsSpan()));
}

// In both of the above cases on big-endian architecture, we need to perform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public async Task IncompleteReadCantSetPositionBeyondEndOfFile(FileShare fileSha
await Task.WhenAll(reads);
// but when they are finished, the first buffer should contain valid data:
Assert.Equal(fileSize, reads.First().Result);
AssertExtensions.SequenceEqual(content, buffers.First().AsSpan(0, fileSize));
AssertExtensions.SequenceEqual(content.AsSpan(), buffers.First().AsSpan(0, fileSize));
// and other reads should return 0:
Assert.All(reads.Skip(1), read => Assert.Equal(0, read.Result));
// and the Position must be correct:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static void TestSequence(byte[] expected, string actual)
Assert.Equal(OperationStatus.Done, Convert.FromHexString(actual, tryResult, out int consumed, out int written));
Assert.Equal(fromResult.Length, written);
Assert.Equal(actual.Length, consumed);
AssertExtensions.SequenceEqual(expected, tryResult);
AssertExtensions.SequenceEqual(expected.AsSpan(), tryResult);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,9 @@ public static void Shuffle_Array_Seeded(bool emptyShuffle)
Random random = new Random(0x70636A61);
int[] items = new int[] { 1, 2, 3, 4 };
random.Shuffle(items);
AssertExtensions.SequenceEqual(stackalloc int[] { 4, 2, 1, 3 }, items);
AssertExtensions.SequenceEqual(stackalloc int[] { 4, 2, 1, 3 }, items.AsSpan());
random.Shuffle(items);
AssertExtensions.SequenceEqual(stackalloc int[] { 2, 3, 4, 1 }, items);
AssertExtensions.SequenceEqual(stackalloc int[] { 2, 3, 4, 1 }, items.AsSpan());

if (emptyShuffle)
{
Expand All @@ -724,7 +724,7 @@ public static void Shuffle_Array_Seeded(bool emptyShuffle)
}

random.Shuffle(items);
AssertExtensions.SequenceEqual(stackalloc int[] { 1, 4, 3, 2 }, items);
AssertExtensions.SequenceEqual(stackalloc int[] { 1, 4, 3, 2 }, items.AsSpan());
}

[Fact]
Expand Down Expand Up @@ -831,13 +831,13 @@ public static void GetItems_Buffer_Seeded_NonPower2()

Span<byte> buffer = stackalloc byte[7];
random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 3, 1, 3, 2, 3, 3, 3 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 3, 1, 3, 2, 3, 3, 3 }.AsSpan(), buffer);

random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 1, 2, 1, 2, 3, 1 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 1, 2, 1, 2, 3, 1 }.AsSpan(), buffer);

random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 1, 1, 3, 1, 3, 2, 2 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 1, 1, 3, 1, 3, 2, 2 }.AsSpan(), buffer);
}

[Fact]
Expand Down Expand Up @@ -880,13 +880,13 @@ public static void GetItems_Buffer_Seeded_Power2()

Span<byte> buffer = stackalloc byte[7];
random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 4, 1, 4, 2, 4, 4, 4 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 4, 1, 4, 2, 4, 4, 4 }.AsSpan(), buffer);

random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 2, 3, 1, 3, 3, 1 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 2, 3, 1, 3, 3, 1 }.AsSpan(), buffer);

random.GetItems(items, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 1, 4, 2, 4, 2, 2 }, buffer);
AssertExtensions.SequenceEqual(new byte[] { 2, 1, 4, 2, 4, 2, 2 }.AsSpan(), buffer);
}

[Theory]
Expand Down
Loading
Loading