Skip to content

Commit

Permalink
accept ReStatic for RPITIT
Browse files Browse the repository at this point in the history
add an ui test for #112094
  • Loading branch information
TaKO8Ki committed Jun 25, 2023
1 parent 0c2c243 commit 83722c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}"),
}
});
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/impl-trait/static-lifetime-return-position-impl-trait.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 83722c6

Please sign in to comment.