You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8937893
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: charon/src/ast/bodies/expressions.rs
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@ pub enum CastKind {
196
196
/// (reference, `Box`, or other type that implements `CoerceUnsized`).
197
197
///
198
198
/// The special case of `&[T; N]` -> `&[T]` coercion is caught by `UnOp::ArrayToSlice`.
199
-
Unsize(Ty,UnsizingMetadata),
199
+
Unsize(Ty,UnsizingMetadata,MetadataPath),
200
200
/// Reinterprets the bits of a value of one type as another type, i.e. exactly what
201
201
/// [`std::mem::transmute`] does.
202
202
Transmute(Ty),
@@ -205,15 +205,16 @@ pub enum CastKind {
205
205
/// - `&[mut] dyn Trait<...>` -> `&[mut] T`
206
206
/// - `*[mut] dyn Trait<...>` -> `*[mut] T`
207
207
/// - `Box<dyn Trait<...>>` -> `Box<T>` when no `--treat-box-as-builtin`
208
+
/// - smart-pointers, e.g. `Rc<dyn Trait<...>>` -> `Rc<T>` or
209
+
/// `Pin<&mut dyn Trait<...>>` -> `Pin<&mut T>`
208
210
///
209
211
/// For possible receivers, see: <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>.
210
-
/// Other receivers, e.g., `Rc` should be unpacked before the cast and re-boxed after.
211
-
/// FIXME(ssyram): but this is not implemented yet, namely, there may still be
212
-
/// something like `Rc<dyn Trait<...>> -> Rc<T>` in the types.
213
212
///
214
213
/// With `--index-to-function-calls`, this also converts `&[T]` to `&[T; N]` (or the mutable
215
214
/// equivalents) when an array subslice projection determines the length statically.
216
-
Concretize(Ty),
215
+
// FIXME(#855): smart-pointer receivers should rather be unpacked before the cast and re-packed after,
216
+
// so that the cast only ever applies to built-in pointers.
217
+
Concretize(Ty,MetadataPath),
217
218
}
218
219
219
220
/// Nullary operation
@@ -267,6 +268,11 @@ impl BorrowKind {
267
268
}
268
269
}
269
270
271
+
/// For `Unsize` and `Concretize` casts, the fields to follow from the cast value to the built-in
272
+
/// pointer whose metadata is changed, e.g. `[ptr, pointer]` for `Rc<T>`. Empty for built-in
0 commit comments