Skip to content

Commit d2047bc

Browse files
committed
Auto merge of #28813 - arielb1:well-formed-variables, r=nikomatsakis
it doesn't seem to be necessary and is potentially harmful. r? @nikomatsakis
2 parents 16331f1 + c379f60 commit d2047bc

File tree

1 file changed

+1
-15
lines changed
  • src/librustc_typeck/check

1 file changed

+1
-15
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,21 +1557,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15571557

15581558
pub fn to_ty(&self, ast_t: &hir::Ty) -> Ty<'tcx> {
15591559
let t = ast_ty_to_ty(self, self, ast_t);
1560-
1561-
// Generally speaking, we must check that types entered by the
1562-
// user are well-formed. This is not true for `_`, since those
1563-
// types are generated by inference. Now, you might think that
1564-
// we could as well generate a WF obligation -- but
1565-
// unfortunately that breaks code like `foo as *const _`,
1566-
// because those type variables wind up being unconstrained
1567-
// until very late. Nasty. Probably it'd be best to refactor
1568-
// that code path, but that's tricky because of
1569-
// defaults. Argh!
1570-
match ast_t.node {
1571-
hir::TyInfer => { }
1572-
_ => { self.register_wf_obligation(t, ast_t.span, traits::MiscObligation); }
1573-
}
1574-
1560+
self.register_wf_obligation(t, ast_t.span, traits::MiscObligation);
15751561
t
15761562
}
15771563

0 commit comments

Comments
 (0)