Skip to content

Commit 1539eb8

Browse files
Don't check for late-bound vars, check for escaping bound vars
1 parent 661e91b commit 1539eb8

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
@@ -1160,7 +1160,12 @@ pub fn make_normalized_projection<'tcx>(
11601160
) -> Option<Ty<'tcx>> {
11611161
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
11621162
#[cfg(debug_assertions)]
1163-
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
1163+
if let Some((i, arg)) = ty
1164+
.args
1165+
.iter()
1166+
.enumerate()
1167+
.find(|(_, arg)| arg.has_escaping_bound_vars())
1168+
{
11641169
debug_assert!(
11651170
false,
11661171
"args contain late-bound region at index `{i}` which can't be normalized.\n\
@@ -1233,7 +1238,12 @@ pub fn make_normalized_projection_with_regions<'tcx>(
12331238
) -> Option<Ty<'tcx>> {
12341239
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
12351240
#[cfg(debug_assertions)]
1236-
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
1241+
if let Some((i, arg)) = ty
1242+
.args
1243+
.iter()
1244+
.enumerate()
1245+
.find(|(_, arg)| arg.has_escaping_bound_vars())
1246+
{
12371247
debug_assert!(
12381248
false,
12391249
"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)