Skip to content

Commit ff386e2

Browse files
Don't check for late-bound vars, check for escaping bound vars
1 parent 45a882e commit ff386e2

File tree

2 files changed

+12
-106
lines changed

2 files changed

+12
-106
lines changed

clippy_utils/src/ty.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,12 @@ pub fn make_normalized_projection<'tcx>(
11571157
args: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>,
11581158
) -> Option<Ty<'tcx>> {
11591159
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
1160-
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
1160+
if let Some((i, arg)) = ty
1161+
.args
1162+
.iter()
1163+
.enumerate()
1164+
.find(|(_, arg)| arg.has_escaping_bound_vars())
1165+
{
11611166
debug_assert!(
11621167
false,
11631168
"args contain late-bound region at index `{i}` which can't be normalized.\n\
@@ -1229,7 +1234,12 @@ pub fn make_normalized_projection_with_regions<'tcx>(
12291234
args: impl IntoIterator<Item = impl Into<GenericArg<'tcx>>>,
12301235
) -> Option<Ty<'tcx>> {
12311236
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
1232-
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
1237+
if let Some((i, arg)) = ty
1238+
.args
1239+
.iter()
1240+
.enumerate()
1241+
.find(|(_, arg)| arg.has_escaping_bound_vars())
1242+
{
12331243
debug_assert!(
12341244
false,
12351245
"args contain late-bound region at index `{i}` which can't be normalized.\n\

tests/ui/crashes/ice-11230.stderr

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)