diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-27 06:11:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-27 06:11:55 +0100 |
| commit | bade5566daab631611ec7bb47cea7ddf154ee27b (patch) | |
| tree | 3f985f8bcf10958a89e1d5e717240b5fb6915a80 /compiler | |
| parent | 37338b8d996b05864d74d0a71b2c173bc41f890d (diff) | |
| parent | 65e56616fc71744b20b02622200d42860561b20c (diff) | |
Rollup merge of #108502 - lenko-d:cannot_relate_region, r=compiler-errors
Don't trigger error for ReError when other region is empty. Fixes [#107988](https://github.com/rust-lang/rust/issues/107988)
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs index 335eb4c5406..a499018d3a2 100644 --- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs +++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs @@ -438,7 +438,11 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { } (VarValue::Value(a), VarValue::Empty(_)) => { match *a { - ReLateBound(..) | ReErased | ReError(_) => { + // this is always on an error path, + // so it doesn't really matter if it's shorter or longer than an empty region + ReError(_) => false, + + ReLateBound(..) | ReErased => { bug!("cannot relate region: {:?}", a); } @@ -467,7 +471,11 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { } (VarValue::Empty(a_ui), VarValue::Value(b)) => { match *b { - ReLateBound(..) | ReErased | ReError(_) => { + // this is always on an error path, + // so it doesn't really matter if it's shorter or longer than an empty region + ReError(_) => false, + + ReLateBound(..) | ReErased => { bug!("cannot relate region: {:?}", b); } |
