Skip to content

Commit 6210ed3

Browse files
Structurally resolve in only_has_type
FIXME: the span is scuffed
1 parent da0380b commit 6210ed3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_hir_typeck/src/expectation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_middle::ty::{self, Ty};
2-
use rustc_span::Span;
2+
use rustc_span::{DUMMY_SP, Span};
33

44
use super::Expectation::*;
55
use super::FnCtxt;
@@ -102,7 +102,7 @@ impl<'a, 'tcx> Expectation<'tcx> {
102102
/// such a constraint, if it exists.
103103
pub(super) fn only_has_type(self, fcx: &FnCtxt<'a, 'tcx>) -> Option<Ty<'tcx>> {
104104
match self {
105-
ExpectHasType(ty) => Some(fcx.resolve_vars_if_possible(ty)),
105+
ExpectHasType(ty) => Some(fcx.try_structurally_resolve_type(DUMMY_SP, ty)),
106106
NoExpectation | ExpectCastableToType(_) | ExpectRvalueLikeUnsized(_) => None,
107107
}
108108
}

0 commit comments

Comments
 (0)