@@ -379,7 +379,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
379379 pub ( super ) fn type_is_sized ( & self , ty : Ty < ' tcx > ) -> bool {
380380 // generics are weird, don't run this function on a generic
381381 assert ! ( !ty. needs_subst( ) ) ;
382- ty. is_sized ( self . tcx , ty:: ParamEnv :: empty ( ) , DUMMY_SP )
382+ ty. is_sized ( self . tcx , ty:: ParamEnv :: empty ( Reveal :: All ) , DUMMY_SP )
383383 }
384384
385385 pub fn load_mir ( & self , instance : ty:: InstanceDef < ' tcx > ) -> EvalResult < ' tcx , & ' tcx mir:: Mir < ' tcx > > {
@@ -438,9 +438,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
438438 // TODO(solson): Is this inefficient? Needs investigation.
439439 let ty = self . monomorphize ( ty, substs) ;
440440
441- self . tcx . infer_ctxt ( ( ) , Reveal :: All ) . enter ( |infcx| {
442- ty. layout ( & infcx) . map_err ( EvalError :: Layout )
443- } )
441+ ty. layout ( self . tcx , ty:: ParamEnv :: empty ( Reveal :: All ) ) . map_err ( EvalError :: Layout )
444442 }
445443
446444 pub fn push_stack_frame (
@@ -2033,19 +2031,17 @@ pub fn needs_drop_glue<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, t: Ty<'tcx>) -> bo
20332031 // returned `false` does not appear unsound. The impact on
20342032 // code quality is unknown at this time.)
20352033
2036- let env = ty:: ParamEnv :: empty ( ) ;
2034+ let env = ty:: ParamEnv :: empty ( Reveal :: All ) ;
20372035 if !t. needs_drop ( tcx, env) {
20382036 return false ;
20392037 }
20402038 match t. sty {
20412039 ty:: TyAdt ( def, _) if def. is_box ( ) => {
20422040 let typ = t. boxed_ty ( ) ;
20432041 if !typ. needs_drop ( tcx, env) && type_is_sized ( tcx, typ) {
2044- tcx. infer_ctxt ( ( ) , traits:: Reveal :: All ) . enter ( |infcx| {
2045- let layout = t. layout ( & infcx) . unwrap ( ) ;
2046- // `Box<ZeroSizeType>` does not allocate.
2047- layout. size ( & tcx. data_layout ) . bytes ( ) != 0
2048- } )
2042+ let layout = t. layout ( tcx, ty:: ParamEnv :: empty ( Reveal :: All ) ) . unwrap ( ) ;
2043+ // `Box<ZeroSizeType>` does not allocate.
2044+ layout. size ( & tcx. data_layout ) . bytes ( ) != 0
20492045 } else {
20502046 true
20512047 }
@@ -2157,7 +2153,7 @@ impl<'a, 'tcx> ::rustc::ty::fold::TypeFolder<'tcx, 'tcx> for AssociatedTypeNorma
21572153fn type_is_sized < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , ty : Ty < ' tcx > ) -> bool {
21582154 // generics are weird, don't run this function on a generic
21592155 assert ! ( !ty. needs_subst( ) ) ;
2160- ty. is_sized ( tcx, ty:: ParamEnv :: empty ( ) , DUMMY_SP )
2156+ ty. is_sized ( tcx, ty:: ParamEnv :: empty ( Reveal :: All ) , DUMMY_SP )
21612157}
21622158
21632159/// Attempts to resolve an obligation. The result is a shallow vtable resolution -- meaning that we
@@ -2176,13 +2172,14 @@ fn fulfill_obligation<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
21762172
21772173 // Do the initial selection for the obligation. This yields the
21782174 // shallow result we are looking for -- that is, what specific impl.
2179- tcx. infer_ctxt ( ( ) , Reveal :: All ) . enter ( |infcx| {
2175+ tcx. infer_ctxt ( ( ) ) . enter ( |infcx| {
21802176 let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
21812177
21822178 let obligation_cause = traits:: ObligationCause :: misc ( span,
21832179 ast:: DUMMY_NODE_ID ) ;
21842180 let obligation = traits:: Obligation :: new ( obligation_cause,
2185- trait_ref. to_poly_trait_predicate ( ) ) ;
2181+ ty:: ParamEnv :: empty ( Reveal :: All ) ,
2182+ trait_ref. to_poly_trait_predicate ( ) ) ;
21862183
21872184 let selection = match selcx. select ( & obligation) {
21882185 Ok ( Some ( selection) ) => selection,
0 commit comments