Skip to content

Commit 9bad0da

Browse files
committed
add fixme in typoed const pattern lint
1 parent d9165b2 commit 9bad0da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,12 @@ fn find_fallback_pattern_typo<'tcx>(
10861086
let vis = cx.tcx.visibility(item.owner_id);
10871087
if vis.is_accessible_from(parent, cx.tcx) {
10881088
accessible.push(item_name);
1089+
// FIXME: the line below from PR #135310 is a workaround for the ICE in issue
1090+
// #135289, where a macro in a dependency can create unreachable patterns in the
1091+
// current crate. Path trimming expects diagnostics for a typoed const, but no
1092+
// diagnostics are emitted and we ICE. See
1093+
// `tests/ui/resolve/const-with-typo-in-pattern-binding-ice-135289.rs` for a
1094+
// test that reproduces the ICE if we don't use `with_no_trimmed_paths!`.
10891095
let path = with_no_trimmed_paths!(cx.tcx.def_path_str(item.owner_id));
10901096
accessible_path.push(path);
10911097
} else if name == item_name {

0 commit comments

Comments
 (0)