safe transmute: use Assume struct to provide analysis options
This was left as a TODO in #92268, and brings the trait more in line with what was defined in MCP411. `Assume::visibility` has been renamed to `Assume::safety`, as library safety is what's actually being assumed; visibility is just the mechanism by which it is currently checked (this may change). ref: https://github.com/rust-lang/compiler-team/issues/411 ref: https://github.com/rust-lang/rust/issues/99571
This commit is contained in:
parent
e0dc8d7801
commit
f46fffc276
77 changed files with 1321 additions and 721 deletions
|
|
@ -3,6 +3,7 @@
|
|||
//! provided indirectly through an abstraction.
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(adt_const_params)]
|
||||
#![feature(transmutability)]
|
||||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
|
|
@ -13,19 +14,13 @@ mod assert {
|
|||
Src,
|
||||
Dst,
|
||||
Context,
|
||||
const ASSUME_ALIGNMENT: bool,
|
||||
const ASSUME_LIFETIMES: bool,
|
||||
const ASSUME_VALIDITY: bool,
|
||||
const ASSUME_VISIBILITY: bool,
|
||||
const ASSUME: std::mem::Assume,
|
||||
>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<
|
||||
Src,
|
||||
Context,
|
||||
ASSUME_ALIGNMENT,
|
||||
ASSUME_LIFETIMES,
|
||||
ASSUME_VALIDITY,
|
||||
ASSUME_VISIBILITY,
|
||||
ASSUME,
|
||||
>,
|
||||
{}
|
||||
}
|
||||
|
|
@ -35,7 +30,7 @@ fn direct() {
|
|||
#[repr(C)] struct Src;
|
||||
#[repr(C)] struct Dst;
|
||||
|
||||
assert::is_transmutable::<Src, Dst, Context, false, false, false, false>();
|
||||
assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>();
|
||||
}
|
||||
|
||||
fn via_const() {
|
||||
|
|
@ -45,7 +40,7 @@ fn via_const() {
|
|||
|
||||
const FALSE: bool = false;
|
||||
|
||||
assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>();
|
||||
assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>();
|
||||
}
|
||||
|
||||
fn via_associated_const() {
|
||||
|
|
@ -65,9 +60,13 @@ fn via_associated_const() {
|
|||
Src,
|
||||
Dst,
|
||||
Context,
|
||||
{Ty::FALSE},
|
||||
{Ty::FALSE},
|
||||
{Ty::FALSE},
|
||||
{Ty::FALSE}
|
||||
{
|
||||
std::mem::Assume {
|
||||
alignment: {Ty::FALSE},
|
||||
lifetimes: {Ty::FALSE},
|
||||
safety: {Ty::FALSE},
|
||||
validity: {Ty::FALSE},
|
||||
}
|
||||
}
|
||||
>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn array_like<T, E, const N: usize>()
|
||||
where
|
||||
T: BikeshedIntrinsicFrom<[E; N], Context, false, false, false, true>,
|
||||
[E; N]: BikeshedIntrinsicFrom<T, Context, false, false, false, true>
|
||||
T: BikeshedIntrinsicFrom<[E; N], Context, { Assume::SAFETY }>,
|
||||
[E; N]: BikeshedIntrinsicFrom<T, Context, { Assume::SAFETY }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,17 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,17 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,98 +1,134 @@
|
|||
error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:21:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:26:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:22:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:27:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 0]`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 0]`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:27:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:32:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:28:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:33:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 1]`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 1]`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:33:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:38:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:34:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:39:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 2]`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[String; 2]`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,18 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,322 +1,462 @@
|
|||
error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:41:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:48:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, true, true, true, true>` is not implemented for `V0i8`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i8`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:43:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:50:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i8, n8::Context, true, true, true, true>` is not implemented for `u16`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i8, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u16`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:49:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:56:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, true, true, true, true>` is not implemented for `V0u8`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u8`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:51:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:58:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u8, n8::Context, true, true, true, true>` is not implemented for `u16`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u8, n8::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u16`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:65:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:72:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, true, true, true, true>` is not implemented for `V0i16`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i16`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:67:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:74:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i16, n16::Context, true, true, true, true>` is not implemented for `u32`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i16, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u32`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:73:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:80:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, true, true, true, true>` is not implemented for `V0u16`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u16`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:75:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:82:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u16, n16::Context, true, true, true, true>` is not implemented for `u32`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u16, n16::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u32`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:89:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:96:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, true, true, true, true>` is not implemented for `V0i32`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i32`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:91:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:98:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i32, n32::Context, true, true, true, true>` is not implemented for `u64`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i32, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u64`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:97:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:104:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, true, true, true, true>` is not implemented for `V0u32`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u32`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:99:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:106:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u32, n32::Context, true, true, true, true>` is not implemented for `u64`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u32, n32::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u64`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:113:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:120:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, true, true, true, true>` is not implemented for `V0i64`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0i64`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:115:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:122:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i64, n64::Context, true, true, true, true>` is not implemented for `u128`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0i64, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u128`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:121:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:128:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, true, true, true, true>` is not implemented for `V0u64`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0u64`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:123:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:130:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u64, n64::Context, true, true, true, true>` is not implemented for `u128`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0u64, n64::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u128`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:137:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:144:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, true, true, true, true>` is not implemented for `V0isize`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0isize`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:139:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:146:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0isize, nsize::Context, true, true, true, true>` is not implemented for `[usize; 2]`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0isize, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[usize; 2]`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:145:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:152:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Smaller, Current, Context>();
|
||||
| ^^^^^^^ `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, true, true, true, true>` is not implemented for `V0usize`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `V0usize`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:147:44
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:154:44
|
||||
|
|
||||
LL | assert::is_transmutable::<Current, Larger, Context>();
|
||||
| ^^^^^^ `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0usize, nsize::Context, true, true, true, true>` is not implemented for `[usize; 2]`
|
||||
= help: the trait `BikeshedIntrinsicFrom<V0usize, nsize::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `[usize; 2]`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/primitive_reprs_should_have_correct_length.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to 20 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,98 +1,140 @@
|
|||
error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:21:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:28:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<void::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<void::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:22:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:29:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `void::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `void::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:27:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:34:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<singleton::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<singleton::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:28:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:35:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `singleton::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `singleton::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:33:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:40:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<duplex::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<duplex::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:34:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:41:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `duplex::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `duplex::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:14:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,17 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,16 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
|
||||
--> $DIR/should_pad_variants.rs:39:36
|
||||
--> $DIR/should_pad_variants.rs:44:36
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context>();
|
||||
| ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, true, true, true, true>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_pad_variants.rs:13:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,17 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_respect_endianness.rs:32:36
|
||||
--> $DIR/should_respect_endianness.rs:37:36
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Unexpected>();
|
||||
| ^^^^^^^^^^ `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, assert::Context, true, true, true, true>` is not implemented for `Unexpected`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Unexpected`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_respect_endianness.rs:15:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@
|
|||
//! provided.
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(adt_const_params)]
|
||||
#![feature(generic_const_exprs)]
|
||||
#![feature(transmutability)]
|
||||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<
|
||||
Src,
|
||||
|
|
@ -14,19 +16,34 @@ mod assert {
|
|||
Context,
|
||||
const ASSUME_ALIGNMENT: bool,
|
||||
const ASSUME_LIFETIMES: bool,
|
||||
const ASSUME_SAFETY: bool,
|
||||
const ASSUME_VALIDITY: bool,
|
||||
const ASSUME_VISIBILITY: bool,
|
||||
>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<
|
||||
Src,
|
||||
Context,
|
||||
ASSUME_ALIGNMENT,
|
||||
ASSUME_LIFETIMES,
|
||||
ASSUME_VALIDITY,
|
||||
ASSUME_VISIBILITY,
|
||||
{ from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
|
||||
//~^ ERROR E0080
|
||||
//~| ERROR E0080
|
||||
//~| ERROR E0080
|
||||
//~| ERROR E0080
|
||||
>,
|
||||
{}
|
||||
|
||||
const fn from_options(
|
||||
alignment: bool,
|
||||
lifetimes: bool,
|
||||
safety: bool,
|
||||
validity: bool,
|
||||
) -> Assume {
|
||||
Assume {
|
||||
alignment,
|
||||
lifetimes,
|
||||
safety,
|
||||
validity,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn test() {
|
||||
|
|
|
|||
|
|
@ -1,27 +1,52 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/wrong-type-assume.rs:36:51
|
||||
--> $DIR/wrong-type-assume.rs:53:51
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context, {0u8}, false, false, false>();
|
||||
| ^^^ expected `bool`, found `u8`
|
||||
|
||||
error[E0080]: evaluation of `assert::is_transmutable::<test::Src, test::Dst, test::Context, {0u8}, false, false, false>::{constant#0}` failed
|
||||
--> $DIR/wrong-type-assume.rs:26:15
|
||||
|
|
||||
LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/wrong-type-assume.rs:37:58
|
||||
--> $DIR/wrong-type-assume.rs:54:58
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context, false, {0u8}, false, false>();
|
||||
| ^^^ expected `bool`, found `u8`
|
||||
|
||||
error[E0080]: evaluation of `assert::is_transmutable::<test::Src, test::Dst, test::Context, false, {0u8}, false, false>::{constant#0}` failed
|
||||
--> $DIR/wrong-type-assume.rs:26:15
|
||||
|
|
||||
LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/wrong-type-assume.rs:38:65
|
||||
--> $DIR/wrong-type-assume.rs:55:65
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context, false, false, {0u8}, false>();
|
||||
| ^^^ expected `bool`, found `u8`
|
||||
|
||||
error[E0080]: evaluation of `assert::is_transmutable::<test::Src, test::Dst, test::Context, false, false, {0u8}, false>::{constant#0}` failed
|
||||
--> $DIR/wrong-type-assume.rs:26:15
|
||||
|
|
||||
LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/wrong-type-assume.rs:39:72
|
||||
--> $DIR/wrong-type-assume.rs:56:72
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context, false, false, false, {0u8}>();
|
||||
| ^^^ expected `bool`, found `u8`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error[E0080]: evaluation of `assert::is_transmutable::<test::Src, test::Dst, test::Context, false, false, false, {0u8}>::{constant#0}` failed
|
||||
--> $DIR/wrong-type-assume.rs:26:15
|
||||
|
|
||||
LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0080, E0308.
|
||||
For more information about an error, try `rustc --explain E0080`.
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
{}
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope
|
|||
LL | assert::is_transmutable::<u8, bool>();
|
||||
| ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, true>` is not implemented for `bool`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `bool`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/bool.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,11 +5,16 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
|
||||
--> $DIR/unit.rs:23:35
|
||||
--> $DIR/unit.rs:28:35
|
||||
|
|
||||
LL | assert::is_transmutable::<(), u8, Context>();
|
||||
| ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, true, true, true, true>` is not implemented for `u8`
|
||||
= help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/unit.rs:12:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,25 @@
|
|||
error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
|
||||
--> $DIR/references.rs:19:52
|
||||
--> $DIR/references.rs:26:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
|
||||
| ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, true, true, true, true>` is not implemented for `&'static Unit`
|
||||
= help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/references.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,194 +1,278 @@
|
|||
error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:21:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:28:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::unit::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::unit::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:22:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:29:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::unit::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::unit::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:27:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:34:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::tuple::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::tuple::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:28:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:35:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::tuple::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::tuple::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:33:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:40:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::braces::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::braces::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:34:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:41:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::braces::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::braces::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:39:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:46:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<aligned::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<aligned::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:40:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:47:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `aligned::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `aligned::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:45:52
|
||||
--> $DIR/should_require_well_defined_layout.rs:52:52
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<packed::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<packed::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:46:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:53:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `packed::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `packed::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:52:49
|
||||
--> $DIR/should_require_well_defined_layout.rs:59:49
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_c, ()>();
|
||||
| ^^ `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<nested::repr_c, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<nested::repr_c, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:53:47
|
||||
--> $DIR/should_require_well_defined_layout.rs:60:47
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_c>();
|
||||
| ^^^^^^ `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `nested::repr_c`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `nested::repr_c`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,17 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#![allow(incomplete_features)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,19 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume {
|
||||
alignment: true,
|
||||
lifetimes: true,
|
||||
safety: true,
|
||||
validity: true,
|
||||
}
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,48 @@
|
|||
error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:23:48
|
||||
--> $DIR/should_require_well_defined_layout.rs:30:48
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<repr_rust, ()>();
|
||||
| ^^ `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
|
||||
= help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::repr_rust, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_require_well_defined_layout.rs:24:43
|
||||
--> $DIR/should_require_well_defined_layout.rs:31:43
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<u128, repr_rust>();
|
||||
| ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::repr_rust`
|
||||
= help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `should_reject_repr_rust::repr_rust`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_require_well_defined_layout.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume {
|
||||
LL | | alignment: true,
|
||||
LL | | lifetimes: true,
|
||||
... |
|
||||
LL | | }
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,16 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
Assume::ALIGNMENT
|
||||
.and(Assume::LIFETIMES)
|
||||
.and(Assume::SAFETY)
|
||||
.and(Assume::VALIDITY)
|
||||
}>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
|
||||
--> $DIR/should_pad_variants.rs:39:36
|
||||
--> $DIR/should_pad_variants.rs:44:36
|
||||
|
|
||||
LL | assert::is_transmutable::<Src, Dst, Context>();
|
||||
| ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, true, true, true, true>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_pad_variants.rs:13:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
|
||||
| ______________^
|
||||
LL | | Assume::ALIGNMENT
|
||||
LL | | .and(Assume::LIFETIMES)
|
||||
LL | | .and(Assume::SAFETY)
|
||||
LL | | .and(Assume::VALIDITY)
|
||||
LL | | }>
|
||||
| |__________^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,13 +7,12 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
|
||||
// validity IS assumed --------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defini
|
|||
LL | assert::is_transmutable::<Superset, Subset>();
|
||||
| ^^^^^^ `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Superset, assert::Context, false, false, false, true>` is not implemented for `Subset`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Superset, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `Subset`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_contraction.rs:13:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,12 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
|
||||
// validity IS assumed --------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_reject_disjoint.rs:34:40
|
||||
--> $DIR/should_reject_disjoint.rs:33:40
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<A, B>();
|
||||
| ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<A, assert::Context, false, false, true, true>` is not implemented for `B`
|
||||
= help: the trait `BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: true }>` is not implemented for `B`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_reject_disjoint.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_reject_disjoint.rs:35:40
|
||||
--> $DIR/should_reject_disjoint.rs:34:40
|
||||
|
|
||||
LL | assert::is_maybe_transmutable::<B, A>();
|
||||
| ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<B, assert::Context, false, false, true, true>` is not implemented for `A`
|
||||
= help: the trait `BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: true }>` is not implemented for `A`
|
||||
note: required by a bound in `is_maybe_transmutable`
|
||||
--> $DIR/should_reject_disjoint.rs:13:14
|
||||
|
|
||||
LL | pub fn is_maybe_transmutable<Src, Dst>()
|
||||
| --------------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
#![allow(dead_code, incomplete_features, non_camel_case_types)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// validity is NOT assumed ----------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// validity is NOT assumed --------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of
|
|||
LL | assert::is_transmutable::<A, B>();
|
||||
| ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<A, assert::Context, false, false, false, true>` is not implemented for `B`
|
||||
= help: the trait `BikeshedIntrinsicFrom<A, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `B`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_intersecting.rs:14:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
|
||||
--> $DIR/should_reject_intersecting.rs:37:34
|
||||
|
|
@ -20,15 +20,15 @@ error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of
|
|||
LL | assert::is_transmutable::<B, A>();
|
||||
| ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<B, assert::Context, false, false, false, true>` is not implemented for `A`
|
||||
= help: the trait `BikeshedIntrinsicFrom<B, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `A`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_intersecting.rs:14:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// visibility IS assumed -------------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// visibility IS assumed -------------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// visibility IS assumed -------------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// visibility IS assumed -------------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
||||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
|
||||
// visibility IS assumed -------------------------------------^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
|
||||
// safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0446]: private type `src::Zst` in public interface
|
||||
--> $DIR/should_accept_if_src_has_unreachable_field.rs:23:9
|
||||
--> $DIR/should_accept_if_src_has_unreachable_field.rs:22:9
|
||||
|
|
||||
LL | #[repr(C)] pub(self) struct Zst; // <- unreachable type
|
||||
| -------------------- `src::Zst` declared as private
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0603]: struct `Src` is private
|
||||
--> $DIR/should_accept_if_src_has_unreachable_ty.rs:38:36
|
||||
--> $DIR/should_accept_if_src_has_unreachable_ty.rs:37:36
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^ private struct
|
||||
|
|
||||
note: the struct `Src` is defined here
|
||||
--> $DIR/should_accept_if_src_has_unreachable_ty.rs:23:16
|
||||
--> $DIR/should_accept_if_src_has_unreachable_ty.rs:22:16
|
||||
|
|
||||
LL | #[repr(C)] pub(self) struct Src {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
--> $DIR/should_reject_if_dst_has_private_field.rs:36:41
|
||||
--> $DIR/should_reject_if_dst_has_private_field.rs:35:41
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_if_dst_has_private_field.rs:13:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
--> $DIR/should_reject_if_dst_has_private_variant.rs:37:41
|
||||
--> $DIR/should_reject_if_dst_has_private_variant.rs:36:41
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_if_dst_has_private_variant.rs:13:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_field.rs:38:41
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_field.rs:37:41
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_field.rs:15:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ mod assert {
|
|||
|
||||
pub fn is_transmutable<Src, Dst, Context>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
// visibility is NOT assumed ---------------------------------^^^^^
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
{}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
error[E0603]: struct `Dst` is private
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:39:46
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:46
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^ private struct
|
||||
|
|
||||
note: the struct `Dst` is defined here
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:32:16
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:31:16
|
||||
|
|
||||
LL | #[repr(C)] pub(self) struct Dst {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:39:41
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:41
|
||||
|
|
||||
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
|
||||
| ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`.
|
||||
|
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
|
||||
= help: the trait `BikeshedIntrinsicFrom<Src, test::Context, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `Dst`
|
||||
note: required by a bound in `is_transmutable`
|
||||
--> $DIR/should_reject_if_dst_has_unreachable_ty.rs:15:14
|
||||
|
|
||||
LL | pub fn is_transmutable<Src, Dst, Context>()
|
||||
| --------------- required by a bound in this
|
||||
LL | where
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue