File tree 1 file changed +6
-0
lines changed
compiler/rustc_mir_build/src/thir/pattern
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1086,6 +1086,12 @@ fn find_fallback_pattern_typo<'tcx>(
1086
1086
let vis = cx. tcx . visibility ( item. owner_id ) ;
1087
1087
if vis. is_accessible_from ( parent, cx. tcx ) {
1088
1088
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!`.
1089
1095
let path = with_no_trimmed_paths ! ( cx. tcx. def_path_str( item. owner_id) ) ;
1090
1096
accessible_path. push ( path) ;
1091
1097
} else if name == item_name {
You can’t perform that action at this time.
0 commit comments