diff options
| author | Gary Guo <gary@garyguo.net> | 2022-04-29 15:27:05 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2022-05-03 14:37:16 +0100 |
| commit | bf4d7fa43fbd4352a4c1c909b5791e2b5f0b07ef (patch) | |
| tree | d683a6cdd804e783938ebd4a0bff01674a1387dd | |
| parent | ea5fa17998d7768664129294277986f7bad27923 (diff) | |
| download | rust-bf4d7fa43fbd4352a4c1c909b5791e2b5f0b07ef.tar.gz rust-bf4d7fa43fbd4352a4c1c909b5791e2b5f0b07ef.zip | |
Hide InlineConst's generic arg during print
The generic arg is for type inference only and shouldn't be exposed to users.
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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. |
