@@ -995,14 +995,6 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
995
995
996
996
// Add formal parameters.
997
997
for ( arg_ty, arg) in fn_sig. inputs ( ) . iter ( ) . zip ( & body. arguments ) {
998
- // The type of the argument must be well-formed.
999
- //
1000
- // NB -- this is now checked in wfcheck, but that
1001
- // currently only results in warnings, so we issue an
1002
- // old-style WF obligation here so that we still get the
1003
- // errors that we used to get.
1004
- fcx. register_old_wf_obligation ( arg_ty, arg. pat . span , traits:: MiscObligation ) ;
1005
-
1006
998
// Check the pattern.
1007
999
fcx. check_pat_arg ( & arg. pat , arg_ty, true ) ;
1008
1000
fcx. write_ty ( arg. id , arg_ty) ;
@@ -1980,17 +1972,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
1980
1972
}
1981
1973
}
1982
1974
1983
- /// Registers an obligation for checking later, during regionck, that the type `ty` must
1984
- /// outlive the region `r`.
1985
- pub fn register_region_obligation ( & self ,
1986
- ty : Ty < ' tcx > ,
1987
- region : ty:: Region < ' tcx > ,
1988
- cause : traits:: ObligationCause < ' tcx > )
1989
- {
1990
- let mut fulfillment_cx = self . fulfillment_cx . borrow_mut ( ) ;
1991
- fulfillment_cx. register_region_obligation ( ty, region, cause) ;
1992
- }
1993
-
1994
1975
/// Registers an obligation for checking later, during regionck, that the type `ty` must
1995
1976
/// outlive the region `r`.
1996
1977
pub fn register_wf_obligation ( & self ,
@@ -2005,21 +1986,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
2005
1986
ty:: Predicate :: WellFormed ( ty) ) ) ;
2006
1987
}
2007
1988
2008
- pub fn register_old_wf_obligation ( & self ,
2009
- ty : Ty < ' tcx > ,
2010
- span : Span ,
2011
- code : traits:: ObligationCauseCode < ' tcx > )
2012
- {
2013
- // Registers an "old-style" WF obligation that uses the
2014
- // implicator code. This is basically a buggy version of
2015
- // `register_wf_obligation` that is being kept around
2016
- // temporarily just to help with phasing in the newer rules.
2017
- //
2018
- // FIXME(#27579) all uses of this should be migrated to register_wf_obligation eventually
2019
- let cause = traits:: ObligationCause :: new ( span, self . body_id , code) ;
2020
- self . register_region_obligation ( ty, self . tcx . types . re_empty , cause) ;
2021
- }
2022
-
2023
1989
/// Registers obligations that all types appearing in `substs` are well-formed.
2024
1990
pub fn add_wf_bounds ( & self , substs : & Substs < ' tcx > , expr : & hir:: Expr )
2025
1991
{
0 commit comments