diff options
| author | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2023-05-24 17:47:13 -0700 |
|---|---|---|
| committer | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2023-05-24 17:49:56 -0700 |
| commit | d2164d5c9a17a7c2eefeccf623c278612b2650de (patch) | |
| tree | b1dd74d0baeb833d0da51390c42cd91a8faf702c /compiler/rustc_transmute/src/lib.rs | |
| parent | 62663582375d7dedf42c0a30bfe04c7b53b452d7 (diff) | |
| download | rust-d2164d5c9a17a7c2eefeccf623c278612b2650de.tar.gz rust-d2164d5c9a17a7c2eefeccf623c278612b2650de.zip | |
Safe Transmute: Update definition of Condition type
- Change `Condition` to not contain `Answer`s but instead just contain other `Condition`s directly. - Also improve error reporting for `DstHasStricterAlignment`
Diffstat (limited to 'compiler/rustc_transmute/src/lib.rs')
| -rw-r--r-- | compiler/rustc_transmute/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index baf63e6d3a2..7a8cbd50d45 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -29,10 +29,10 @@ pub enum Condition<R> { IfTransmutable { src: R, dst: R }, /// `Src` is transmutable into `Dst`, if all of the enclosed requirements are met. - IfAll(Vec<Answer<R>>), + IfAll(Vec<Condition<R>>), /// `Src` is transmutable into `Dst` if any of the enclosed requirements are met. - IfAny(Vec<Answer<R>>), + IfAny(Vec<Condition<R>>), } /// Answers: Why wasn't the source type transmutable into the destination type? @@ -49,7 +49,7 @@ pub enum Reason { /// `Dst` is larger than `Src`, and the excess bytes were not exclusively uninitialized. DstIsTooBig, /// Src should have a stricter alignment than Dst, but it does not. - DstHasStricterAlignment, + DstHasStricterAlignment { src_min_align: usize, dst_min_align: usize }, /// Can't go from shared pointer to unique pointer DstIsMoreUnique, } |
