diff options
| author | Venkata Giri Reddy <venkatagirireddy@gmail.com> | 2017-06-13 20:14:23 +0000 |
|---|---|---|
| committer | Venkata Giri Reddy <venkatagirireddy@gmail.com> | 2017-06-28 17:54:17 +0000 |
| commit | 6db48380ce437bcb21da450db1696ede0fcba158 (patch) | |
| tree | 32dd3ee1f393c53ac2dcb935045a11bbd5082cd1 | |
| parent | 47faf1d51952ecd9d4c8a7325332fba34fbe00bd (diff) | |
rustc_typeck: remove old-style WF obligation
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 701de029b2b..c08eeb740ec 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -992,14 +992,6 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>, // Add formal parameters. for (arg_ty, arg) in fn_sig.inputs().iter().zip(&body.arguments) { - // The type of the argument must be well-formed. - // - // NB -- this is now checked in wfcheck, but that - // currently only results in warnings, so we issue an - // old-style WF obligation here so that we still get the - // errors that we used to get. - fcx.register_old_wf_obligation(arg_ty, arg.pat.span, traits::MiscObligation); - // Check the pattern. fcx.check_pat_arg(&arg.pat, arg_ty, true); fcx.write_ty(arg.id, arg_ty); @@ -1979,17 +1971,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// Registers an obligation for checking later, during regionck, that the type `ty` must /// outlive the region `r`. - pub fn register_region_obligation(&self, - ty: Ty<'tcx>, - region: ty::Region<'tcx>, - cause: traits::ObligationCause<'tcx>) - { - let mut fulfillment_cx = self.fulfillment_cx.borrow_mut(); - fulfillment_cx.register_region_obligation(ty, region, cause); - } - - /// Registers an obligation for checking later, during regionck, that the type `ty` must - /// outlive the region `r`. pub fn register_wf_obligation(&self, ty: Ty<'tcx>, span: Span, @@ -2002,21 +1983,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { ty::Predicate::WellFormed(ty))); } - pub fn register_old_wf_obligation(&self, - ty: Ty<'tcx>, - span: Span, - code: traits::ObligationCauseCode<'tcx>) - { - // Registers an "old-style" WF obligation that uses the - // implicator code. This is basically a buggy version of - // `register_wf_obligation` that is being kept around - // temporarily just to help with phasing in the newer rules. - // - // FIXME(#27579) all uses of this should be migrated to register_wf_obligation eventually - let cause = traits::ObligationCause::new(span, self.body_id, code); - self.register_region_obligation(ty, self.tcx.types.re_empty, cause); - } - /// Registers obligations that all types appearing in `substs` are well-formed. pub fn add_wf_bounds(&self, substs: &Substs<'tcx>, expr: &hir::Expr) { |
