diff options
| author | bors <bors@rust-lang.org> | 2015-10-03 04:16:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-03 04:16:52 +0000 |
| commit | d2047bc97d43dcb6b3d968b9acba1ab4d2de892e (patch) | |
| tree | c68adc9487b31c868079e25b5e811b2b5fc63e01 | |
| parent | 16331f1a42842ecdbf3dbcd6805df47564660266 (diff) | |
| parent | c379f604f12520f92783501417d8bd392dd40339 (diff) | |
| download | rust-d2047bc97d43dcb6b3d968b9acba1ab4d2de892e.tar.gz rust-d2047bc97d43dcb6b3d968b9acba1ab4d2de892e.zip | |
Auto merge of #28813 - arielb1:well-formed-variables, r=nikomatsakis
it doesn't seem to be necessary and is potentially harmful. r? @nikomatsakis
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 08a0f1c7e87..278aa9450ee 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1557,21 +1557,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pub fn to_ty(&self, ast_t: &hir::Ty) -> Ty<'tcx> { let t = ast_ty_to_ty(self, self, ast_t); - - // Generally speaking, we must check that types entered by the - // user are well-formed. This is not true for `_`, since those - // types are generated by inference. Now, you might think that - // we could as well generate a WF obligation -- but - // unfortunately that breaks code like `foo as *const _`, - // because those type variables wind up being unconstrained - // until very late. Nasty. Probably it'd be best to refactor - // that code path, but that's tricky because of - // defaults. Argh! - match ast_t.node { - hir::TyInfer => { } - _ => { self.register_wf_obligation(t, ast_t.span, traits::MiscObligation); } - } - + self.register_wf_obligation(t, ast_t.span, traits::MiscObligation); t } |
