Open
Description
Example code:
pub fn try_new_with_date_length_unstable<P>(
provider: &P,
locale: &DataLocale,
length: length::Date,
) -> Result<Self, Error>
where
P: // Explanatory comment about the bounds
?Sized
+ DataProvider<BuddhistDatePatternV1Marker>
+ DataProvider<BuddhistYearNamesV1Marker>
+ DataProvider<BuddhistMonthNamesV1Marker>
{ ... }
Running this through rustfmt deletes the // Explanatory comment about the bounds
.
Workaround: move the ?Sized
into the first position. If your bound is not ?Sized
, you can use Sized
. The comment is retained:
pub fn try_new_with_date_length_unstable<P>(
provider: &P,
locale: &DataLocale,
length: length::Date,
) -> Result<Self, Error>
where
P: ?Sized
// Explanatory comment about the bounds
+ DataProvider<BuddhistDatePatternV1Marker>
+ DataProvider<BuddhistYearNamesV1Marker>
+ DataProvider<BuddhistMonthNamesV1Marker>
{ ... }
Possibly related to #3669, #4666, #5059 but the examples are in different contexts so I thought I would file a new issue with this test case.
CC @Manishearth