Skip to content

Commit 4767329

Browse files
committed
WIP
1 parent 3c235d5 commit 4767329

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5396,17 +5396,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
53965396

53975397
let tcx = self.tcx;
53985398

5399-
match def {
5400-
Def::Local(nid) | Def::Upvar(nid, ..) => {
5401-
let hid = self.tcx.hir().node_to_hir_id(nid);
5402-
let ty = self.local_ty(span, hid).decl_ty;
5403-
let ty = self.normalize_associated_types_in(span, &ty);
5404-
self.write_ty(hir_id, ty);
5405-
return (ty, def);
5406-
}
5407-
_ => {}
5408-
}
5409-
54105399
let (def, def_id, ty) = self.rewrite_self_ctor(def, span);
54115400
let path_segs = AstConv::def_ids_for_path_segments(self, segments, self_ty, def);
54125401

@@ -5469,6 +5458,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
54695458
user_self_ty = None;
54705459
}
54715460

5461+
match def {
5462+
Def::Local(nid) | Def::Upvar(nid, ..) => {
5463+
let hid = self.tcx.hir().node_to_hir_id(nid);
5464+
let ty = self.local_ty(span, hid).decl_ty;
5465+
let ty = self.normalize_associated_types_in(span, &ty);
5466+
self.write_ty(hir_id, ty);
5467+
return (ty, def);
5468+
}
5469+
_ => {}
5470+
}
5471+
54725472
// Now we have to compare the types that the user *actually*
54735473
// provided against the types that were *expected*. If the user
54745474
// did not provide any types, then we want to substitute inference

src/test/run-pass/issue-60989.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
let c1 = ();
3+
c1::<()>;
4+
}

0 commit comments

Comments
 (0)