diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-01 09:28:46 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-04-02 07:30:11 +0000 |
| commit | 6697f02761c98a6b1a213ca65a70f70e08b184cf (patch) | |
| tree | 204a9ee3a1e1d3e36db660c975d990cb361b5baa /compiler/rustc_middle/src/ty/util.rs | |
| parent | ca32447c0ccd38367ad1ff98c784f17f21d0e80e (diff) | |
| download | rust-6697f02761c98a6b1a213ca65a70f70e08b184cf.tar.gz rust-6697f02761c98a6b1a213ca65a70f70e08b184cf.zip | |
Fetch the destructor constness lazily
Diffstat (limited to 'compiler/rustc_middle/src/ty/util.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 45a7635087e..7743e202aae 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -414,18 +414,18 @@ impl<'tcx> TyCtxt<'tcx> { continue; }; - if let Some((old_item_id, _)) = dtor_candidate { + if let Some(old_item_id) = dtor_candidate { self.dcx() .struct_span_err(self.def_span(item_id), "multiple drop impls found") .with_span_note(self.def_span(old_item_id), "other impl here") .delay_as_bug(); } - dtor_candidate = Some((*item_id, self.impl_trait_header(impl_did).unwrap().constness)); + dtor_candidate = Some(*item_id); } - let (did, constness) = dtor_candidate?; - Some(ty::Destructor { did, constness }) + let did = dtor_candidate?; + Some(ty::Destructor { did }) } /// Calculate the async destructor of a given type. |
