Skip to content

Commit

Permalink
Hide InlineConst's generic arg during print
Browse files Browse the repository at this point in the history
The generic arg is for type inference only and shouldn't be exposed
to users.
  • Loading branch information
nbdd0121 committed May 3, 2022
1 parent ea5fa17 commit bf4d7fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/print/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bf4d7fa

Please sign in to comment.