Skip to content

Commit 7d2083c

Browse files
committed
small mir typeck cleanup
1 parent 6c943ba commit 7d2083c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

compiler/rustc_borrowck/src/type_check/canonical.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
9090
locations: Locations,
9191
category: ConstraintCategory<'tcx>,
9292
) {
93-
self.prove_predicates(
94-
Some(ty::Binder::dummy(ty::PredicateKind::Trait(ty::TraitPredicate {
93+
self.prove_predicate(
94+
ty::Binder::dummy(ty::PredicateKind::Trait(ty::TraitPredicate {
9595
trait_ref,
9696
constness: ty::BoundConstness::NotConst,
9797
polarity: ty::ImplPolarity::Positive,
98-
}))),
98+
}))
99+
.to_predicate(self.tcx()),
99100
locations,
100101
category,
101102
);

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
268268
// }
269269
// impl Foo for () {
270270
// type Bar = ();
271-
// fn foo(&self) ->&() {}
271+
// fn foo(&self) -> &() {}
272272
// }
273273
// ```
274274
// Both &Self::Bar and &() are WF

compiler/rustc_borrowck/src/type_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19111911
}
19121912
}
19131913

1914-
&Rvalue::NullaryOp(_, ty) => {
1914+
&Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => {
19151915
let trait_ref = ty::TraitRef {
19161916
def_id: tcx.require_lang_item(LangItem::Sized, Some(self.last_span)),
19171917
substs: tcx.mk_substs_trait(ty, &[]),

0 commit comments

Comments
 (0)