We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9cb965 commit 2919430Copy full SHA for 2919430
library/core/src/any.rs
@@ -931,6 +931,8 @@ pub const fn downcast_trait_mut<
931
match vtable {
932
Some(dyn_metadata) => {
933
let pointer = ptr::from_raw_parts_mut(t, dyn_metadata);
934
+ // SAFETY: `t` is a reference to a type, so we know it is valid.
935
+ // `dyn_metadata` is a vtable for T, implementing the trait of `U`.
936
Some(unsafe { &mut *pointer })
937
}
938
None => None,
0 commit comments