accept ReStatic for RPITIT

add an ui test for #112094
This commit is contained in:
Takayuki Maeda 2023-06-25 22:28:04 +09:00
parent 0c2c243342
commit 83722c62b0
2 changed files with 13 additions and 1 deletions

View File

@ -1550,7 +1550,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() {}