diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-06 20:08:29 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-02-13 03:45:04 +0000 |
| commit | 516afd557c521eae3a64882b93d32772f3e2fa45 (patch) | |
| tree | c102e77323e1271ca98ac99d12978a7e1a8a1198 /compiler/rustc_middle/src | |
| parent | c72d443cddc78ce239d3a7abc57864bf617bdf2d (diff) | |
| download | rust-516afd557c521eae3a64882b93d32772f3e2fa45.tar.gz rust-516afd557c521eae3a64882b93d32772f3e2fa45.zip | |
Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validity
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/traits/select.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/adt.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/traits/select.rs b/compiler/rustc_middle/src/traits/select.rs index b7cd545d02d..811bd8fb458 100644 --- a/compiler/rustc_middle/src/traits/select.rs +++ b/compiler/rustc_middle/src/traits/select.rs @@ -168,6 +168,8 @@ pub enum SelectionCandidate<'tcx> { BuiltinObjectCandidate, BuiltinUnsizeCandidate, + + BikeshedGuaranteedNoDropCandidate, } /// The result of trait evaluation. The order is important diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index e28fcc555dc..b529d17540a 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -217,6 +217,10 @@ impl<'tcx> rustc_type_ir::inherent::AdtDef<TyCtxt<'tcx>> for AdtDef<'tcx> { self.is_phantom_data() } + fn is_manually_drop(self) -> bool { + self.is_manually_drop() + } + fn all_field_tys( self, tcx: TyCtxt<'tcx>, diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index a9b4593c13d..9c07981a027 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -690,6 +690,7 @@ bidirectional_lang_item_map! { AsyncFnOnce, AsyncFnOnceOutput, AsyncIterator, + BikeshedGuaranteedNoDrop, CallOnceFuture, CallRefFuture, Clone, |
