Skip to content

Commit fa987b3

Browse files
committed
rustc_typeck: remove old-style WF obligation
1 parent 03abb1b commit fa987b3

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
@@ -995,14 +995,6 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
995995

996996
// Add formal parameters.
997997
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-
1006998
// Check the pattern.
1007999
fcx.check_pat_arg(&arg.pat, arg_ty, true);
10081000
fcx.write_ty(arg.id, arg_ty);
@@ -1980,17 +1972,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
19801972
}
19811973
}
19821974

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-
19941975
/// Registers an obligation for checking later, during regionck, that the type `ty` must
19951976
/// outlive the region `r`.
19961977
pub fn register_wf_obligation(&self,
@@ -2005,21 +1986,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
20051986
ty::Predicate::WellFormed(ty)));
20061987
}
20071988

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-
20231989
/// Registers obligations that all types appearing in `substs` are well-formed.
20241990
pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &hir::Expr)
20251991
{

0 commit comments

Comments
 (0)