@@ -11,6 +11,8 @@ use crate::OpaqueTyId;
1111use crate :: Parameter ;
1212use crate :: ParameterData ;
1313use crate :: ParameterKind ;
14+ use crate :: ParameterKinds ;
15+ use crate :: ParameterKindsWithUniverseIndex ;
1416use crate :: ProgramClause ;
1517use crate :: ProgramClauseData ;
1618use crate :: ProgramClauseImplication ;
@@ -282,6 +284,36 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
282284 None
283285 }
284286
287+ /// Prints the debug representation of a parameter kinds list. To get good
288+ /// results, this requires inspecting TLS, and is difficult to
289+ /// code without reference to a specific interner (and hence
290+ /// fully known types).
291+ ///
292+ /// Returns `None` to fallback to the default debug output (e.g.,
293+ /// if no info about current program is available from TLS).
294+ #[ allow( unused_variables) ]
295+ fn debug_parameter_kinds (
296+ parameter_kinds : & ParameterKinds < Self > ,
297+ fmt : & mut fmt:: Formatter < ' _ > ,
298+ ) -> Option < fmt:: Result > {
299+ None
300+ }
301+
302+ /// Prints the debug representation of an parameter kinds list with universe index.
303+ /// To get good results, this requires inspecting TLS, and is difficult to
304+ /// code without reference to a specific interner (and hence
305+ /// fully known types).
306+ ///
307+ /// Returns `None` to fallback to the default debug output (e.g.,
308+ /// if no info about current program is available from TLS).
309+ #[ allow( unused_variables) ]
310+ fn debug_parameter_kinds_with_universe_index (
311+ parameter_kinds_with_universe_index : & ParameterKindsWithUniverseIndex < Self > ,
312+ fmt : & mut fmt:: Formatter < ' _ > ,
313+ ) -> Option < fmt:: Result > {
314+ None
315+ }
316+
285317 /// Prints the debug representation of an goal. To get good
286318 /// results, this requires inspecting TLS, and is difficult to
287319 /// code without reference to a specific interner (and hence
@@ -548,12 +580,22 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
548580
549581pub trait TargetInterner < I : Interner > : Interner {
550582 fn transfer_def_id ( def_id : I :: DefId ) -> Self :: DefId ;
583+
584+ fn transfer_parameter_kinds_with_universe_index (
585+ parameter_kinds : I :: InternedParameterKindsWithUniverseIndex ,
586+ ) -> Self :: InternedParameterKindsWithUniverseIndex ;
551587}
552588
553589impl < I : Interner > TargetInterner < I > for I {
554590 fn transfer_def_id ( def_id : I :: DefId ) -> Self :: DefId {
555591 def_id
556592 }
593+
594+ fn transfer_parameter_kinds_with_universe_index (
595+ parameter_kinds : I :: InternedParameterKindsWithUniverseIndex ,
596+ ) -> Self :: InternedParameterKindsWithUniverseIndex {
597+ parameter_kinds
598+ }
557599}
558600
559601/// Implemented by types that have an associated interner (which
@@ -674,6 +716,27 @@ mod default {
674716 tls:: with_current_program ( |prog| Some ( prog?. debug_parameter ( parameter, fmt) ) )
675717 }
676718
719+ fn debug_parameter_kinds (
720+ parameter_kinds : & ParameterKinds < Self > ,
721+ fmt : & mut fmt:: Formatter < ' _ > ,
722+ ) -> Option < fmt:: Result > {
723+ tls:: with_current_program ( |prog| {
724+ Some ( prog?. debug_parameter_kinds ( parameter_kinds, fmt) )
725+ } )
726+ }
727+
728+ fn debug_parameter_kinds_with_universe_index (
729+ parameter_kinds_with_universe_index : & ParameterKindsWithUniverseIndex < Self > ,
730+ fmt : & mut fmt:: Formatter < ' _ > ,
731+ ) -> Option < fmt:: Result > {
732+ tls:: with_current_program ( |prog| {
733+ Some ( prog?. debug_parameter_kinds_with_universe_index (
734+ parameter_kinds_with_universe_index,
735+ fmt,
736+ ) )
737+ } )
738+ }
739+
677740 fn debug_goal ( goal : & Goal < ChalkIr > , fmt : & mut fmt:: Formatter < ' _ > ) -> Option < fmt:: Result > {
678741 tls:: with_current_program ( |prog| Some ( prog?. debug_goal ( goal, fmt) ) )
679742 }
0 commit comments