We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b76881b commit 76d8493Copy full SHA for 76d8493
compiler/rustc_borrowck/src/region_infer/mod.rs
@@ -973,9 +973,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
973
// If we are checking that `'sup: 'sub`, and `'sub` contains
974
// some placeholder that `'sup` cannot name, then this is only
975
// true if `'sup` outlives static.
976
- if !self.can_name_all_placeholders(sup_region_scc, sub_region_scc)
977
- && sub_region != fr_static
978
- // To avoid potentially infinite recursion.
+ //
+ // Avoid infinite recursion if `sub_region` is already `'static`
+ if sub_region != fr_static && !self.can_name_all_placeholders(sup_region_scc, sub_region_scc)
979
{
980
debug!(
981
"sub universe `{sub_region_scc:?}` is not nameable \
0 commit comments