Skip to content

Commit

Permalink
Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errors
Browse files Browse the repository at this point in the history
Accept `ReStatic` for RPITIT

Fixes #112094

Regression in 8216b7f

If there is a better suggestion, I will go with that.
  • Loading branch information
matthiaskrgr authored Jun 25, 2023
2 parents d7723f4 + 83722c6 commit 6c75757
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 @@ -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:?}"),
}
});
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 6c75757

Please sign in to comment.