diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-14 11:25:53 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-14 11:38:25 +0200 |
| commit | b276b65f46465cffe207b4b732e6ab4642d47558 (patch) | |
| tree | d22152f4259e56e4f6b910705a8b8287ac284f8f /compiler/rustc_resolve/src | |
| parent | c31879922e6ec8200eee6c144073eafcc4a73e38 (diff) | |
| download | rust-b276b65f46465cffe207b4b732e6ab4642d47558.tar.gz rust-b276b65f46465cffe207b4b732e6ab4642d47558.zip | |
Forbid nested opaque types to reference HRTB from opaque types.
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index ae4455531ab..700d7c3bfb6 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -1025,6 +1025,20 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { } self.uninsert_lifetime_on_error(lifetime, def.unwrap()); } + if let hir::Node::Item(hir::Item { + kind: hir::ItemKind::OpaqueTy { .. }, .. + }) = self.tcx.hir().get(parent_id) + { + if !self.trait_definition_only { + let mut err = self.tcx.sess.struct_span_err( + lifetime.span, + "higher kinded lifetime bounds on nested opaque types are not supported yet", + ); + err.span_note(self.tcx.def_span(def_id), "lifetime declared here"); + err.emit(); + } + self.uninsert_lifetime_on_error(lifetime, def.unwrap()); + } } // We want to start our early-bound indices at the end of the parent scope, |
