Skip to content

Commit 83722c6

Browse files
committed
accept ReStatic for RPITIT
add an ui test for #112094
1 parent 0c2c243 commit 83722c6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
15501550
{
15511551
let opaque_ty = tcx.fold_regions(unshifted_opaque_ty, |re, _depth| {
15521552
match re.kind() {
1553-
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReError(_) => re,
1553+
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReError(_) | ty::ReStatic => re,
15541554
r => bug!("unexpected region: {r:?}"),
15551555
}
15561556
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// check-pass
2+
3+
#![allow(incomplete_features)]
4+
#![feature(adt_const_params, return_position_impl_trait_in_trait)]
5+
6+
pub struct Element;
7+
8+
pub trait Node {
9+
fn elements<const T: &'static str>(&self) -> impl Iterator<Item = Element>;
10+
}
11+
12+
fn main() {}

0 commit comments

Comments
 (0)