about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-24 00:29:51 +0000
committerbors <bors@rust-lang.org>2022-10-24 00:29:51 +0000
commit7feb003882ecf7699e6705b537673e20985accff (patch)
tree1b40d50643374db387bde03626fabbc1845439db /compiler/rustc_middle/src
parent7aa361390867181d225a7775340f50e8162e16a2 (diff)
parentae2b1f096f888b4a248665184cb11fe763012a50 (diff)
downloadrust-7feb003882ecf7699e6705b537673e20985accff.tar.gz
rust-7feb003882ecf7699e6705b537673e20985accff.zip
Auto merge of #103452 - notriddle:rollup-peewevm, r=notriddle
Rollup of 11 pull requests

Successful merges:

 - #100462 (Clarify `array::from_fn` documentation)
 - #101644 (Document surprising and dangerous fs::Permissions behaviour on Unix)
 - #103005 (kmc-solid: Handle errors returned by `SOLID_FS_ReadDir`)
 - #103140 (Add diagnostic for calling a function with the same name with unresolved Macro)
 - #103254 (rustdoc: do not filter out cross-crate `Self: Sized` bounds)
 - #103347 (bootstrap: also create rustc-src component in sysroot)
 - #103402 (Fix wrapped valid-range handling in ty_find_init_error)
 - #103414 (Pretty print lifetimes captured by RPIT)
 - #103424 (rustdoc: remove no-op CSS `.code-header { border-bottom: none }`)
 - #103434 (Use functions for jump-to-def-background rustdoc GUI test)
 - #103447 (`MaybeUninit`: use `assume_init_drop()` in the partially initialized array example)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index f18c95a61d4..b8ee2b994b1 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -16,6 +16,7 @@ use rustc_session::cstore::{ExternCrate, ExternCrateSource};
 use rustc_span::symbol::{kw, Ident, Symbol};
 use rustc_target::abi::Size;
 use rustc_target::spec::abi::Abi;
+use smallvec::SmallVec;
 
 use std::cell::Cell;
 use std::char;
@@ -794,6 +795,7 @@ pub trait PrettyPrinter<'tcx>:
         let mut traits = FxIndexMap::default();
         let mut fn_traits = FxIndexMap::default();
         let mut is_sized = false;
+        let mut lifetimes = SmallVec::<[ty::Region<'tcx>; 1]>::new();
 
         for (predicate, _) in bounds.subst_iter_copied(tcx, substs) {
             let bound_predicate = predicate.kind();
@@ -824,6 +826,9 @@ pub trait PrettyPrinter<'tcx>:
                         &mut fn_traits,
                     );
                 }
+                ty::PredicateKind::TypeOutlives(outlives) => {
+                    lifetimes.push(outlives.1);
+                }
                 _ => {}
             }
         }
@@ -977,6 +982,11 @@ pub trait PrettyPrinter<'tcx>:
             write!(self, "Sized")?;
         }
 
+        for re in lifetimes {
+            write!(self, " + ")?;
+            self = self.print_region(re)?;
+        }
+
         Ok(self)
     }