Skip to content

Commit b33d3fc

Browse files
committed
confused_type_with_std_module considers parent.
1 parent bd5928f commit b33d3fc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
770770
expected.only_has_type(self),
771771
);
772772
}
773-
if let Some(span) =
774-
tcx.resolutions(()).confused_type_with_std_module.get(&span.with_parent(None))
775-
{
773+
if let Some(span) = tcx.resolutions(()).confused_type_with_std_module.get(&span) {
776774
err.span_suggestion(
777775
span.shrink_to_lo(),
778776
"you are looking for the module in `std`, not the primitive type",

0 commit comments

Comments
 (0)