@@ -35,10 +35,10 @@ pub fn custom_coerce_unsize_info<'tcx>(
35
35
) -> CustomCoerceUnsized {
36
36
let def_id = tcx. require_lang_item ( LangItem :: CoerceUnsized , None ) ;
37
37
38
- let trait_ref = ty:: Binder :: bind (
39
- ty :: TraitRef { def_id, substs : tcx . mk_substs_trait ( source_ty , & [ target_ty . into ( ) ] ) } ,
40
- tcx,
41
- ) ;
38
+ let trait_ref = ty:: Binder :: dummy ( ty :: TraitRef {
39
+ def_id,
40
+ substs : tcx. mk_substs_trait ( source_ty , & [ target_ty . into ( ) ] ) ,
41
+ } ) ;
42
42
43
43
match tcx. codegen_fulfill_obligation ( ( ty:: ParamEnv :: reveal_all ( ) , trait_ref) ) {
44
44
Ok ( traits:: ImplSource :: UserDefined ( traits:: ImplSourceUserDefinedData {
@@ -301,7 +301,7 @@ fn check_recursion_limit<'tcx>(
301
301
// Code that needs to instantiate the same function recursively
302
302
// more than the recursion limit is assumed to be causing an
303
303
// infinite expansion.
304
- if !tcx. sess . recursion_limit ( ) . value_within_limit ( adjusted_recursion_depth) {
304
+ if !tcx. recursion_limit ( ) . value_within_limit ( adjusted_recursion_depth) {
305
305
let error = format ! ( "reached the recursion limit while instantiating `{}`" , instance) ;
306
306
let mut err = tcx. sess . struct_span_fatal ( span, & error) ;
307
307
err. span_note (
@@ -335,7 +335,7 @@ fn check_type_length_limit<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) {
335
335
// which means that rustc basically hangs.
336
336
//
337
337
// Bail out in these cases to avoid that bad user experience.
338
- if !tcx. sess . type_length_limit ( ) . value_within_limit ( type_length) {
338
+ if !tcx. type_length_limit ( ) . value_within_limit ( type_length) {
339
339
// The instance name is already known to be too long for rustc.
340
340
// Show only the first and last 32 characters to avoid blasting
341
341
// the user's terminal with thousands of lines of type-name.
0 commit comments