@@ -54,7 +54,6 @@ pub use vtable::*;
54
54
55
55
use std:: fmt:: Debug ;
56
56
use std:: hash:: Hash ;
57
- use std:: { fmt, str} ;
58
57
59
58
pub use crate :: ty:: diagnostics:: * ;
60
59
pub use rustc_type_ir:: AliasKind :: * ;
@@ -148,6 +147,7 @@ mod opaque_hidden_type;
148
147
mod param_env;
149
148
mod placeholder;
150
149
mod predicate;
150
+ mod symbol_name;
151
151
mod term;
152
152
mod ty_; // FIXME: rename to `ty` once we don't import `crate::ty` here
153
153
mod variant_def;
@@ -166,6 +166,7 @@ pub use predicate::{
166
166
PolyTypeOutlivesPredicate , Predicate , PredicateKind , ProjectionPredicate ,
167
167
RegionOutlivesPredicate , SubtypePredicate , ToPredicate , TraitPredicate , TypeOutlivesPredicate ,
168
168
} ;
169
+ pub use symbol_name:: SymbolName ;
169
170
pub use term:: { Term , TermKind } ;
170
171
pub use ty_:: Ty ;
171
172
pub use variant_def:: VariantDef ;
@@ -1130,32 +1131,6 @@ pub struct CrateInherentImpls {
1130
1131
pub incoherent_impls : FxHashMap < SimplifiedType , Vec < LocalDefId > > ,
1131
1132
}
1132
1133
1133
- #[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , TyEncodable , HashStable ) ]
1134
- pub struct SymbolName < ' tcx > {
1135
- /// `&str` gives a consistent ordering, which ensures reproducible builds.
1136
- pub name : & ' tcx str ,
1137
- }
1138
-
1139
- impl < ' tcx > SymbolName < ' tcx > {
1140
- pub fn new ( tcx : TyCtxt < ' tcx > , name : & str ) -> SymbolName < ' tcx > {
1141
- SymbolName {
1142
- name : unsafe { str:: from_utf8_unchecked ( tcx. arena . alloc_slice ( name. as_bytes ( ) ) ) } ,
1143
- }
1144
- }
1145
- }
1146
-
1147
- impl < ' tcx > fmt:: Display for SymbolName < ' tcx > {
1148
- fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1149
- fmt:: Display :: fmt ( & self . name , fmt)
1150
- }
1151
- }
1152
-
1153
- impl < ' tcx > fmt:: Debug for SymbolName < ' tcx > {
1154
- fn fmt ( & self , fmt : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1155
- fmt:: Display :: fmt ( & self . name , fmt)
1156
- }
1157
- }
1158
-
1159
1134
#[ derive( Debug , Default , Copy , Clone ) ]
1160
1135
pub struct InferVarInfo {
1161
1136
/// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo`
0 commit comments