Skip to content

Commit

Permalink
[release/6.0] Apply custom Message and Url to all [RequiresPreviewFea…
Browse files Browse the repository at this point in the history
…tures] attributes (#60456)

* Apply custom messages and urls to all generic math [RequiresPreviewFeatures] attributes

* Update AvxVnni message and remove the url

Co-authored-by: Buyaa Namnan <[email protected]>
  • Loading branch information
jeffhandley and buyaa-n authored Oct 15, 2021
1 parent f94d65e commit 7301468
Show file tree
Hide file tree
Showing 49 changed files with 2,223 additions and 2,222 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<!-- Code analysis dependencies -->
<MicrosoftCodeAnalysisCSharpCodeStyleVersion>3.10.0</MicrosoftCodeAnalysisCSharpCodeStyleVersion>
<MicrosoftCodeAnalysisCSharpVersion>3.10.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-rc1.21413.4</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>6.0.0-rtm.21514.4</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- SDK dependencies -->
<MicrosoftDotNetCompatibilityVersion>1.0.0-rc.2.21511.46</MicrosoftDotNetCompatibilityVersion>
<!-- Arcade dependencies -->
Expand Down
124 changes: 62 additions & 62 deletions src/libraries/System.Private.CoreLib/src/System/Byte.cs

Large diffs are not rendered by default.

124 changes: 62 additions & 62 deletions src/libraries/System.Private.CoreLib/src/System/Char.cs

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/libraries/System.Private.CoreLib/src/System/DateOnly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,65 +836,65 @@ public string ToString(string? format, IFormatProvider? provider)
// IComparisonOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateOnly, DateOnly>.operator <(DateOnly left, DateOnly right)
=> left < right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateOnly, DateOnly>.operator <=(DateOnly left, DateOnly right)
=> left <= right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateOnly, DateOnly>.operator >(DateOnly left, DateOnly right)
=> left > right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateOnly, DateOnly>.operator >=(DateOnly left, DateOnly right)
=> left >= right;

//
// IEqualityOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateOnly, DateOnly>.operator ==(DateOnly left, DateOnly right)
=> left == right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateOnly, DateOnly>.operator !=(DateOnly left, DateOnly right)
=> left != right;

//
// IMinMaxValue
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateOnly IMinMaxValue<DateOnly>.MinValue => MinValue;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateOnly IMinMaxValue<DateOnly>.MaxValue => MaxValue;

//
// IParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateOnly IParseable<DateOnly>.Parse(string s, IFormatProvider? provider)
=> Parse(s, provider, DateTimeStyles.None);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IParseable<DateOnly>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out DateOnly result)
=> TryParse(s, provider, DateTimeStyles.None, out result);

//
// ISpanParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateOnly ISpanParseable<DateOnly>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, provider, DateTimeStyles.None);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool ISpanParseable<DateOnly>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DateOnly result)
=> TryParse(s, provider, DateTimeStyles.None, out result);
#endif // FEATURE_GENERIC_MATH
Expand Down
38 changes: 19 additions & 19 deletions src/libraries/System.Private.CoreLib/src/System/DateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,105 +1521,105 @@ internal static bool TryCreate(int year, int month, int day, int hour, int minut
// IAdditionOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime IAdditionOperators<DateTime, TimeSpan, DateTime>.operator +(DateTime left, TimeSpan right)
=> left + right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked DateTime IAdditionOperators<DateTime, TimeSpan, DateTime>.operator +(DateTime left, TimeSpan right)
// => checked(left + right);

//
// IAdditiveIdentity
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static TimeSpan IAdditiveIdentity<DateTime, TimeSpan>.AdditiveIdentity
=> default;

//
// IComparisonOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTime, DateTime>.operator <(DateTime left, DateTime right)
=> left < right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTime, DateTime>.operator <=(DateTime left, DateTime right)
=> left <= right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTime, DateTime>.operator >(DateTime left, DateTime right)
=> left > right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTime, DateTime>.operator >=(DateTime left, DateTime right)
=> left >= right;

//
// IEqualityOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateTime, DateTime>.operator ==(DateTime left, DateTime right)
=> left == right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateTime, DateTime>.operator !=(DateTime left, DateTime right)
=> left != right;

//
// IMinMaxValue
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime IMinMaxValue<DateTime>.MinValue => MinValue;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime IMinMaxValue<DateTime>.MaxValue => MaxValue;

//
// IParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime IParseable<DateTime>.Parse(string s, IFormatProvider? provider)
=> Parse(s, provider);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IParseable<DateTime>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out DateTime result)
=> TryParse(s, provider, DateTimeStyles.None, out result);

//
// ISpanParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime ISpanParseable<DateTime>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, provider, DateTimeStyles.None);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool ISpanParseable<DateTime>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DateTime result)
=> TryParse(s, provider, DateTimeStyles.None, out result);

//
// ISubtractionOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTime ISubtractionOperators<DateTime, TimeSpan, DateTime>.operator -(DateTime left, TimeSpan right)
=> left - right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked DateTime ISubtractionOperators<DateTime, TimeSpan, DateTime>.operator -(DateTime left, TimeSpan right)
// => checked(left - right);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static TimeSpan ISubtractionOperators<DateTime, DateTime, TimeSpan>.operator -(DateTime left, DateTime right)
=> left - right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked TimeSpan ISubtractionOperators<DateTime, DateTime, TimeSpan>.operator -(DateTime left, DateTime right)
// => checked(left - right);
#endif // FEATURE_GENERIC_MATH
Expand Down
38 changes: 19 additions & 19 deletions src/libraries/System.Private.CoreLib/src/System/DateTimeOffset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,104 +870,104 @@ public static implicit operator DateTimeOffset(DateTime dateTime) =>
// IAdditionOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset IAdditionOperators<DateTimeOffset, TimeSpan, DateTimeOffset>.operator +(DateTimeOffset left, TimeSpan right)
=> left + right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked DateTimeOffset IAdditionOperators<DateTimeOffset, TimeSpan, DateTimeOffset>.operator +(DateTimeOffset left, TimeSpan right)
// => checked(left + right);

//
// IAdditiveIdentity
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static TimeSpan IAdditiveIdentity<DateTimeOffset, TimeSpan>.AdditiveIdentity => default;

//
// IComparisonOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTimeOffset, DateTimeOffset>.operator <(DateTimeOffset left, DateTimeOffset right)
=> left < right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTimeOffset, DateTimeOffset>.operator <=(DateTimeOffset left, DateTimeOffset right)
=> left <= right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTimeOffset, DateTimeOffset>.operator >(DateTimeOffset left, DateTimeOffset right)
=> left > right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IComparisonOperators<DateTimeOffset, DateTimeOffset>.operator >=(DateTimeOffset left, DateTimeOffset right)
=> left >= right;

//
// IEqualityOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateTimeOffset, DateTimeOffset>.operator ==(DateTimeOffset left, DateTimeOffset right)
=> left == right;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IEqualityOperators<DateTimeOffset, DateTimeOffset>.operator !=(DateTimeOffset left, DateTimeOffset right)
=> left != right;

//
// IMinMaxValue
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset IMinMaxValue<DateTimeOffset>.MinValue => MinValue;

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset IMinMaxValue<DateTimeOffset>.MaxValue => MaxValue;

//
// IParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset IParseable<DateTimeOffset>.Parse(string s, IFormatProvider? provider)
=> Parse(s, provider);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool IParseable<DateTimeOffset>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out DateTimeOffset result)
=> TryParse(s, provider, DateTimeStyles.None, out result);

//
// ISpanParseable
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset ISpanParseable<DateTimeOffset>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
=> Parse(s, provider, DateTimeStyles.None);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static bool ISpanParseable<DateTimeOffset>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DateTimeOffset result)
=> TryParse(s, provider, DateTimeStyles.None, out result);

//
// ISubtractionOperators
//

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static DateTimeOffset ISubtractionOperators<DateTimeOffset, TimeSpan, DateTimeOffset>.operator -(DateTimeOffset left, TimeSpan right)
=> left - right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked DateTimeOffset ISubtractionOperators<DateTimeOffset, TimeSpan, DateTimeOffset>.operator -(DateTimeOffset left, TimeSpan right)
// => checked(left - right);

[RequiresPreviewFeatures]
[RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
static TimeSpan ISubtractionOperators<DateTimeOffset, DateTimeOffset, TimeSpan>.operator -(DateTimeOffset left, DateTimeOffset right)
=> left - right;

// [RequiresPreviewFeatures]
// [RequiresPreviewFeatures(Number.PreviewFeatureMessage, Url = Number.PreviewFeatureUrl)]
// static checked TimeSpan ISubtractionOperators<DateTimeOffset, DateTimeOffset, TimeSpan>.operator -(DateTimeOffset left, DateTimeOffset right)
// => checked(left - right);
#endif // FEATURE_GENERIC_MATH
Expand Down
Loading

0 comments on commit 7301468

Please sign in to comment.