about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/astconv/bounds.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-01 14:23:51 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-01-18 16:07:10 +0000
commite532b0dd7e632fc017f9f66a1fb24c7183a40dff (patch)
tree07dcc08332c2acdfe757c03e86fcde781737e5f8 /compiler/rustc_hir_analysis/src/astconv/bounds.rs
parentc485ee71477a29041895c47cc441b364670f3772 (diff)
downloadrust-e532b0dd7e632fc017f9f66a1fb24c7183a40dff.tar.gz
rust-e532b0dd7e632fc017f9f66a1fb24c7183a40dff.zip
Don't forget that the lifetime on hir types is `'tcx`
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/bounds.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/bounds.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/bounds.rs b/compiler/rustc_hir_analysis/src/astconv/bounds.rs
index 2ad96a24891..401efff9242 100644
--- a/compiler/rustc_hir_analysis/src/astconv/bounds.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/bounds.rs
@@ -108,14 +108,16 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
     /// `param_ty` and `ast_bounds`. See `instantiate_poly_trait_ref`
     /// for more details.
     #[instrument(level = "debug", skip(self, ast_bounds, bounds))]
-    pub(crate) fn add_bounds<'hir, I: Iterator<Item = &'hir hir::GenericBound<'hir>>>(
+    pub(crate) fn add_bounds<'hir, I: Iterator<Item = &'hir hir::GenericBound<'tcx>>>(
         &self,
         param_ty: Ty<'tcx>,
         ast_bounds: I,
         bounds: &mut Bounds<'tcx>,
         bound_vars: &'tcx ty::List<ty::BoundVariableKind>,
         only_self_bounds: OnlySelfBounds,
-    ) {
+    ) where
+        'tcx: 'hir,
+    {
         for ast_bound in ast_bounds {
             match ast_bound {
                 hir::GenericBound::Trait(poly_trait_ref, modifier) => {
@@ -179,7 +181,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
     pub(crate) fn compute_bounds(
         &self,
         param_ty: Ty<'tcx>,
-        ast_bounds: &[hir::GenericBound<'_>],
+        ast_bounds: &[hir::GenericBound<'tcx>],
         filter: PredicateFilter,
     ) -> Bounds<'tcx> {
         let mut bounds = Bounds::default();