Skip to content

Commit

Permalink
Don't check for late-bound vars, check for escaping bound vars
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Nov 12, 2023
1 parent 661e91b commit 1539eb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 106 deletions.
14 changes: 12 additions & 2 deletions clippy_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,12 @@ pub fn make_normalized_projection<'tcx>(
) -> Option<Ty<'tcx>> {
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
#[cfg(debug_assertions)]
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
if let Some((i, arg)) = ty
.args
.iter()
.enumerate()
.find(|(_, arg)| arg.has_escaping_bound_vars())
{
debug_assert!(
false,
"args contain late-bound region at index `{i}` which can't be normalized.\n\
Expand Down Expand Up @@ -1233,7 +1238,12 @@ pub fn make_normalized_projection_with_regions<'tcx>(
) -> Option<Ty<'tcx>> {
fn helper<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: AliasTy<'tcx>) -> Option<Ty<'tcx>> {
#[cfg(debug_assertions)]
if let Some((i, arg)) = ty.args.iter().enumerate().find(|(_, arg)| arg.has_late_bound_regions()) {
if let Some((i, arg)) = ty
.args
.iter()
.enumerate()
.find(|(_, arg)| arg.has_escaping_bound_vars())
{
debug_assert!(
false,
"args contain late-bound region at index `{i}` which can't be normalized.\n\
Expand Down
104 changes: 0 additions & 104 deletions tests/ui/crashes/ice-11230.stderr

This file was deleted.

0 comments on commit 1539eb8

Please sign in to comment.