Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errors

Accept `ReStatic` for RPITIT

Fixes #112094

Regression in 8216b7f229

If there is a better suggestion, I will go with that.
This commit is contained in:
Matthias Krüger 2023-06-25 22:34:32 +02:00 committed by GitHub
commit 6c7575721f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -1549,7 +1549,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
{
let opaque_ty = tcx.fold_regions(unshifted_opaque_ty, |re, _depth| {
match re.kind() {
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReError(_) => re,
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReError(_) | ty::ReStatic => re,
r => bug!("unexpected region: {r:?}"),
}
});

View File

@ -0,0 +1,12 @@
// check-pass
#![allow(incomplete_features)]
#![feature(adt_const_params, return_position_impl_trait_in_trait)]
pub struct Element;
pub trait Node {
fn elements<const T: &'static str>(&self) -> impl Iterator<Item = Element>;
}
fn main() {}