Skip to content

Commit 6db4838

Browse files
committed
rustc_typeck: remove old-style WF obligation
1 parent 47faf1d commit 6db4838

File tree

1 file changed

+0
-34
lines changed
  • src/librustc_typeck/check

1 file changed

+0
-34
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -992,14 +992,6 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
992992

993993
// Add formal parameters.
994994
for (arg_ty, arg) in fn_sig.inputs().iter().zip(&body.arguments) {
995-
// The type of the argument must be well-formed.
996-
//
997-
// NB -- this is now checked in wfcheck, but that
998-
// currently only results in warnings, so we issue an
999-
// old-style WF obligation here so that we still get the
1000-
// errors that we used to get.
1001-
fcx.register_old_wf_obligation(arg_ty, arg.pat.span, traits::MiscObligation);
1002-
1003995
// Check the pattern.
1004996
fcx.check_pat_arg(&arg.pat, arg_ty, true);
1005997
fcx.write_ty(arg.id, arg_ty);
@@ -1977,17 +1969,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
19771969
}
19781970
}
19791971

1980-
/// Registers an obligation for checking later, during regionck, that the type `ty` must
1981-
/// outlive the region `r`.
1982-
pub fn register_region_obligation(&self,
1983-
ty: Ty<'tcx>,
1984-
region: ty::Region<'tcx>,
1985-
cause: traits::ObligationCause<'tcx>)
1986-
{
1987-
let mut fulfillment_cx = self.fulfillment_cx.borrow_mut();
1988-
fulfillment_cx.register_region_obligation(ty, region, cause);
1989-
}
1990-
19911972
/// Registers an obligation for checking later, during regionck, that the type `ty` must
19921973
/// outlive the region `r`.
19931974
pub fn register_wf_obligation(&self,
@@ -2002,21 +1983,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
20021983
ty::Predicate::WellFormed(ty)));
20031984
}
20041985

2005-
pub fn register_old_wf_obligation(&self,
2006-
ty: Ty<'tcx>,
2007-
span: Span,
2008-
code: traits::ObligationCauseCode<'tcx>)
2009-
{
2010-
// Registers an "old-style" WF obligation that uses the
2011-
// implicator code. This is basically a buggy version of
2012-
// `register_wf_obligation` that is being kept around
2013-
// temporarily just to help with phasing in the newer rules.
2014-
//
2015-
// FIXME(#27579) all uses of this should be migrated to register_wf_obligation eventually
2016-
let cause = traits::ObligationCause::new(span, self.body_id, code);
2017-
self.register_region_obligation(ty, self.tcx.types.re_empty, cause);
2018-
}
2019-
20201986
/// Registers obligations that all types appearing in `substs` are well-formed.
20211987
pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &hir::Expr)
20221988
{

0 commit comments

Comments
 (0)