pub struct Assume {
pub alignment: bool,
pub lifetimes: bool,
pub safety: bool,
pub validity: bool,
}
🔬This is a nightly-only experimental API. (
transmutability
#99571)Expand description
编译器应假定 你 正在检查哪些转换安全条件?
Fields§
§alignment: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 确保 (动态或静态) 目标引用对象没有比源引用对象更严格的对齐要求。
lifetimes: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假设 你 确保生命周期不会以违反 Rust 内存模型的方式扩展。
safety: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 已确保您可以安全地违反目标类型 (有时也是源类型) 的类型和字段隐私。
validity: bool
🔬This is a nightly-only experimental API. (
transmutability
#99571)当 true
时,编译器假定 你 确保源类型实际上是目标类型的有效实例。
Implementations§
source§impl Assume
impl Assume
sourcepub const NOTHING: Self = _
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const NOTHING: Self = _
transmutability
#99571)不要假设您已确保满足任何安全属性。
sourcepub const ALIGNMENT: Self = _
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const ALIGNMENT: Self = _
transmutability
#99571)仅假设满足对齐条件。
sourcepub const LIFETIMES: Self = _
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const LIFETIMES: Self = _
transmutability
#99571)假设仅满足生命周期条件。
sourcepub const SAFETY: Self = _
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const SAFETY: Self = _
transmutability
#99571)仅假设满足安全条件。
sourcepub const VALIDITY: Self = _
🔬This is a nightly-only experimental API. (transmutability
#99571)
pub const VALIDITY: Self = _
transmutability
#99571)仅假设满足动态可满足的有效性条件。