@@ -16,7 +16,7 @@ use hir::map::{DefPathData, Node};
16
16
use hir;
17
17
use ich:: NodeIdHashingMode ;
18
18
use middle:: const_val:: ConstVal ;
19
- use traits:: { self , Reveal } ;
19
+ use traits;
20
20
use ty:: { self , Ty , TyCtxt , TypeFoldable } ;
21
21
use ty:: fold:: TypeVisitor ;
22
22
use ty:: subst:: { Subst , UnpackedKind } ;
@@ -182,48 +182,6 @@ pub enum Representability {
182
182
}
183
183
184
184
impl < ' tcx > ty:: ParamEnv < ' tcx > {
185
- /// Construct a trait environment suitable for contexts where
186
- /// there are no where clauses in scope. Hidden types (like `impl
187
- /// Trait`) are left hidden, so this is suitable for ordinary
188
- /// type-checking.
189
- pub fn empty ( ) -> Self {
190
- Self :: new ( ty:: Slice :: empty ( ) , Reveal :: UserFacing , ty:: UniverseIndex :: ROOT )
191
- }
192
-
193
- /// Construct a trait environment with no where clauses in scope
194
- /// where the values of all `impl Trait` and other hidden types
195
- /// are revealed. This is suitable for monomorphized, post-typeck
196
- /// environments like trans or doing optimizations.
197
- ///
198
- /// NB. If you want to have predicates in scope, use `ParamEnv::new`,
199
- /// or invoke `param_env.with_reveal_all()`.
200
- pub fn reveal_all ( ) -> Self {
201
- Self :: new ( ty:: Slice :: empty ( ) , Reveal :: All , ty:: UniverseIndex :: ROOT )
202
- }
203
-
204
- /// Construct a trait environment with the given set of predicates.
205
- pub fn new ( caller_bounds : & ' tcx ty:: Slice < ty:: Predicate < ' tcx > > ,
206
- reveal : Reveal ,
207
- universe : ty:: UniverseIndex )
208
- -> Self {
209
- ty:: ParamEnv { caller_bounds, reveal, universe }
210
- }
211
-
212
- /// Returns a new parameter environment with the same clauses, but
213
- /// which "reveals" the true results of projections in all cases
214
- /// (even for associated types that are specializable). This is
215
- /// the desired behavior during trans and certain other special
216
- /// contexts; normally though we want to use `Reveal::UserFacing`,
217
- /// which is the default.
218
- pub fn with_reveal_all ( self ) -> Self {
219
- ty:: ParamEnv { reveal : Reveal :: All , ..self }
220
- }
221
-
222
- /// Returns this same environment but with no caller bounds.
223
- pub fn without_caller_bounds ( self ) -> Self {
224
- ty:: ParamEnv { caller_bounds : ty:: Slice :: empty ( ) , ..self }
225
- }
226
-
227
185
pub fn can_type_implement_copy < ' a > ( self ,
228
186
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
229
187
self_type : Ty < ' tcx > , span : Span )
0 commit comments