1
Fork 0

Rollup merge of #132540 - compiler-errors:gc, r=calebcartwright

Do not format generic consts

We introduced **nightly support** for generic const items in #113522, but formatting of consts was not modified. Making them format *correctly* is hard, so let's just bail formatting them so we don't accidentally strip their generics and where clauses. This is essentially no-op formatting for generic const items.

r? `````@calebcartwright````` or `````@ytmimi`````
This commit is contained in:
Matthias Krüger 2024-11-03 12:08:55 +01:00 committed by GitHub
commit 13cdfae599
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 6 deletions

View file

@ -414,6 +414,12 @@ pub struct WhereClause {
pub span: Span,
}
impl WhereClause {
pub fn is_empty(&self) -> bool {
!self.has_where_token && self.predicates.is_empty()
}
}
impl Default for WhereClause {
fn default() -> WhereClause {
WhereClause { has_where_token: false, predicates: ThinVec::new(), span: DUMMY_SP }