1
Fork 0

Instance is Copy

This commit is contained in:
Michael Goulet 2024-03-25 13:58:33 -04:00
parent cb7c63606e
commit 99fbc6f8ef
7 changed files with 38 additions and 38 deletions

View file

@ -335,7 +335,7 @@ impl<'tcx> InstanceDef<'tcx> {
fn fmt_instance(
f: &mut fmt::Formatter<'_>,
instance: &Instance<'_>,
instance: Instance<'_>,
type_length: Option<rustc_session::Limit>,
) -> fmt::Result {
ty::tls::with(|tcx| {
@ -369,9 +369,9 @@ fn fmt_instance(
}
}
pub struct ShortInstance<'a, 'tcx>(pub &'a Instance<'tcx>, pub usize);
pub struct ShortInstance<'tcx>(pub Instance<'tcx>, pub usize);
impl<'a, 'tcx> fmt::Display for ShortInstance<'a, 'tcx> {
impl<'tcx> fmt::Display for ShortInstance<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_instance(f, self.0, Some(rustc_session::Limit(self.1)))
}
@ -379,7 +379,7 @@ impl<'a, 'tcx> fmt::Display for ShortInstance<'a, 'tcx> {
impl<'tcx> fmt::Display for Instance<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_instance(f, self, None)
fmt_instance(f, *self, None)
}
}