mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Fix trait type parameter
This commit is contained in:
parent
87171238c6
commit
7101bada0f
1 changed files with 7 additions and 1 deletions
|
@ -233,7 +233,13 @@ impl HirDisplay for ConstParam {
|
||||||
|
|
||||||
fn write_generic_params(def: GenericDefId, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
fn write_generic_params(def: GenericDefId, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
||||||
let params = f.db.generic_params(def);
|
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(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
write!(f, "<")?;
|
write!(f, "<")?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue