Skip to content

Commit 5ed0cee

Browse files
committed
Remove workarounds for MethodImplOptions.Async
1 parent dfeb272 commit 5ed0cee

18 files changed

+15
-35
lines changed

src/tests/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<PropertyGroup>
1212
<!-- Override the compiler version with a private build that supports async2 -->
13-
<MicrosoftNetCompilersToolsetVersion>5.0.0-1.25258.11</MicrosoftNetCompilersToolsetVersion>
13+
<MicrosoftNetCompilersToolsetVersion>5.0.0-1.25259.6</MicrosoftNetCompilersToolsetVersion>
1414
</PropertyGroup>
1515

1616
<PropertyGroup>

src/tests/async/awaitingnotasync.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ private static async ValueTask<T> GetValueTask<T>(T arg)
3434

3535
private static T sIdentity<T>(T arg) => arg;
3636

37-
[MethodImpl(MethodImplOptions.Async)]
3837
private static async Task AsyncEntryPoint()
3938
{
4039
// static field

src/tests/async/cse-array-index-byref.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ private static async Task AsyncTestEntryPoint(int[] arr, int index)
2222
await HoistedByref(arr, index);
2323
}
2424

25-
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)]
25+
[MethodImpl(MethodImplOptions.NoInlining)]
2626
private static async Task<int> HoistedByref(int[] arr, int index)
2727
{
2828
for (int i = 0; i < 20000; i++)

src/tests/async/fibonacci-with-yields.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static void Test()
2323
System.Console.WriteLine("allocated: " + allocated);
2424
}
2525

26-
[MethodImpl(MethodImplOptions.Async)]
2726
public static async Task AsyncEntry()
2827
{
2928
for (int i = 0; i < iterations; i++)
@@ -36,7 +35,6 @@ public static async Task AsyncEntry()
3635
}
3736
}
3837

39-
[MethodImpl(MethodImplOptions.Async)]
4038
static async Task<int> Fib(int i)
4139
{
4240
if (i <= 1)

src/tests/async/fibonacci-with-yields_struct_return.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public struct MyInt
3535
public MyInt(int i) => this.i = i;
3636
}
3737

38-
[MethodImpl(MethodImplOptions.Async)]
3938
public static async Task AsyncEntry()
4039
{
4140
for (int i = 0; i < iterations; i++)
@@ -48,7 +47,6 @@ public static async Task AsyncEntry()
4847
}
4948
}
5049

51-
[MethodImpl(MethodImplOptions.Async)]
5250
static async Task<MyInt> Fib(MyInt n)
5351
{
5452
int i = n.i;

src/tests/async/fibonacci-without-yields-config-await.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public static void Test()
2626
System.Console.WriteLine("allocated: " + allocated);
2727
}
2828

29-
[MethodImpl(MethodImplOptions.Async)]
3029
public static async Task AsyncEntry()
3130
{
3231
for (int i = 0; i < iterations; i++)
@@ -39,7 +38,6 @@ public static async Task AsyncEntry()
3938
}
4039
}
4140

42-
[MethodImpl(MethodImplOptions.Async)]
4341
static async Task<int> Fib(int i)
4442
{
4543
if (i <= 1)

src/tests/async/fibonacci-without-yields.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public static void Test()
2323
System.Console.WriteLine("allocated: " + allocated);
2424
}
2525

26-
[MethodImpl(MethodImplOptions.Async)]
2726
public static async Task AsyncEntry()
2827
{
2928
for (int i = 0; i < iterations; i++)
@@ -36,7 +35,6 @@ public static async Task AsyncEntry()
3635
}
3736
}
3837

39-
[MethodImpl(MethodImplOptions.Async)]
4038
static async Task<int> Fib(int i)
4139
{
4240
if (i <= 1)

src/tests/async/object.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private static async Task<object> AsyncTestEntryPoint(int arg)
2020
return await ObjMethod(arg);
2121
}
2222

23-
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)]
23+
[MethodImpl(MethodImplOptions.NoInlining)]
2424
private static async Task<object> ObjMethod(int arg)
2525
{
2626
await Task.Yield();

src/tests/async/objects-captured.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
public class Async2ObjectsWithYields
1111
{
12-
[MethodImpl(MethodImplOptions.Async)]
1312
internal static async Task<int> A(object n)
1413
{
1514
// use string equality so that JIT would not think of hoisting "(int)n"

src/tests/async/override.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class Async2Override
1010
{
1111
class Base
1212
{
13-
[MethodImpl(MethodImplOptions.Async)]
1413
public virtual async Task<int> M1()
1514
{
1615
await Task.Yield();
@@ -30,7 +29,6 @@ public override async Task<int> M1()
3029

3130
class Derived2 : Derived1
3231
{
33-
[MethodImpl(MethodImplOptions.Async)]
3432
public override async Task<int> M1()
3533
{
3634
await Task.Yield();
@@ -51,7 +49,6 @@ public virtual async Task<int> M1()
5149

5250
class Derived11 : Base1
5351
{
54-
[MethodImpl(MethodImplOptions.Async)]
5552
public override async Task<int> M1()
5653
{
5754
await Task.Yield();

0 commit comments

Comments
 (0)