Skip to content

Commit

Permalink
Get rid of cfg(skip) (#5076)
Browse files Browse the repository at this point in the history
It was a hack and it breaks rustc-check-cfg, let's not do that anymore.

This is based on #5075 so that
I can test this works with beta/nightly
  • Loading branch information
Manishearth authored Jun 18, 2024
1 parent 80b8174 commit b935818
Show file tree
Hide file tree
Showing 30 changed files with 103 additions and 121 deletions.
3 changes: 1 addition & 2 deletions components/calendar/src/any_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,8 @@ impl AnyCalendar {

icu_provider::gen_any_buffer_data_constructors!(
(locale) -> error: DataError,
#[cfg(skip)]
functions: [
new_for_locale,
new_for_locale: skip,
try_new_for_locale_with_any_provider,
try_new_for_locale_with_buffer_provider,
try_new_for_locale_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/calendar/src/chinese.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ impl Chinese {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/calendar/src/dangi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ impl Dangi {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
6 changes: 2 additions & 4 deletions components/calendar/src/islamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ impl IslamicObservational {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down Expand Up @@ -175,9 +174,8 @@ impl IslamicUmmAlQura {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
6 changes: 2 additions & 4 deletions components/calendar/src/japanese.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ impl Japanese {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down Expand Up @@ -188,9 +187,8 @@ impl JapaneseExtended {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/casemap/src/casemapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ impl CaseMapper {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
6 changes: 2 additions & 4 deletions components/casemap/src/closer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ impl CaseMapCloser<CaseMapper> {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand All @@ -111,9 +110,8 @@ impl CaseMapCloser<CaseMapper> {
// We use Borrow, not AsRef, since we want the blanket impl on T
impl<CM: AsRef<CaseMapper>> CaseMapCloser<CM> {
icu_provider::gen_any_buffer_data_constructors!((casemapper: CM) -> error: DataError,
#[cfg(skip)]
functions: [
new_with_mapper,
new_with_mapper: skip,
try_new_with_mapper_with_any_provider,
try_new_with_mapper_with_buffer_provider,
try_new_with_mapper_unstable,
Expand Down
6 changes: 2 additions & 4 deletions components/casemap/src/titlecase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ impl TitlecaseMapper<CaseMapper> {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand All @@ -249,9 +248,8 @@ impl TitlecaseMapper<CaseMapper> {
// We use Borrow, not AsRef, since we want the blanket impl on T
impl<CM: AsRef<CaseMapper>> TitlecaseMapper<CM> {
icu_provider::gen_any_buffer_data_constructors!((casemapper: CM) -> error: DataError,
#[cfg(skip)]
functions: [
new_with_mapper,
new_with_mapper: skip,
try_new_with_mapper_with_any_provider,
try_new_with_mapper_with_buffer_provider,
try_new_with_mapper_unstable,
Expand Down
8 changes: 7 additions & 1 deletion components/collator/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ impl Collator {

icu_provider::gen_any_buffer_data_constructors!(
(locale, options: CollatorOptions) -> error: DataError,
#[cfg(skip)]
functions: [
try_new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Self
]
);

#[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new)]
Expand Down
9 changes: 3 additions & 6 deletions components/datetime/src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ impl TimeFormatter {

icu_provider::gen_any_buffer_data_constructors!(
(locale, length: length::Time) -> error: DateTimeError,
#[cfg(skip)]
functions: [
try_new_with_length,
try_new_with_length: skip,
try_new_with_length_with_any_provider,
try_new_with_length_with_buffer_provider,
try_new_with_length_unstable,
Expand Down Expand Up @@ -310,9 +309,8 @@ impl<C: CldrCalendar> TypedDateFormatter<C> {

icu_provider::gen_any_buffer_data_constructors!(
(locale, length: length::Date) -> error: DateTimeError,
#[cfg(skip)]
functions: [
try_new_with_length,
try_new_with_length: skip,
try_new_with_length_with_any_provider,
try_new_with_length_with_buffer_provider,
try_new_with_length_unstable,
Expand Down Expand Up @@ -562,9 +560,8 @@ where {

icu_provider::gen_any_buffer_data_constructors!(
(locale, options: DateTimeFormatterOptions) -> error: DateTimeError,
#[cfg(skip)]
functions: [
try_new,
try_new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
8 changes: 7 additions & 1 deletion components/datetime/src/zoned_datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ impl<C: CldrCalendar> TypedZonedDateTimeFormatter<C> {
icu_provider::gen_any_buffer_data_constructors!(

(locale, date_time_format_options: DateTimeFormatterOptions, time_zone_format_options: TimeZoneFormatterOptions) -> error: DateTimeError,
#[cfg(skip)]
functions: [
try_new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Self
]
);

#[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::try_new)]
Expand Down
6 changes: 2 additions & 4 deletions components/experimental/src/compactdecimal/compactdecimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ impl CompactDecimalFormatter {

icu_provider::gen_any_buffer_data_constructors!(
(locale, options: CompactDecimalFormatterOptions) -> error: DataError,
#[cfg(skip)]
functions: [
try_new_short,
try_new_short: skip,
try_new_short_with_any_provider,
try_new_short_with_buffer_provider,
try_new_short_unstable,
Expand Down Expand Up @@ -228,9 +227,8 @@ impl CompactDecimalFormatter {

icu_provider::gen_any_buffer_data_constructors!(
(locale, options: CompactDecimalFormatterOptions) -> error: DataError,
#[cfg(skip)]
functions: [
try_new_long,
try_new_long: skip,
try_new_long_with_any_provider,
try_new_long_with_buffer_provider,
try_new_long_unstable,
Expand Down
8 changes: 7 additions & 1 deletion components/experimental/src/dimension/currency/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ pub struct CurrencyCode(pub TinyAsciiStr<3>);
impl CurrencyFormatter {
icu_provider::gen_any_buffer_data_constructors!(
(locale, options: super::options::CurrencyFormatterOptions) -> error: DataError,
#[cfg(skip)]
functions: [
try_new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Self
]
);

/// Creates a new [`CurrencyFormatter`] from compiled locale data and an options bag.
Expand Down
3 changes: 1 addition & 2 deletions components/experimental/src/relativetime/relativetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ macro_rules! constructor {

icu_provider::gen_any_buffer_data_constructors!(
(locale, options: RelativeTimeFormatterOptions) -> error: DataError,
#[cfg(skip)]
functions: [
$baked,
$baked: skip,
$any,
$buffer,
$unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/experimental/src/units/converter_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ impl From<Sign> for num_bigint::Sign {
impl ConverterFactory {
icu_provider::gen_any_buffer_data_constructors!(
() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/locale/src/expander.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,8 @@ impl LocaleExpander {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new_extended,
new_extended: skip,
try_new_extended_with_any_provider,
try_new_extended_with_buffer_provider,
try_new_extended_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/locale/src/fallback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ impl LocaleFallbacker {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
12 changes: 4 additions & 8 deletions components/normalizer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,9 +1604,8 @@ impl DecomposingNormalizer {

icu_provider::gen_any_buffer_data_constructors!(
() -> error: DataError,
#[cfg(skip)]
functions: [
new_nfd,
new_nfd: skip,
try_new_nfd_with_any_provider,
try_new_nfd_with_buffer_provider,
try_new_nfd_unstable,
Expand Down Expand Up @@ -1719,9 +1718,8 @@ impl DecomposingNormalizer {

icu_provider::gen_any_buffer_data_constructors!(
() -> error: DataError,
#[cfg(skip)]
functions: [
new_nfkd,
new_nfkd: skip,
try_new_nfkd_with_any_provider,
try_new_nfkd_with_buffer_provider,
try_new_nfkd_unstable,
Expand Down Expand Up @@ -2221,9 +2219,8 @@ impl ComposingNormalizer {

icu_provider::gen_any_buffer_data_constructors!(
() -> error: DataError,
#[cfg(skip)]
functions: [
new_nfc,
new_nfc: skip,
try_new_nfc_with_any_provider,
try_new_nfc_with_buffer_provider,
try_new_nfc_unstable,
Expand Down Expand Up @@ -2267,9 +2264,8 @@ impl ComposingNormalizer {

icu_provider::gen_any_buffer_data_constructors!(
() -> error: DataError,
#[cfg(skip)]
functions: [
new_nfkc,
new_nfkc: skip,
try_new_nfkc_with_any_provider,
try_new_nfkc_with_buffer_provider,
try_new_nfkc_unstable,
Expand Down
9 changes: 3 additions & 6 deletions components/normalizer/src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ impl CanonicalComposition {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down Expand Up @@ -390,9 +389,8 @@ impl CanonicalDecomposition {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down Expand Up @@ -498,9 +496,8 @@ impl CanonicalCombiningClassMap {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/properties/src/bidi_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ pub const fn bidi_auxiliary_properties() -> BidiAuxiliaryPropertiesBorrowed<'sta

icu_provider::gen_any_buffer_data_constructors!(
() -> result: Result<BidiAuxiliaryProperties, DataError>,
#[cfg(skip)]
functions: [
bidi_auxiliary_properties,
bidi_auxiliary_properties: skip,
load_bidi_auxiliary_properties_with_any_provider,
load_bidi_auxiliary_properties_with_buffer_provider,
load_bidi_auxiliary_properties_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/properties/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,8 @@ pub const fn script_with_extensions() -> ScriptWithExtensionsBorrowed<'static> {

icu_provider::gen_any_buffer_data_constructors!(
() -> result: Result<ScriptWithExtensions, DataError>,
#[cfg(skip)]
functions: [
script_with_extensions,
script_with_extensions: skip,
load_script_with_extensions_with_any_provider,
load_script_with_extensions_with_buffer_provider,
load_script_with_extensions_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/properties/src/sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2110,9 +2110,8 @@ pub fn load_for_ecma262(

icu_provider::gen_any_buffer_data_constructors!(
(name: &str) -> result: Result<CodePointSetData, UnexpectedPropertyNameOrDataError>,
#[cfg(skip)]
functions: [
load_for_ecma262,
load_for_ecma262: skip,
load_for_ecma262_with_any_provider,
load_for_ecma262_with_buffer_provider,
load_for_ecma262_unstable,
Expand Down
3 changes: 1 addition & 2 deletions components/segmenter/src/grapheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ impl GraphemeClusterSegmenter {
}

icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError,
#[cfg(skip)]
functions: [
new,
new: skip,
try_new_with_any_provider,
try_new_with_buffer_provider,
try_new_unstable,
Expand Down
Loading

0 comments on commit b935818

Please sign in to comment.