Fix trait type parameter

This commit is contained in:
oxalica 2021-03-16 00:58:29 +08:00
parent 87171238c6
commit 7101bada0f
No known key found for this signature in database
GPG Key ID: CED392DE0C483D00

View File

@ -233,7 +233,13 @@ fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
fn write_generic_params(def: GenericDefId, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
let params = f.db.generic_params(def);
if params.lifetimes.is_empty() && params.types.is_empty() && params.consts.is_empty() {
if params.lifetimes.is_empty()
&& params.consts.is_empty()
&& params
.types
.iter()
.all(|(_, param)| !matches!(param.provenance, TypeParamProvenance::TypeParamList))
{
return Ok(());
}
write!(f, "<")?;