From bf4d7fa43fbd4352a4c1c909b5791e2b5f0b07ef Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Fri, 29 Apr 2022 15:27:05 +0100 Subject: [PATCH] Hide InlineConst's generic arg during print The generic arg is for type inference only and shouldn't be exposed to users. --- compiler/rustc_middle/src/ty/print/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_middle/src/ty/print/mod.rs b/compiler/rustc_middle/src/ty/print/mod.rs index 3fe68f723ec..a1d1b6b3a78 100644 --- a/compiler/rustc_middle/src/ty/print/mod.rs +++ b/compiler/rustc_middle/src/ty/print/mod.rs @@ -136,6 +136,10 @@ pub trait Printer<'tcx>: Sized { match key.disambiguated_data.data { // Closures' own generics are only captures, don't print them. DefPathData::ClosureExpr => {} + // This covers both `DefKind::AnonConst` and `DefKind::InlineConst`. + // Anon consts doesn't have their own generics, and inline consts' own + // generics are their inferred types, so don't print them. + DefPathData::AnonConst => {} // If we have any generic arguments to print, we do that // on top of the same path, but without its own generics.