From 09a8791d42152bb08ecb99d029ef6ce51ef48aea Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Thu, 13 Apr 2023 18:04:30 +0000 Subject: [PATCH] Implement `Copy` for `LocationDetail` --- .../src/interpret/intrinsics/caller_location.rs | 2 +- compiler/rustc_session/src/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs b/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs index 76c8d0a975a..3701eb93ec8 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs @@ -77,7 +77,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { line: u32, col: u32, ) -> MPlaceTy<'tcx, M::Provenance> { - let loc_details = &self.tcx.sess.opts.unstable_opts.location_detail; + let loc_details = self.tcx.sess.opts.unstable_opts.location_detail; // This can fail if rustc runs out of memory right here. Trying to emit an error would be // pointless, since that would require allocating more memory than these short strings. let file = if loc_details.file { diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index acfb36c97d0..79eb31bb105 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -222,7 +222,7 @@ impl LinkerPluginLto { } /// The different settings that can be enabled via the `-Z location-detail` flag. -#[derive(Clone, PartialEq, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Hash, Debug)] pub struct LocationDetail { pub file: bool, pub line: bool,