Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,18 @@
<UsagePattern IdentityGlob="System.IO.Pipelines/7.0.0" />
<UsagePattern IdentityGlob="System.IO.Pipelines/8.0.*" />
<UsagePattern IdentityGlob="System.Security.Cryptography.Pkcs/5.0.0" />

<!-- Dependencies of Roslyn, replaced with live packages during full source build
https://github.com/dotnet/runtime/pull/112937#discussion_r2022951143 -->
<UsagePattern IdentityGlob="Microsoft.Bcl.AsyncInterfaces/9.0.0" />
<UsagePattern IdentityGlob="System.Collections.Immutable/9.0.0" />
<UsagePattern IdentityGlob="System.Composition/9.0.0" />
<UsagePattern IdentityGlob="System.Composition.AttributedModel/9.0.0" />
<UsagePattern IdentityGlob="System.Composition.Convention/9.0.0" />
<UsagePattern IdentityGlob="System.Composition.Hosting/9.0.0" />
<UsagePattern IdentityGlob="System.Composition.Runtime/9.0.0" />
<UsagePattern IdentityGlob="System.Composition.TypedParts/9.0.0" />
<UsagePattern IdentityGlob="System.IO.Pipelines/9.0.0" />
<UsagePattern IdentityGlob="System.Reflection.Metadata/9.0.0" />
</IgnorePatterns>
</UsageData>
22 changes: 11 additions & 11 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -360,30 +360,30 @@
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>91ea918f8fb26ec1d290283e5c5eeb1b003113da</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.25569.8">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.14.0-3.25570.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>dc344ef24932dcd53cdd24c15364a5996bc6a675</Sha>
<Sha>8cafac4760a78176ef0e167bea66b97b65437930</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.25569.8">
<Dependency Name="Microsoft.CodeAnalysis" Version="4.14.0-3.25570.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>dc344ef24932dcd53cdd24c15364a5996bc6a675</Sha>
<Sha>8cafac4760a78176ef0e167bea66b97b65437930</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.25569.8">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.14.0-3.25570.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>dc344ef24932dcd53cdd24c15364a5996bc6a675</Sha>
<Sha>8cafac4760a78176ef0e167bea66b97b65437930</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.25173.3">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>16865ea61910500f1022ad2b96c499e5df02c228</Sha>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.12.0-beta1.25570.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8cafac4760a78176ef0e167bea66b97b65437930</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.25173.3">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>16865ea61910500f1022ad2b96c499e5df02c228</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.25569.8">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.14.0-3.25570.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>dc344ef24932dcd53cdd24c15364a5996bc6a675</Sha>
<Sha>8cafac4760a78176ef0e167bea66b97b65437930</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.109">
Expand Down
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
</ItemGroup>
<PropertyGroup>
<!-- dotnet/roslyn-analyzers dependencies -->
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.25173.3</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.12.0-beta1.25570.7</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.25173.3</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- dotnet/roslyn dependencies -->
<!--
These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
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.12.0-3.25569.8</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.25569.8</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.25569.8</MicrosoftNetCompilersToolsetVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.14.0-3.25570.7</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.14.0-3.25570.7</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.14.0-3.25570.7</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 @@ -977,7 +977,7 @@ private IEnumerable<string> VerifyReferences (AssemblyDefinition original, Assem
.Select (name => name.Name)
.ToArray ();

if (!actual.SequenceEqual(expected))
if (!actual!.SequenceEqual(expected))
yield return $"Expected references do not match actual references:\n\tExpected: {string.Join(", ", expected)}\n\tActual: {string.Join(", ", actual)}";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,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 @@ -2985,7 +2985,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 @@ -900,7 +900,7 @@ public void DisposesInReverseOrderOfCreation()

// Assert
Assert.Equal(outer, callback.Disposed[0]);
Assert.Equal(multipleServices.Reverse(), callback.Disposed.Skip(1).Take(3).OfType<IFakeMultipleService>());
Assert.Equal(Enumerable.Reverse(multipleServices), callback.Disposed.Skip(1).Take(3).OfType<IFakeMultipleService>());
Assert.Equal(outer.SingleService, callback.Disposed[4]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,19 +453,19 @@ public void DefaultNullOrEmpty_Concat(StringValues stringValues)
{
string[] expected = new[] { "abc", "bcd", "foo" };
StringValues expectedStringValues = new StringValues(expected);
Assert.Equal(expected, StringValues.Concat(stringValues, expectedStringValues));
Assert.Equal(expected, StringValues.Concat(expectedStringValues, stringValues));
Assert.Equal(expected, StringValues.Concat((string)null, in expectedStringValues));
Assert.Equal(expected, StringValues.Concat(in expectedStringValues, (string)null));
Assert.Equal(expected, StringValues.Concat(stringValues, expectedStringValues).ToArray());
Assert.Equal(expected, StringValues.Concat(expectedStringValues, stringValues).ToArray());
Assert.Equal(expected, StringValues.Concat((string)null, in expectedStringValues).ToArray());
Assert.Equal(expected, StringValues.Concat(in expectedStringValues, (string)null).ToArray());

string[] empty = new string[0];
StringValues emptyStringValues = new StringValues(empty);
Assert.Equal(empty, StringValues.Concat(stringValues, StringValues.Empty));
Assert.Equal(empty, StringValues.Concat(StringValues.Empty, stringValues));
Assert.Equal(empty, StringValues.Concat(stringValues, new StringValues()));
Assert.Equal(empty, StringValues.Concat(new StringValues(), stringValues));
Assert.Equal(empty, StringValues.Concat((string)null, in emptyStringValues));
Assert.Equal(empty, StringValues.Concat(in emptyStringValues, (string)null));
Assert.Equal(empty, StringValues.Concat(stringValues, StringValues.Empty).ToArray());
Assert.Equal(empty, StringValues.Concat(StringValues.Empty, stringValues).ToArray());
Assert.Equal(empty, StringValues.Concat(stringValues, new StringValues()).ToArray());
Assert.Equal(empty, StringValues.Concat(new StringValues(), stringValues).ToArray());
Assert.Equal(empty, StringValues.Concat((string)null, in emptyStringValues).ToArray());
Assert.Equal(empty, StringValues.Concat(in emptyStringValues, (string)null).ToArray());
}

[Theory]
Expand All @@ -475,24 +475,24 @@ public void Concat(StringValues stringValues, string[] array)
string[] filled = new[] { "abc", "bcd", "foo" };

string[] expectedPrepended = array.Concat(filled).ToArray();
Assert.Equal(expectedPrepended, StringValues.Concat(stringValues, new StringValues(filled)));
Assert.Equal(expectedPrepended, StringValues.Concat(stringValues, new StringValues(filled)).ToArray());

string[] expectedAppended = filled.Concat(array).ToArray();
Assert.Equal(expectedAppended, StringValues.Concat(new StringValues(filled), stringValues));
Assert.Equal(expectedAppended, StringValues.Concat(new StringValues(filled), stringValues).ToArray());

StringValues values = stringValues;
foreach (string s in filled)
{
values = StringValues.Concat(in values, s);
}
Assert.Equal(expectedPrepended, values);
Assert.Equal(expectedPrepended, (string[])values);

values = stringValues;
foreach (string s in filled.Reverse())
foreach (string s in Enumerable.Reverse(filled))
{
values = StringValues.Concat(s, in values);
}
Assert.Equal(expectedAppended, values);
Assert.Equal(expectedAppended, (string[])values);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void PeekRef_Empty()
protected override IEnumerable<T> GetEnumerableOf<T>(params T[] contents)
{
ImmutableStack<T> stack = ImmutableStack<T>.Empty;
foreach (T value in contents.Reverse())
foreach (T value in Enumerable.Reverse(contents))
{
stack = stack.Push(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static void Set_CustomComparerTest()

int visited = s_dictionaryData.Length;

Assert.All(s_dictionaryData.Reverse(), element =>
Assert.All(Enumerable.Reverse(s_dictionaryData), element =>
{
string newValue = "new" + element.Value;
Assert.True(ld.Contains(element.Key));
Expand All @@ -154,7 +154,7 @@ public static void Remove_CustomComparerTest()
ObservableStringComparer comparer = new ObservableStringComparer();
ListDictionary ld = Fill(new ListDictionary(comparer), s_dictionaryData);

Assert.All(s_dictionaryData.Reverse(), element =>
Assert.All(Enumerable.Reverse(s_dictionaryData), element =>
{
int originalSize = ld.Count;
Assert.True(ld.Contains(element.Key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ public void Queue_Generic_ToArray_NonWrappedQueue(int count)
Queue<T> collection = new Queue<T>(count + 1);
AddToCollection(collection, count);
T[] elements = collection.ToArray();
elements.Reverse();
Assert.True(Enumerable.SequenceEqual(elements, collection.ToArray<T>()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void Stack_Generic_Constructor_IEnumerable(EnumerableType enumerableType,
_ = numberOfMatchingElements;
IEnumerable<T> enumerable = CreateEnumerable(enumerableType, null, enumerableLength, 0, numberOfDuplicateElements);
Stack<T> stack = new Stack<T>(enumerable);
Assert.Equal(enumerable.ToArray().Reverse(), stack.ToArray());
Assert.Equal(Enumerable.Reverse(enumerable.ToArray()), stack.ToArray());
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private static CompositionError CreateCompositionError(CompositionErrorId id, st
private static CompositionError CreateCompositionError(params string[] messages)
{
CompositionError error = null;
foreach (string message in messages.Reverse())
foreach (string message in Enumerable.Reverse(messages))
{
CompositionException exception = null;
if (error != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public void WriteFooterTest_LogicalOperationStack()
listener.Flush();

Assert.Contains("LogicalOperationStack=", listener.Output);
Assert.Contains(string.Join(", ", items.Reverse()), listener.Output);
Assert.Contains(string.Join(", ", Enumerable.Reverse(items)), listener.Output);
}
finally
{
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/Memory/CopyTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void TryCopyToArraySegmentImplicit()
Memory<int> srcMemory = src;
bool success = srcMemory.TryCopyTo(segment);
Assert.True(success);
Assert.Equal(src, segment);
Assert.Equal(src.AsSpan(), segment);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public static void GetArrayDataReference_IgnoresArrayVarianceChecks()

private sealed class RawObject
{
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value null
internal byte Data;
#pragma warning restore CS0649
}
}
}
2 changes: 1 addition & 1 deletion src/libraries/System.Memory/tests/ReadOnlySpan/CopyTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void TryCopyToArraySegmentImplicit()
ReadOnlySpan<int> srcSpan = new ReadOnlySpan<int>(src);
bool success = srcSpan.TryCopyTo(segment);
Assert.True(success);
Assert.Equal(src, segment);
Assert.Equal(src.AsSpan(), segment);
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Memory/tests/Span/CopyTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void TryCopyToArraySegmentImplicit()
Span<int> srcSpan = new Span<int>(src);
bool success = srcSpan.TryCopyTo(segment);
Assert.True(success);
Assert.Equal(src, segment);
Assert.Equal(src.AsSpan(), segment);
}

[Fact]
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 @@ -458,7 +458,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
Loading
Loading