diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-29 20:50:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-29 20:50:03 +0100 |
| commit | 419f7aeed60c7f9204ec123ddf508206f37fc89d (patch) | |
| tree | 8622f8e1914a2bffaa50a25531da4e21603f9a42 /tests | |
| parent | 509972089b1365fefc6fe0512b3cc0f9d661adc5 (diff) | |
| parent | 23ab1bda92b127b18f32fe7593298842fd25e05b (diff) | |
| download | rust-419f7aeed60c7f9204ec123ddf508206f37fc89d.tar.gz rust-419f7aeed60c7f9204ec123ddf508206f37fc89d.zip | |
Rollup merge of #121681 - jswrenn:nix-visibility-analysis, r=compiler-errors
Safe Transmute: Revise safety analysis This PR migrates `BikeshedIntrinsicFrom` to a simplified safety analysis (described [here](https://github.com/rust-lang/project-safe-transmute/issues/15)) that does not rely on analyzing the visibility of types and fields. The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis. Notably, this PR removes the `Context` type parameter from `BikeshedIntrinsicFrom`. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter. r? `@compiler-errors`
Diffstat (limited to 'tests')
113 files changed, 1197 insertions, 1807 deletions
diff --git a/tests/ui/transmutability/abstraction/abstracted_assume.rs b/tests/ui/transmutability/abstraction/abstracted_assume.rs index 0e62dc632bf..897e1b4b50a 100644 --- a/tests/ui/transmutability/abstraction/abstracted_assume.rs +++ b/tests/ui/transmutability/abstraction/abstracted_assume.rs @@ -13,41 +13,27 @@ mod assert { pub fn is_transmutable< Src, Dst, - Context, const ASSUME: std::mem::Assume, >() where Dst: BikeshedIntrinsicFrom< Src, - Context, ASSUME, >, {} } fn direct() { - struct Context; - #[repr(C)] struct Src; - #[repr(C)] struct Dst; - - assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>(); + assert::is_transmutable::<(), (), { std::mem::Assume::NOTHING }>(); } fn via_const() { - struct Context; - #[repr(C)] struct Src; - #[repr(C)] struct Dst; - const FALSE: bool = false; - assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>(); + assert::is_transmutable::<(), (), { std::mem::Assume::NOTHING }>(); } fn via_associated_const() { - struct Context; - #[repr(C)] struct Src; - #[repr(C)] struct Dst; - trait Trait { const FALSE: bool = true; } @@ -57,9 +43,8 @@ fn via_associated_const() { impl Trait for Ty {} assert::is_transmutable::< - Src, - Dst, - Context, + (), + (), { std::mem::Assume { alignment: {Ty::FALSE}, diff --git a/tests/ui/transmutability/abstraction/const_generic_fn.rs b/tests/ui/transmutability/abstraction/const_generic_fn.rs index 076b7c8999b..0a5f0de0214 100644 --- a/tests/ui/transmutability/abstraction/const_generic_fn.rs +++ b/tests/ui/transmutability/abstraction/const_generic_fn.rs @@ -7,12 +7,11 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn array_like<T, E, const N: usize>() where - T: BikeshedIntrinsicFrom<[E; N], Context, { Assume::SAFETY }>, - [E; N]: BikeshedIntrinsicFrom<T, Context, { Assume::SAFETY }> + T: BikeshedIntrinsicFrom<[E; N], { Assume::SAFETY }>, + [E; N]: BikeshedIntrinsicFrom<T, { Assume::SAFETY }> {} } diff --git a/tests/ui/transmutability/alignment/align-fail.rs b/tests/ui/transmutability/alignment/align-fail.rs index 2bb6bfeeaae..d88f1285c11 100644 --- a/tests/ui/transmutability/alignment/align-fail.rs +++ b/tests/ui/transmutability/alignment/align-fail.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: false, lifetimes: true, diff --git a/tests/ui/transmutability/alignment/align-fail.stderr b/tests/ui/transmutability/alignment/align-fail.stderr index c68c1481f4d..c92c3d841f2 100644 --- a/tests/ui/transmutability/alignment/align-fail.stderr +++ b/tests/ui/transmutability/alignment/align-fail.stderr @@ -1,16 +1,16 @@ -error[E0277]: `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]` in the defining scope of `assert::Context` - --> $DIR/align-fail.rs:22:55 +error[E0277]: `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]` + --> $DIR/align-fail.rs:21:55 | LL | ...tatic [u8; 0], &'static [u16; 0]>(); | ^^^^^^^^^^^^^^^^^ The minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2) | note: required by a bound in `is_maybe_transmutable` - --> $DIR/align-fail.rs:10:14 + --> $DIR/align-fail.rs:9:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: false, diff --git a/tests/ui/transmutability/alignment/align-pass.rs b/tests/ui/transmutability/alignment/align-pass.rs index d97a55f730c..aecf7b02d62 100644 --- a/tests/ui/transmutability/alignment/align-pass.rs +++ b/tests/ui/transmutability/alignment/align-pass.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: false, lifetimes: false, diff --git a/tests/ui/transmute/issue-115402-overflow-size.rs b/tests/ui/transmutability/arrays/huge-len.rs index 91168041ed6..3fe254ebef4 100644 --- a/tests/ui/transmute/issue-115402-overflow-size.rs +++ b/tests/ui/transmutability/arrays/huge-len.rs @@ -2,11 +2,10 @@ #![feature(transmutability)] mod assert { use std::mem::BikeshedIntrinsicFrom; - struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context>, + Dst: BikeshedIntrinsicFrom<Src>, { } } diff --git a/tests/ui/transmute/issue-115402-overflow-size.stderr b/tests/ui/transmutability/arrays/huge-len.stderr index 08d180f6427..37160c5c959 100644 --- a/tests/ui/transmute/issue-115402-overflow-size.stderr +++ b/tests/ui/transmutability/arrays/huge-len.stderr @@ -1,32 +1,32 @@ -error[E0277]: `()` cannot be safely transmuted into `ExplicitlyPadded` in the defining scope of `assert::Context` - --> $DIR/issue-115402-overflow-size.rs:22:41 +error[E0277]: `()` cannot be safely transmuted into `ExplicitlyPadded` + --> $DIR/huge-len.rs:21:41 | LL | assert::is_maybe_transmutable::<(), ExplicitlyPadded>(); | ^^^^^^^^^^^^^^^^ values of the type `ExplicitlyPadded` are too big for the current architecture | note: required by a bound in `is_maybe_transmutable` - --> $DIR/issue-115402-overflow-size.rs:9:14 + --> $DIR/huge-len.rs:8:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` -error[E0277]: `ExplicitlyPadded` cannot be safely transmuted into `()` in the defining scope of `assert::Context` - --> $DIR/issue-115402-overflow-size.rs:25:55 +error[E0277]: `ExplicitlyPadded` cannot be safely transmuted into `()` + --> $DIR/huge-len.rs:24:55 | LL | assert::is_maybe_transmutable::<ExplicitlyPadded, ()>(); | ^^ values of the type `ExplicitlyPadded` are too big for the current architecture | note: required by a bound in `is_maybe_transmutable` - --> $DIR/issue-115402-overflow-size.rs:9:14 + --> $DIR/huge-len.rs:8:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` error: aborting due to 2 previous errors diff --git a/tests/ui/transmutability/arrays/issue-103783-array-length.rs b/tests/ui/transmutability/arrays/issue-103783-array-length.rs index cb36e539ed1..7fcbcc01075 100644 --- a/tests/ui/transmutability/arrays/issue-103783-array-length.rs +++ b/tests/ui/transmutability/arrays/issue-103783-array-length.rs @@ -4,13 +4,11 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where Dst: BikeshedIntrinsicFrom< Src, - Context, { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, >, { diff --git a/tests/ui/transmutability/arrays/issue-103783-array-length.stderr b/tests/ui/transmutability/arrays/issue-103783-array-length.stderr index 2c581664f39..02ac40741cb 100644 --- a/tests/ui/transmutability/arrays/issue-103783-array-length.stderr +++ b/tests/ui/transmutability/arrays/issue-103783-array-length.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-103783-array-length.rs:21:34 + --> $DIR/issue-103783-array-length.rs:19:34 | LL | type NaughtyLenArray = [u32; 3.14159]; | ^^^^^^^ expected `usize`, found floating-point number diff --git a/tests/ui/transmutability/arrays/should_have_correct_length.rs b/tests/ui/transmutability/arrays/should_have_correct_length.rs index 44a60360014..747897d49d7 100644 --- a/tests/ui/transmutability/arrays/should_have_correct_length.rs +++ b/tests/ui/transmutability/arrays/should_have_correct_length.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::VALIDITY) }> {} } diff --git a/tests/ui/transmutability/arrays/should_inherit_alignment.rs b/tests/ui/transmutability/arrays/should_inherit_alignment.rs index bb78cd82a34..d95c51e3361 100644 --- a/tests/ui/transmutability/arrays/should_inherit_alignment.rs +++ b/tests/ui/transmutability/arrays/should_inherit_alignment.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) diff --git a/tests/ui/transmutability/arrays/should_require_well_defined_layout.rs b/tests/ui/transmutability/arrays/should_require_well_defined_layout.rs index 853bd9cbc0f..5345b199f6e 100644 --- a/tests/ui/transmutability/arrays/should_require_well_defined_layout.rs +++ b/tests/ui/transmutability/arrays/should_require_well_defined_layout.rs @@ -6,11 +6,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) diff --git a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr index 1a0a5d3ae94..fd21ac34183 100644 --- a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr @@ -1,16 +1,16 @@ -error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context` - --> $DIR/should_require_well_defined_layout.rs:26:52 +error[E0277]: `[String; 0]` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:25:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `[String; 0]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) @@ -19,19 +19,19 @@ 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:27:47 +error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` + --> $DIR/should_require_well_defined_layout.rs:26:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `[String; 0]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) @@ -40,19 +40,19 @@ 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:32:52 +error[E0277]: `[String; 1]` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:31:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `[String; 1]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) @@ -61,19 +61,19 @@ 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:33:47 +error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` + --> $DIR/should_require_well_defined_layout.rs:32:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `[String; 1]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) @@ -82,19 +82,19 @@ 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:38:52 +error[E0277]: `[String; 2]` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:37:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `[String; 2]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) @@ -103,19 +103,19 @@ 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:39:47 +error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` + --> $DIR/should_require_well_defined_layout.rs:38:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `[String; 2]` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs index 940f070e7e3..d3d463e7929 100644 --- a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs +++ b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs @@ -7,9 +7,9 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, @@ -36,8 +36,6 @@ struct Zst; #[repr(usize)] enum V0usize { V } fn n8() { - struct Context; - type Smaller = Zst; type Analog = u8; type Larger = u16; @@ -45,23 +43,21 @@ fn n8() { fn i_should_have_correct_length() { type Current = V0i8; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } fn u_should_have_correct_length() { type Current = V0u8; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } } fn n16() { - struct Context; - type Smaller = u8; type Analog = u16; type Larger = u32; @@ -69,23 +65,21 @@ fn n16() { fn i_should_have_correct_length() { type Current = V0i16; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } fn u_should_have_correct_length() { type Current = V0u16; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } } fn n32() { - struct Context; - type Smaller = u16; type Analog = u32; type Larger = u64; @@ -93,23 +87,21 @@ fn n32() { fn i_should_have_correct_length() { type Current = V0i32; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } fn u_should_have_correct_length() { type Current = V0u32; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } } fn n64() { - struct Context; - type Smaller = u32; type Analog = u64; type Larger = u128; @@ -117,23 +109,21 @@ fn n64() { fn i_should_have_correct_length() { type Current = V0i64; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } fn u_should_have_correct_length() { type Current = V0u64; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } } fn nsize() { - struct Context; - type Smaller = u8; type Analog = usize; type Larger = [usize; 2]; @@ -141,16 +131,16 @@ fn nsize() { fn i_should_have_correct_length() { type Current = V0isize; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } fn u_should_have_correct_length() { type Current = V0usize; - assert::is_transmutable::<Smaller, Current, Context>(); //~ ERROR cannot be safely transmuted - assert::is_transmutable::<Current, Analog, Context>(); - assert::is_transmutable::<Current, Larger, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Smaller, Current>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Current, Analog>(); + assert::is_transmutable::<Current, Larger>(); //~ ERROR cannot be safely transmuted } } diff --git a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr index 46cdaa92563..b2ff04eeed9 100644 --- a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr +++ b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr @@ -1,16 +1,16 @@ -error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context` - --> $DIR/primitive_reprs_should_have_correct_length.rs:48:44 +error[E0277]: `Zst` cannot be safely transmuted into `V0i8` + --> $DIR/primitive_reprs_should_have_correct_length.rs:46:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `Zst` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -20,19 +20,19 @@ 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:50:44 +error[E0277]: `V0i8` cannot be safely transmuted into `u16` + --> $DIR/primitive_reprs_should_have_correct_length.rs:48:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0i8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -42,19 +42,19 @@ 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:56:44 +error[E0277]: `Zst` cannot be safely transmuted into `V0u8` + --> $DIR/primitive_reprs_should_have_correct_length.rs:54:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `Zst` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -64,19 +64,19 @@ 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:58:44 +error[E0277]: `V0u8` cannot be safely transmuted into `u16` + --> $DIR/primitive_reprs_should_have_correct_length.rs:56:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0u8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -86,19 +86,19 @@ 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:72:44 +error[E0277]: `u8` cannot be safely transmuted into `V0i16` + --> $DIR/primitive_reprs_should_have_correct_length.rs:68:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -108,19 +108,19 @@ 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:74:44 +error[E0277]: `V0i16` cannot be safely transmuted into `u32` + --> $DIR/primitive_reprs_should_have_correct_length.rs:70:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0i16` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -130,19 +130,19 @@ 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:80:44 +error[E0277]: `u8` cannot be safely transmuted into `V0u16` + --> $DIR/primitive_reprs_should_have_correct_length.rs:76:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -152,19 +152,19 @@ 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:82:44 +error[E0277]: `V0u16` cannot be safely transmuted into `u32` + --> $DIR/primitive_reprs_should_have_correct_length.rs:78:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0u16` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -174,19 +174,19 @@ 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:96:44 +error[E0277]: `u16` cannot be safely transmuted into `V0i32` + --> $DIR/primitive_reprs_should_have_correct_length.rs:90:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u16` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -196,19 +196,19 @@ 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:98:44 +error[E0277]: `V0i32` cannot be safely transmuted into `u64` + --> $DIR/primitive_reprs_should_have_correct_length.rs:92:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0i32` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -218,19 +218,19 @@ 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:104:44 +error[E0277]: `u16` cannot be safely transmuted into `V0u32` + --> $DIR/primitive_reprs_should_have_correct_length.rs:98:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u16` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -240,19 +240,19 @@ 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:106:44 +error[E0277]: `V0u32` cannot be safely transmuted into `u64` + --> $DIR/primitive_reprs_should_have_correct_length.rs:100:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0u32` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -262,19 +262,19 @@ 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:120:44 +error[E0277]: `u32` cannot be safely transmuted into `V0i64` + --> $DIR/primitive_reprs_should_have_correct_length.rs:112:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u32` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -284,19 +284,19 @@ 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:122:44 +error[E0277]: `V0i64` cannot be safely transmuted into `u128` + --> $DIR/primitive_reprs_should_have_correct_length.rs:114:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0i64` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -306,19 +306,19 @@ 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:128:44 +error[E0277]: `u32` cannot be safely transmuted into `V0u64` + --> $DIR/primitive_reprs_should_have_correct_length.rs:120:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u32` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -328,19 +328,19 @@ 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:130:44 +error[E0277]: `V0u64` cannot be safely transmuted into `u128` + --> $DIR/primitive_reprs_should_have_correct_length.rs:122:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0u64` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -350,19 +350,19 @@ 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:144:44 +error[E0277]: `u8` cannot be safely transmuted into `V0isize` + --> $DIR/primitive_reprs_should_have_correct_length.rs:134:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -372,19 +372,19 @@ 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:146:44 +error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` + --> $DIR/primitive_reprs_should_have_correct_length.rs:136:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0isize` is smaller than the size of `[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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -394,19 +394,19 @@ 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:152:44 +error[E0277]: `u8` cannot be safely transmuted into `V0usize` + --> $DIR/primitive_reprs_should_have_correct_length.rs:142:44 | -LL | assert::is_transmutable::<Smaller, Current, Context>(); +LL | assert::is_transmutable::<Smaller, Current>(); | ^^^^^^^ The size of `u8` is smaller than the size of `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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -416,19 +416,19 @@ 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:154:44 +error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` + --> $DIR/primitive_reprs_should_have_correct_length.rs:144:44 | -LL | assert::is_transmutable::<Current, Larger, Context>(); +LL | assert::is_transmutable::<Current, Larger>(); | ^^^^^^ The size of `V0usize` is smaller than the size of `[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>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.rs b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.rs index 102111ae291..630e662b926 100644 --- a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.rs +++ b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr index 1612b6b3661..24730935047 100644 --- a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr @@ -1,16 +1,16 @@ -error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context` - --> $DIR/should_require_well_defined_layout.rs:28:52 +error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:27:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `void::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -20,19 +20,19 @@ 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:29:47 +error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:28:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `void::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -42,19 +42,19 @@ 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:34:52 +error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:33:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `singleton::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -64,19 +64,19 @@ 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:35:47 +error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:34:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `singleton::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -86,19 +86,19 @@ 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:40:52 +error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:39:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `duplex::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -108,19 +108,19 @@ 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:41:47 +error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:40:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `duplex::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:14:14 + --> $DIR/should_require_well_defined_layout.rs:13:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/enums/should_order_correctly.rs b/tests/ui/transmutability/enums/should_order_correctly.rs index 6146e37e54e..d51a033f1a6 100644 --- a/tests/ui/transmutability/enums/should_order_correctly.rs +++ b/tests/ui/transmutability/enums/should_order_correctly.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) diff --git a/tests/ui/transmutability/enums/should_pad_variants.rs b/tests/ui/transmutability/enums/should_pad_variants.rs index c077c52a36a..81ef9e8a567 100644 --- a/tests/ui/transmutability/enums/should_pad_variants.rs +++ b/tests/ui/transmutability/enums/should_pad_variants.rs @@ -8,9 +8,9 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) @@ -38,8 +38,7 @@ enum Lopsided { #[repr(C)] struct Dst(Lopsided, V2); fn should_pad_variants() { - struct Context; // If the implementation (incorrectly) fails to pad `Lopsided::Smol` with // an uninitialized byte, this transmutation might be (wrongly) accepted: - assert::is_transmutable::<Src, Dst, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted } diff --git a/tests/ui/transmutability/enums/should_pad_variants.stderr b/tests/ui/transmutability/enums/should_pad_variants.stderr index fd98e355fb9..13b4c8053ad 100644 --- a/tests/ui/transmutability/enums/should_pad_variants.stderr +++ b/tests/ui/transmutability/enums/should_pad_variants.stderr @@ -1,16 +1,16 @@ -error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context` - --> $DIR/should_pad_variants.rs:44:36 +error[E0277]: `Src` cannot be safely transmuted into `Dst` + --> $DIR/should_pad_variants.rs:43:36 | -LL | assert::is_transmutable::<Src, Dst, Context>(); +LL | assert::is_transmutable::<Src, Dst>(); | ^^^ The size of `Src` is smaller than the size of `Dst` | note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 | -LL | pub fn is_transmutable<Src, Dst, Context>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/enums/should_respect_endianness.rs b/tests/ui/transmutability/enums/should_respect_endianness.rs index f3567b405f4..8e52274710a 100644 --- a/tests/ui/transmutability/enums/should_respect_endianness.rs +++ b/tests/ui/transmutability/enums/should_respect_endianness.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) diff --git a/tests/ui/transmutability/enums/should_respect_endianness.stderr b/tests/ui/transmutability/enums/should_respect_endianness.stderr index 8823f40e534..c2a2eb53458 100644 --- a/tests/ui/transmutability/enums/should_respect_endianness.stderr +++ b/tests/ui/transmutability/enums/should_respect_endianness.stderr @@ -1,16 +1,16 @@ -error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context` - --> $DIR/should_respect_endianness.rs:36:36 +error[E0277]: `Src` cannot be safely transmuted into `Unexpected` + --> $DIR/should_respect_endianness.rs:35:36 | LL | assert::is_transmutable::<Src, Unexpected>(); | ^^^^^^^^^^ At least one value of `Src` isn't a bit-valid value of `Unexpected` | note: required by a bound in `is_transmutable` - --> $DIR/should_respect_endianness.rs:14:14 + --> $DIR/should_respect_endianness.rs:13:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/issue-101739-1.rs b/tests/ui/transmutability/issue-101739-1.rs index f2c2a471f72..0695d7d409f 100644 --- a/tests/ui/transmutability/issue-101739-1.rs +++ b/tests/ui/transmutability/issue-101739-1.rs @@ -3,9 +3,9 @@ mod assert { use std::mem::BikeshedIntrinsicFrom; - pub fn is_transmutable<Src, Context, const ASSUME_ALIGNMENT: bool>() + pub fn is_transmutable<Src, const ASSUME_ALIGNMENT: bool>() where - Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope + Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope //~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume` //~| ERROR: mismatched types { @@ -13,10 +13,9 @@ mod assert { } fn via_const() { - struct Context; struct Src; - assert::is_transmutable::<Src, Context, false>(); + assert::is_transmutable::<Src, false>(); } fn main() {} diff --git a/tests/ui/transmutability/issue-101739-1.stderr b/tests/ui/transmutability/issue-101739-1.stderr index e87693f247d..1df7c3e2f97 100644 --- a/tests/ui/transmutability/issue-101739-1.stderr +++ b/tests/ui/transmutability/issue-101739-1.stderr @@ -1,23 +1,23 @@ error[E0412]: cannot find type `Dst` in this scope --> $DIR/issue-101739-1.rs:8:9 | -LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, +LL | Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, | ^^^ not found in this scope error: the constant `ASSUME_ALIGNMENT` is not of type `Assume` --> $DIR/issue-101739-1.rs:8:14 | -LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` +LL | Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` | note: required by a bound in `BikeshedIntrinsicFrom` --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL error[E0308]: mismatched types - --> $DIR/issue-101739-1.rs:8:50 + --> $DIR/issue-101739-1.rs:8:41 | -LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, - | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` +LL | Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, + | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` error: aborting due to 3 previous errors diff --git a/tests/ui/transmutability/issue-101739-2.rs b/tests/ui/transmutability/issue-101739-2.rs index 8d670ec17ca..e2cec24aac1 100644 --- a/tests/ui/transmutability/issue-101739-2.rs +++ b/tests/ui/transmutability/issue-101739-2.rs @@ -8,17 +8,15 @@ mod assert { pub fn is_transmutable< Src, Dst, - Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, const ASSUME_VALIDITY: bool, const ASSUME_VISIBILITY: bool, >() where - Dst: BikeshedIntrinsicFrom< //~ ERROR trait takes at most 3 generic arguments but 6 generic arguments were supplied + Dst: BikeshedIntrinsicFrom< //~ ERROR trait takes at most 2 generic arguments but 5 generic arguments were supplied //~^ ERROR: the constant `ASSUME_ALIGNMENT` is not of type `Assume` Src, - Context, ASSUME_ALIGNMENT, //~ ERROR: mismatched types ASSUME_LIFETIMES, ASSUME_VALIDITY, @@ -28,11 +26,10 @@ mod assert { } fn via_const() { - struct Context; #[repr(C)] struct Src; #[repr(C)] struct Dst; const FALSE: bool = false; - assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>(); + assert::is_transmutable::<Src, Dst, FALSE, FALSE, FALSE, FALSE>(); } diff --git a/tests/ui/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr index adbb5ff5aff..639b4460892 100644 --- a/tests/ui/transmutability/issue-101739-2.stderr +++ b/tests/ui/transmutability/issue-101739-2.stderr @@ -1,8 +1,8 @@ -error[E0107]: trait takes at most 3 generic arguments but 6 generic arguments were supplied - --> $DIR/issue-101739-2.rs:18:14 +error[E0107]: trait takes at most 2 generic arguments but 5 generic arguments were supplied + --> $DIR/issue-101739-2.rs:17:14 | LL | Dst: BikeshedIntrinsicFrom< - | ^^^^^^^^^^^^^^^^^^^^^ expected at most 3 generic arguments + | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments ... LL | / ASSUME_LIFETIMES, LL | | ASSUME_VALIDITY, @@ -10,13 +10,13 @@ LL | | ASSUME_VISIBILITY, | |_____________________________- help: remove these generic arguments error: the constant `ASSUME_ALIGNMENT` is not of type `Assume` - --> $DIR/issue-101739-2.rs:18:14 + --> $DIR/issue-101739-2.rs:17:14 | LL | Dst: BikeshedIntrinsicFrom< | ______________^ LL | | LL | | Src, -LL | | Context, +LL | | ASSUME_ALIGNMENT, ... | LL | | ASSUME_VISIBILITY, LL | | >, @@ -26,7 +26,7 @@ note: required by a bound in `BikeshedIntrinsicFrom` --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL error[E0308]: mismatched types - --> $DIR/issue-101739-2.rs:22:13 + --> $DIR/issue-101739-2.rs:20:13 | LL | ASSUME_ALIGNMENT, | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` diff --git a/tests/ui/transmutability/issue-110467.rs b/tests/ui/transmutability/issue-110467.rs index 6485ed8aab7..1f9e521c24b 100644 --- a/tests/ui/transmutability/issue-110467.rs +++ b/tests/ui/transmutability/issue-110467.rs @@ -2,11 +2,10 @@ #![crate_type = "lib"] #![feature(transmutability)] use std::mem::BikeshedIntrinsicFrom; -pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context>, + Dst: BikeshedIntrinsicFrom<Src>, { } diff --git a/tests/ui/transmutability/issue-110892.rs b/tests/ui/transmutability/issue-110892.rs index 1baf117518b..9713684c959 100644 --- a/tests/ui/transmutability/issue-110892.rs +++ b/tests/ui/transmutability/issue-110892.rs @@ -8,7 +8,6 @@ mod assert { pub fn is_transmutable< Src, Dst, - Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, const ASSUME_SAFETY: bool, @@ -17,7 +16,6 @@ mod assert { where Dst: BikeshedIntrinsicFrom< Src, - Context, { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } >, {} @@ -32,9 +30,8 @@ mod assert { } fn main() { - struct Context; #[repr(C)] struct Src; #[repr(C)] struct Dst; - assert::is_transmutable::<Src, Dst, Context, false, false, { true }, false>(); + assert::is_transmutable::<Src, Dst, false, false, { true }, false>(); } diff --git a/tests/ui/transmutability/issue-110892.stderr b/tests/ui/transmutability/issue-110892.stderr index 13654307aee..b5d1e7084a0 100644 --- a/tests/ui/transmutability/issue-110892.stderr +++ b/tests/ui/transmutability/issue-110892.stderr @@ -1,29 +1,29 @@ error: expected parameter name, found `,` - --> $DIR/issue-110892.rs:27:9 + --> $DIR/issue-110892.rs:25:9 | LL | , | ^ expected parameter name error: expected parameter name, found `,` - --> $DIR/issue-110892.rs:28:9 + --> $DIR/issue-110892.rs:26:9 | LL | , | ^ expected parameter name error: expected parameter name, found `,` - --> $DIR/issue-110892.rs:29:9 + --> $DIR/issue-110892.rs:27:9 | LL | , | ^ expected parameter name error: expected parameter name, found `,` - --> $DIR/issue-110892.rs:30:9 + --> $DIR/issue-110892.rs:28:9 | LL | , | ^ expected parameter name error[E0308]: mismatched types - --> $DIR/issue-110892.rs:31:10 + --> $DIR/issue-110892.rs:29:10 | LL | const fn from_options( | ------------ implicitly returns `()` as its body has no tail or `return` expression diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs b/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs index b3a1e13b85b..bcfbc1430a8 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs @@ -6,16 +6,14 @@ mod assert { use std::mem::BikeshedIntrinsicFrom; - pub struct Context; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context> + Dst: BikeshedIntrinsicFrom<Src> {} } fn should_gracefully_handle_unknown_dst() { - struct Context; struct Src; - assert::is_transmutable::<Src, Dst, Context>(); //~ cannot find type + assert::is_transmutable::<Src, Dst>(); //~ cannot find type } diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.stderr b/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.stderr index 10e057ec104..9fa376bf433 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.stderr +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_dst.stderr @@ -1,7 +1,7 @@ error[E0412]: cannot find type `Dst` in this scope - --> $DIR/unknown_dst.rs:20:36 + --> $DIR/unknown_dst.rs:18:36 | -LL | assert::is_transmutable::<Src, Dst, Context>(); +LL | assert::is_transmutable::<Src, Dst>(); | ^^^ not found in this scope | help: you might be missing a type parameter diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.rs b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.rs index 092b205b770..bd7c3fc7fb5 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.rs +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.rs @@ -6,16 +6,14 @@ mod assert { use std::mem::BikeshedIntrinsicFrom; - pub struct Context; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context> + Dst: BikeshedIntrinsicFrom<Src> {} } fn should_gracefully_handle_unknown_src() { - struct Context; #[repr(C)] struct Dst; - assert::is_transmutable::<Src, Dst, Context>(); //~ cannot find type + assert::is_transmutable::<Src, Dst>(); //~ cannot find type } diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.stderr b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.stderr index a84d2726fa9..f2c7d9e1bcc 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.stderr +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src.stderr @@ -1,7 +1,7 @@ error[E0412]: cannot find type `Src` in this scope - --> $DIR/unknown_src.rs:20:31 + --> $DIR/unknown_src.rs:18:31 | -LL | assert::is_transmutable::<Src, Dst, Context>(); +LL | assert::is_transmutable::<Src, Dst>(); | ^^^ not found in this scope | help: you might be missing a type parameter diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs index 8d19cabc0f9..58c16d773e1 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs @@ -6,17 +6,15 @@ mod assert { use std::mem::BikeshedIntrinsicFrom; - pub struct Context; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context> + Dst: BikeshedIntrinsicFrom<Src> {} } fn should_gracefully_handle_unknown_dst_field() { - struct Context; #[repr(C)] struct Src; #[repr(C)] struct Dst(Missing); //~ cannot find type - assert::is_transmutable::<Src, Dst, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted } diff --git a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr index c2df398b8ff..eeed8a62a2a 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr +++ b/tests/ui/transmutability/malformed-program-gracefulness/unknown_src_field.stderr @@ -1,23 +1,23 @@ error[E0412]: cannot find type `Missing` in this scope - --> $DIR/unknown_src_field.rs:20:27 + --> $DIR/unknown_src_field.rs:18:27 | LL | #[repr(C)] struct Dst(Missing); | ^^^^^^^ not found in this scope -error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_gracefully_handle_unknown_dst_field::Context` - --> $DIR/unknown_src_field.rs:21:36 +error[E0277]: `Src` cannot be safely transmuted into `Dst` + --> $DIR/unknown_src_field.rs:19:36 | -LL | assert::is_transmutable::<Src, Dst, Context>(); +LL | assert::is_transmutable::<Src, Dst>(); | ^^^ `Dst` has an unknown layout | note: required by a bound in `is_transmutable` - --> $DIR/unknown_src_field.rs:13:14 + --> $DIR/unknown_src_field.rs:12:14 | -LL | pub fn is_transmutable<Src, Dst, Context>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 2 previous errors diff --git a/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs b/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs index 52aa4bb3101..608366fa089 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs +++ b/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs @@ -13,7 +13,6 @@ mod assert { pub fn is_transmutable< Src, Dst, - Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, const ASSUME_SAFETY: bool, @@ -22,7 +21,6 @@ mod assert { where Dst: BikeshedIntrinsicFrom< Src, - Context, { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } >, {} @@ -43,11 +41,10 @@ mod assert { } fn test() { - struct Context; #[repr(C)] struct Src; #[repr(C)] struct Dst; - assert::is_transmutable::<Src, Dst, Context, {0u8}, false, false, false>(); //~ ERROR mismatched types - assert::is_transmutable::<Src, Dst, Context, false, {0u8}, false, false>(); //~ ERROR mismatched types - assert::is_transmutable::<Src, Dst, Context, false, false, {0u8}, false>(); //~ ERROR mismatched types - assert::is_transmutable::<Src, Dst, Context, false, false, false, {0u8}>(); //~ ERROR mismatched types + assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>(); //~ ERROR mismatched types + assert::is_transmutable::<Src, Dst, false, {0u8}, false, false>(); //~ ERROR mismatched types + assert::is_transmutable::<Src, Dst, false, false, {0u8}, false>(); //~ ERROR mismatched types + assert::is_transmutable::<Src, Dst, false, false, false, {0u8}>(); //~ ERROR mismatched types } diff --git a/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr b/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr index c6d93876cfa..c6d37c24325 100644 --- a/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr +++ b/tests/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr @@ -1,26 +1,26 @@ error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:49:51 + --> $DIR/wrong-type-assume.rs:46:42 | -LL | assert::is_transmutable::<Src, Dst, Context, {0u8}, false, false, false>(); - | ^^^ expected `bool`, found `u8` +LL | assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>(); + | ^^^ expected `bool`, found `u8` error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:50:58 + --> $DIR/wrong-type-assume.rs:47:49 | -LL | assert::is_transmutable::<Src, Dst, Context, false, {0u8}, false, false>(); - | ^^^ expected `bool`, found `u8` +LL | assert::is_transmutable::<Src, Dst, false, {0u8}, false, false>(); + | ^^^ expected `bool`, found `u8` error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:51:65 + --> $DIR/wrong-type-assume.rs:48:56 | -LL | assert::is_transmutable::<Src, Dst, Context, false, false, {0u8}, false>(); - | ^^^ expected `bool`, found `u8` +LL | assert::is_transmutable::<Src, Dst, false, false, {0u8}, false>(); + | ^^^ expected `bool`, found `u8` error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:52:72 + --> $DIR/wrong-type-assume.rs:49:63 | -LL | assert::is_transmutable::<Src, Dst, Context, false, false, false, {0u8}>(); - | ^^^ expected `bool`, found `u8` +LL | assert::is_transmutable::<Src, Dst, false, false, false, {0u8}>(); + | ^^^ expected `bool`, found `u8` error: aborting due to 4 previous errors diff --git a/tests/ui/transmutability/primitives/bool-mut.rs b/tests/ui/transmutability/primitives/bool-mut.rs index 0a74aba8f63..5f3f4f3a8c5 100644 --- a/tests/ui/transmutability/primitives/bool-mut.rs +++ b/tests/ui/transmutability/primitives/bool-mut.rs @@ -4,11 +4,10 @@ #![feature(transmutability)] mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> {} } diff --git a/tests/ui/transmutability/primitives/bool-mut.stderr b/tests/ui/transmutability/primitives/bool-mut.stderr index 62a7a2b8622..c4f295fc70a 100644 --- a/tests/ui/transmutability/primitives/bool-mut.stderr +++ b/tests/ui/transmutability/primitives/bool-mut.stderr @@ -1,17 +1,17 @@ -error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context` - --> $DIR/bool-mut.rs:16:50 +error[E0277]: `u8` cannot be safely transmuted into `bool` + --> $DIR/bool-mut.rs:15:50 | LL | assert::is_transmutable::<&'static mut bool, &'static mut u8>() | ^^^^^^^^^^^^^^^ At least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` - --> $DIR/bool-mut.rs:11:14 + --> $DIR/bool-mut.rs:10:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 1 previous error diff --git a/tests/ui/transmutability/primitives/bool.current.stderr b/tests/ui/transmutability/primitives/bool.current.stderr index 6dfd83dd514..d6376342c9c 100644 --- a/tests/ui/transmutability/primitives/bool.current.stderr +++ b/tests/ui/transmutability/primitives/bool.current.stderr @@ -1,17 +1,17 @@ -error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context` - --> $DIR/bool.rs:21:35 +error[E0277]: `u8` cannot be safely transmuted into `bool` + --> $DIR/bool.rs:20:35 | LL | assert::is_transmutable::<u8, bool>(); | ^^^^ At least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` - --> $DIR/bool.rs:11:14 + --> $DIR/bool.rs:10:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 1 previous error diff --git a/tests/ui/transmutability/primitives/bool.next.stderr b/tests/ui/transmutability/primitives/bool.next.stderr index 6dfd83dd514..d6376342c9c 100644 --- a/tests/ui/transmutability/primitives/bool.next.stderr +++ b/tests/ui/transmutability/primitives/bool.next.stderr @@ -1,17 +1,17 @@ -error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context` - --> $DIR/bool.rs:21:35 +error[E0277]: `u8` cannot be safely transmuted into `bool` + --> $DIR/bool.rs:20:35 | LL | assert::is_transmutable::<u8, bool>(); | ^^^^ At least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` - --> $DIR/bool.rs:11:14 + --> $DIR/bool.rs:10:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 1 previous error diff --git a/tests/ui/transmutability/primitives/bool.rs b/tests/ui/transmutability/primitives/bool.rs index b7dc309e469..1be3b28b643 100644 --- a/tests/ui/transmutability/primitives/bool.rs +++ b/tests/ui/transmutability/primitives/bool.rs @@ -4,16 +4,15 @@ #![feature(transmutability)] mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> {} pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::VALIDITY) }> {} } diff --git a/tests/ui/transmutability/primitives/numbers.current.stderr b/tests/ui/transmutability/primitives/numbers.current.stderr index d12e172971c..7a80e444149 100644 --- a/tests/ui/transmutability/primitives/numbers.current.stderr +++ b/tests/ui/transmutability/primitives/numbers.current.stderr @@ -1,857 +1,857 @@ -error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:65:40 +error[E0277]: `i8` cannot be safely transmuted into `i16` + --> $DIR/numbers.rs:64:40 | LL | assert::is_transmutable::< i8, i16>(); | ^^^ The size of `i8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:66:40 +error[E0277]: `i8` cannot be safely transmuted into `u16` + --> $DIR/numbers.rs:65:40 | LL | assert::is_transmutable::< i8, u16>(); | ^^^ The size of `i8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:67:40 +error[E0277]: `i8` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:66:40 | LL | assert::is_transmutable::< i8, i32>(); | ^^^ The size of `i8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:68:40 +error[E0277]: `i8` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:67:40 | LL | assert::is_transmutable::< i8, f32>(); | ^^^ The size of `i8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:69:40 +error[E0277]: `i8` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:68:40 | LL | assert::is_transmutable::< i8, u32>(); | ^^^ The size of `i8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:70:40 +error[E0277]: `i8` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:69:40 | LL | assert::is_transmutable::< i8, u64>(); | ^^^ The size of `i8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:71:40 +error[E0277]: `i8` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:70:40 | LL | assert::is_transmutable::< i8, i64>(); | ^^^ The size of `i8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:72:40 +error[E0277]: `i8` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:71:40 | LL | assert::is_transmutable::< i8, f64>(); | ^^^ The size of `i8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:73:39 +error[E0277]: `i8` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:72:39 | LL | assert::is_transmutable::< i8, u128>(); | ^^^^ The size of `i8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:74:39 +error[E0277]: `i8` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:73:39 | LL | assert::is_transmutable::< i8, i128>(); | ^^^^ The size of `i8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:76:40 +error[E0277]: `u8` cannot be safely transmuted into `i16` + --> $DIR/numbers.rs:75:40 | LL | assert::is_transmutable::< u8, i16>(); | ^^^ The size of `u8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:77:40 +error[E0277]: `u8` cannot be safely transmuted into `u16` + --> $DIR/numbers.rs:76:40 | LL | assert::is_transmutable::< u8, u16>(); | ^^^ The size of `u8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:78:40 +error[E0277]: `u8` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:77:40 | LL | assert::is_transmutable::< u8, i32>(); | ^^^ The size of `u8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:79:40 +error[E0277]: `u8` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:78:40 | LL | assert::is_transmutable::< u8, f32>(); | ^^^ The size of `u8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:80:40 +error[E0277]: `u8` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:79:40 | LL | assert::is_transmutable::< u8, u32>(); | ^^^ The size of `u8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:81:40 +error[E0277]: `u8` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:80:40 | LL | assert::is_transmutable::< u8, u64>(); | ^^^ The size of `u8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:82:40 +error[E0277]: `u8` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:81:40 | LL | assert::is_transmutable::< u8, i64>(); | ^^^ The size of `u8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:83:40 +error[E0277]: `u8` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:82:40 | LL | assert::is_transmutable::< u8, f64>(); | ^^^ The size of `u8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:84:39 +error[E0277]: `u8` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:83:39 | LL | assert::is_transmutable::< u8, u128>(); | ^^^^ The size of `u8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:85:39 +error[E0277]: `u8` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:84:39 | LL | assert::is_transmutable::< u8, i128>(); | ^^^^ The size of `u8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:87:40 +error[E0277]: `i16` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:86:40 | LL | assert::is_transmutable::< i16, i32>(); | ^^^ The size of `i16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:88:40 +error[E0277]: `i16` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:87:40 | LL | assert::is_transmutable::< i16, f32>(); | ^^^ The size of `i16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:89:40 +error[E0277]: `i16` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:88:40 | LL | assert::is_transmutable::< i16, u32>(); | ^^^ The size of `i16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:90:40 +error[E0277]: `i16` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:89:40 | LL | assert::is_transmutable::< i16, u64>(); | ^^^ The size of `i16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:91:40 +error[E0277]: `i16` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:90:40 | LL | assert::is_transmutable::< i16, i64>(); | ^^^ The size of `i16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:92:40 +error[E0277]: `i16` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:91:40 | LL | assert::is_transmutable::< i16, f64>(); | ^^^ The size of `i16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:93:39 +error[E0277]: `i16` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:92:39 | LL | assert::is_transmutable::< i16, u128>(); | ^^^^ The size of `i16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:94:39 +error[E0277]: `i16` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:93:39 | LL | assert::is_transmutable::< i16, i128>(); | ^^^^ The size of `i16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:96:40 +error[E0277]: `u16` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:95:40 | LL | assert::is_transmutable::< u16, i32>(); | ^^^ The size of `u16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:97:40 +error[E0277]: `u16` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:96:40 | LL | assert::is_transmutable::< u16, f32>(); | ^^^ The size of `u16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:98:40 +error[E0277]: `u16` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:97:40 | LL | assert::is_transmutable::< u16, u32>(); | ^^^ The size of `u16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:99:40 +error[E0277]: `u16` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:98:40 | LL | assert::is_transmutable::< u16, u64>(); | ^^^ The size of `u16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:100:40 +error[E0277]: `u16` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:99:40 | LL | assert::is_transmutable::< u16, i64>(); | ^^^ The size of `u16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:101:40 +error[E0277]: `u16` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:100:40 | LL | assert::is_transmutable::< u16, f64>(); | ^^^ The size of `u16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:102:39 +error[E0277]: `u16` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:101:39 | LL | assert::is_transmutable::< u16, u128>(); | ^^^^ The size of `u16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:103:39 +error[E0277]: `u16` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:102:39 | LL | assert::is_transmutable::< u16, i128>(); | ^^^^ The size of `u16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:105:40 +error[E0277]: `i32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:104:40 | LL | assert::is_transmutable::< i32, u64>(); | ^^^ The size of `i32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:106:40 +error[E0277]: `i32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:105:40 | LL | assert::is_transmutable::< i32, i64>(); | ^^^ The size of `i32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:107:40 +error[E0277]: `i32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:106:40 | LL | assert::is_transmutable::< i32, f64>(); | ^^^ The size of `i32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:108:39 +error[E0277]: `i32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:107:39 | LL | assert::is_transmutable::< i32, u128>(); | ^^^^ The size of `i32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:109:39 +error[E0277]: `i32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:108:39 | LL | assert::is_transmutable::< i32, i128>(); | ^^^^ The size of `i32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:111:40 +error[E0277]: `f32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:110:40 | LL | assert::is_transmutable::< f32, u64>(); | ^^^ The size of `f32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:112:40 +error[E0277]: `f32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:111:40 | LL | assert::is_transmutable::< f32, i64>(); | ^^^ The size of `f32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:113:40 +error[E0277]: `f32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:112:40 | LL | assert::is_transmutable::< f32, f64>(); | ^^^ The size of `f32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:114:39 +error[E0277]: `f32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:113:39 | LL | assert::is_transmutable::< f32, u128>(); | ^^^^ The size of `f32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:115:39 +error[E0277]: `f32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:114:39 | LL | assert::is_transmutable::< f32, i128>(); | ^^^^ The size of `f32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:117:40 +error[E0277]: `u32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:116:40 | LL | assert::is_transmutable::< u32, u64>(); | ^^^ The size of `u32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:118:40 +error[E0277]: `u32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:117:40 | LL | assert::is_transmutable::< u32, i64>(); | ^^^ The size of `u32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:119:40 +error[E0277]: `u32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:118:40 | LL | assert::is_transmutable::< u32, f64>(); | ^^^ The size of `u32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:120:39 +error[E0277]: `u32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:119:39 | LL | assert::is_transmutable::< u32, u128>(); | ^^^^ The size of `u32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:121:39 +error[E0277]: `u32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:120:39 | LL | assert::is_transmutable::< u32, i128>(); | ^^^^ The size of `u32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:123:39 +error[E0277]: `u64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:122:39 | LL | assert::is_transmutable::< u64, u128>(); | ^^^^ The size of `u64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:124:39 +error[E0277]: `u64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:123:39 | LL | assert::is_transmutable::< u64, i128>(); | ^^^^ The size of `u64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:126:39 +error[E0277]: `i64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:125:39 | LL | assert::is_transmutable::< i64, u128>(); | ^^^^ The size of `i64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:127:39 +error[E0277]: `i64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:126:39 | LL | assert::is_transmutable::< i64, i128>(); | ^^^^ The size of `i64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:129:39 +error[E0277]: `f64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:128:39 | LL | assert::is_transmutable::< f64, u128>(); | ^^^^ The size of `f64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:130:39 +error[E0277]: `f64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:129:39 | LL | assert::is_transmutable::< f64, i128>(); | ^^^^ The size of `f64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 57 previous errors diff --git a/tests/ui/transmutability/primitives/numbers.next.stderr b/tests/ui/transmutability/primitives/numbers.next.stderr index d12e172971c..7a80e444149 100644 --- a/tests/ui/transmutability/primitives/numbers.next.stderr +++ b/tests/ui/transmutability/primitives/numbers.next.stderr @@ -1,857 +1,857 @@ -error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:65:40 +error[E0277]: `i8` cannot be safely transmuted into `i16` + --> $DIR/numbers.rs:64:40 | LL | assert::is_transmutable::< i8, i16>(); | ^^^ The size of `i8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:66:40 +error[E0277]: `i8` cannot be safely transmuted into `u16` + --> $DIR/numbers.rs:65:40 | LL | assert::is_transmutable::< i8, u16>(); | ^^^ The size of `i8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:67:40 +error[E0277]: `i8` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:66:40 | LL | assert::is_transmutable::< i8, i32>(); | ^^^ The size of `i8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:68:40 +error[E0277]: `i8` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:67:40 | LL | assert::is_transmutable::< i8, f32>(); | ^^^ The size of `i8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:69:40 +error[E0277]: `i8` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:68:40 | LL | assert::is_transmutable::< i8, u32>(); | ^^^ The size of `i8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:70:40 +error[E0277]: `i8` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:69:40 | LL | assert::is_transmutable::< i8, u64>(); | ^^^ The size of `i8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:71:40 +error[E0277]: `i8` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:70:40 | LL | assert::is_transmutable::< i8, i64>(); | ^^^ The size of `i8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:72:40 +error[E0277]: `i8` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:71:40 | LL | assert::is_transmutable::< i8, f64>(); | ^^^ The size of `i8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:73:39 +error[E0277]: `i8` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:72:39 | LL | assert::is_transmutable::< i8, u128>(); | ^^^^ The size of `i8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:74:39 +error[E0277]: `i8` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:73:39 | LL | assert::is_transmutable::< i8, i128>(); | ^^^^ The size of `i8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:76:40 +error[E0277]: `u8` cannot be safely transmuted into `i16` + --> $DIR/numbers.rs:75:40 | LL | assert::is_transmutable::< u8, i16>(); | ^^^ The size of `u8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:77:40 +error[E0277]: `u8` cannot be safely transmuted into `u16` + --> $DIR/numbers.rs:76:40 | LL | assert::is_transmutable::< u8, u16>(); | ^^^ The size of `u8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:78:40 +error[E0277]: `u8` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:77:40 | LL | assert::is_transmutable::< u8, i32>(); | ^^^ The size of `u8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:79:40 +error[E0277]: `u8` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:78:40 | LL | assert::is_transmutable::< u8, f32>(); | ^^^ The size of `u8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:80:40 +error[E0277]: `u8` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:79:40 | LL | assert::is_transmutable::< u8, u32>(); | ^^^ The size of `u8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:81:40 +error[E0277]: `u8` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:80:40 | LL | assert::is_transmutable::< u8, u64>(); | ^^^ The size of `u8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:82:40 +error[E0277]: `u8` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:81:40 | LL | assert::is_transmutable::< u8, i64>(); | ^^^ The size of `u8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:83:40 +error[E0277]: `u8` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:82:40 | LL | assert::is_transmutable::< u8, f64>(); | ^^^ The size of `u8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:84:39 +error[E0277]: `u8` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:83:39 | LL | assert::is_transmutable::< u8, u128>(); | ^^^^ The size of `u8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:85:39 +error[E0277]: `u8` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:84:39 | LL | assert::is_transmutable::< u8, i128>(); | ^^^^ The size of `u8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:87:40 +error[E0277]: `i16` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:86:40 | LL | assert::is_transmutable::< i16, i32>(); | ^^^ The size of `i16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:88:40 +error[E0277]: `i16` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:87:40 | LL | assert::is_transmutable::< i16, f32>(); | ^^^ The size of `i16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:89:40 +error[E0277]: `i16` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:88:40 | LL | assert::is_transmutable::< i16, u32>(); | ^^^ The size of `i16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:90:40 +error[E0277]: `i16` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:89:40 | LL | assert::is_transmutable::< i16, u64>(); | ^^^ The size of `i16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:91:40 +error[E0277]: `i16` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:90:40 | LL | assert::is_transmutable::< i16, i64>(); | ^^^ The size of `i16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:92:40 +error[E0277]: `i16` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:91:40 | LL | assert::is_transmutable::< i16, f64>(); | ^^^ The size of `i16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:93:39 +error[E0277]: `i16` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:92:39 | LL | assert::is_transmutable::< i16, u128>(); | ^^^^ The size of `i16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:94:39 +error[E0277]: `i16` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:93:39 | LL | assert::is_transmutable::< i16, i128>(); | ^^^^ The size of `i16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:96:40 +error[E0277]: `u16` cannot be safely transmuted into `i32` + --> $DIR/numbers.rs:95:40 | LL | assert::is_transmutable::< u16, i32>(); | ^^^ The size of `u16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:97:40 +error[E0277]: `u16` cannot be safely transmuted into `f32` + --> $DIR/numbers.rs:96:40 | LL | assert::is_transmutable::< u16, f32>(); | ^^^ The size of `u16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:98:40 +error[E0277]: `u16` cannot be safely transmuted into `u32` + --> $DIR/numbers.rs:97:40 | LL | assert::is_transmutable::< u16, u32>(); | ^^^ The size of `u16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:99:40 +error[E0277]: `u16` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:98:40 | LL | assert::is_transmutable::< u16, u64>(); | ^^^ The size of `u16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:100:40 +error[E0277]: `u16` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:99:40 | LL | assert::is_transmutable::< u16, i64>(); | ^^^ The size of `u16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:101:40 +error[E0277]: `u16` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:100:40 | LL | assert::is_transmutable::< u16, f64>(); | ^^^ The size of `u16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:102:39 +error[E0277]: `u16` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:101:39 | LL | assert::is_transmutable::< u16, u128>(); | ^^^^ The size of `u16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:103:39 +error[E0277]: `u16` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:102:39 | LL | assert::is_transmutable::< u16, i128>(); | ^^^^ The size of `u16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:105:40 +error[E0277]: `i32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:104:40 | LL | assert::is_transmutable::< i32, u64>(); | ^^^ The size of `i32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:106:40 +error[E0277]: `i32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:105:40 | LL | assert::is_transmutable::< i32, i64>(); | ^^^ The size of `i32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:107:40 +error[E0277]: `i32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:106:40 | LL | assert::is_transmutable::< i32, f64>(); | ^^^ The size of `i32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:108:39 +error[E0277]: `i32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:107:39 | LL | assert::is_transmutable::< i32, u128>(); | ^^^^ The size of `i32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:109:39 +error[E0277]: `i32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:108:39 | LL | assert::is_transmutable::< i32, i128>(); | ^^^^ The size of `i32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:111:40 +error[E0277]: `f32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:110:40 | LL | assert::is_transmutable::< f32, u64>(); | ^^^ The size of `f32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:112:40 +error[E0277]: `f32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:111:40 | LL | assert::is_transmutable::< f32, i64>(); | ^^^ The size of `f32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:113:40 +error[E0277]: `f32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:112:40 | LL | assert::is_transmutable::< f32, f64>(); | ^^^ The size of `f32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:114:39 +error[E0277]: `f32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:113:39 | LL | assert::is_transmutable::< f32, u128>(); | ^^^^ The size of `f32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:115:39 +error[E0277]: `f32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:114:39 | LL | assert::is_transmutable::< f32, i128>(); | ^^^^ The size of `f32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:117:40 +error[E0277]: `u32` cannot be safely transmuted into `u64` + --> $DIR/numbers.rs:116:40 | LL | assert::is_transmutable::< u32, u64>(); | ^^^ The size of `u32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:118:40 +error[E0277]: `u32` cannot be safely transmuted into `i64` + --> $DIR/numbers.rs:117:40 | LL | assert::is_transmutable::< u32, i64>(); | ^^^ The size of `u32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:119:40 +error[E0277]: `u32` cannot be safely transmuted into `f64` + --> $DIR/numbers.rs:118:40 | LL | assert::is_transmutable::< u32, f64>(); | ^^^ The size of `u32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:120:39 +error[E0277]: `u32` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:119:39 | LL | assert::is_transmutable::< u32, u128>(); | ^^^^ The size of `u32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:121:39 +error[E0277]: `u32` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:120:39 | LL | assert::is_transmutable::< u32, i128>(); | ^^^^ The size of `u32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:123:39 +error[E0277]: `u64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:122:39 | LL | assert::is_transmutable::< u64, u128>(); | ^^^^ The size of `u64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:124:39 +error[E0277]: `u64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:123:39 | LL | assert::is_transmutable::< u64, i128>(); | ^^^^ The size of `u64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:126:39 +error[E0277]: `i64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:125:39 | LL | assert::is_transmutable::< i64, u128>(); | ^^^^ The size of `i64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:127:39 +error[E0277]: `i64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:126:39 | LL | assert::is_transmutable::< i64, i128>(); | ^^^^ The size of `i64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:129:39 +error[E0277]: `f64` cannot be safely transmuted into `u128` + --> $DIR/numbers.rs:128:39 | LL | assert::is_transmutable::< f64, u128>(); | ^^^^ The size of `f64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` -error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context` - --> $DIR/numbers.rs:130:39 +error[E0277]: `f64` cannot be safely transmuted into `i128` + --> $DIR/numbers.rs:129:39 | LL | assert::is_transmutable::< f64, i128>(); | ^^^^ The size of `f64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` - --> $DIR/numbers.rs:15:14 + --> $DIR/numbers.rs:14:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 57 previous errors diff --git a/tests/ui/transmutability/primitives/numbers.rs b/tests/ui/transmutability/primitives/numbers.rs index 8baa4b05216..2b7d8a79860 100644 --- a/tests/ui/transmutability/primitives/numbers.rs +++ b/tests/ui/transmutability/primitives/numbers.rs @@ -8,11 +8,10 @@ mod assert { use std::mem::BikeshedIntrinsicFrom; - struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context> + Dst: BikeshedIntrinsicFrom<Src> {} } diff --git a/tests/ui/transmutability/primitives/unit.current.stderr b/tests/ui/transmutability/primitives/unit.current.stderr index e5d8466c323..37088a69698 100644 --- a/tests/ui/transmutability/primitives/unit.current.stderr +++ b/tests/ui/transmutability/primitives/unit.current.stderr @@ -1,16 +1,16 @@ -error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context` - --> $DIR/unit.rs:31:35 +error[E0277]: `()` cannot be safely transmuted into `u8` + --> $DIR/unit.rs:30:35 | -LL | assert::is_transmutable::<(), u8, Context>(); +LL | assert::is_transmutable::<(), u8>(); | ^^ The size of `()` is smaller than the size of `u8` | note: required by a bound in `is_transmutable` --> $DIR/unit.rs:15:14 | -LL | pub fn is_transmutable<Src, Dst, Context>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/primitives/unit.next.stderr b/tests/ui/transmutability/primitives/unit.next.stderr index e5d8466c323..37088a69698 100644 --- a/tests/ui/transmutability/primitives/unit.next.stderr +++ b/tests/ui/transmutability/primitives/unit.next.stderr @@ -1,16 +1,16 @@ -error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context` - --> $DIR/unit.rs:31:35 +error[E0277]: `()` cannot be safely transmuted into `u8` + --> $DIR/unit.rs:30:35 | -LL | assert::is_transmutable::<(), u8, Context>(); +LL | assert::is_transmutable::<(), u8>(); | ^^ The size of `()` is smaller than the size of `u8` | note: required by a bound in `is_transmutable` --> $DIR/unit.rs:15:14 | -LL | pub fn is_transmutable<Src, Dst, Context>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/primitives/unit.rs b/tests/ui/transmutability/primitives/unit.rs index 77240dd340b..24649443565 100644 --- a/tests/ui/transmutability/primitives/unit.rs +++ b/tests/ui/transmutability/primitives/unit.rs @@ -10,9 +10,9 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) @@ -25,8 +25,7 @@ mod assert { struct Zst; fn should_have_correct_size() { - struct Context; - assert::is_transmutable::<(), Zst, Context>(); - assert::is_transmutable::<Zst, (), Context>(); - assert::is_transmutable::<(), u8, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<(), Zst>(); + assert::is_transmutable::<Zst, ()>(); + assert::is_transmutable::<(), u8>(); //~ ERROR cannot be safely transmuted } diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs index 8e005d83a45..ba2db755e3b 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: false, diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr index 8b22f89c7ef..4b2866dc4f0 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible-mut.stderr @@ -1,16 +1,16 @@ -error[E0277]: `&A` cannot be safely transmuted into `&mut B` in the defining scope of `assert::Context` - --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:24:49 +error[E0277]: `&A` cannot be safely transmuted into `&mut B` + --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:23:49 | LL | assert::is_maybe_transmutable::<&'static A, &'static mut B>(); | ^^^^^^^^^^^^^^ `&A` is a shared reference, but `&mut B` is a unique reference | note: required by a bound in `is_maybe_transmutable` - --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:10:14 + --> $DIR/recursive-wrapper-types-bit-compatible-mut.rs:9:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs index 6dd49863609..cd70c278285 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: false, diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs index bac174014ee..2f264e8339e 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: false, diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr index 982af825918..305fca30939 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr @@ -1,16 +1,16 @@ -error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context` - --> $DIR/recursive-wrapper-types-bit-incompatible.rs:24:49 +error[E0277]: `B` cannot be safely transmuted into `A` + --> $DIR/recursive-wrapper-types-bit-incompatible.rs:23:49 | LL | assert::is_maybe_transmutable::<&'static B, &'static A>(); | ^^^^^^^^^^ At least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_maybe_transmutable` - --> $DIR/recursive-wrapper-types-bit-incompatible.rs:10:14 + --> $DIR/recursive-wrapper-types-bit-incompatible.rs:9:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.rs b/tests/ui/transmutability/references/recursive-wrapper-types.rs index 9556a0e76c7..28f4d6661cb 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: false, diff --git a/tests/ui/transmutability/references/u8-to-unit.rs b/tests/ui/transmutability/references/u8-to-unit.rs index bf11372f9cb..017b73d9595 100644 --- a/tests/ui/transmutability/references/u8-to-unit.rs +++ b/tests/ui/transmutability/references/u8-to-unit.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: false, lifetimes: true, diff --git a/tests/ui/transmutability/references/unit-to-itself.rs b/tests/ui/transmutability/references/unit-to-itself.rs index 5c0db04c2e6..40aec8418fe 100644 --- a/tests/ui/transmutability/references/unit-to-itself.rs +++ b/tests/ui/transmutability/references/unit-to-itself.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: false, diff --git a/tests/ui/transmutability/references/unit-to-u8.rs b/tests/ui/transmutability/references/unit-to-u8.rs index ccc401042af..973d3206c12 100644 --- a/tests/ui/transmutability/references/unit-to-u8.rs +++ b/tests/ui/transmutability/references/unit-to-u8.rs @@ -3,11 +3,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/references/unit-to-u8.stderr b/tests/ui/transmutability/references/unit-to-u8.stderr index a0891dfd01e..e2eb50442ca 100644 --- a/tests/ui/transmutability/references/unit-to-u8.stderr +++ b/tests/ui/transmutability/references/unit-to-u8.stderr @@ -1,16 +1,16 @@ -error[E0277]: `Unit` cannot be safely transmuted into `u8` in the defining scope of `assert::Context` - --> $DIR/unit-to-u8.rs:23:52 +error[E0277]: `Unit` cannot be safely transmuted into `u8` + --> $DIR/unit-to-u8.rs:22:52 | LL | assert::is_maybe_transmutable::<&'static Unit, &'static u8>(); | ^^^^^^^^^^^ The size of `Unit` is smaller than the size of `u8` | note: required by a bound in `is_maybe_transmutable` - --> $DIR/unit-to-u8.rs:10:14 + --> $DIR/unit-to-u8.rs:9:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/region-infer.rs b/tests/ui/transmutability/region-infer.rs index 09f60277688..0632bc53176 100644 --- a/tests/ui/transmutability/region-infer.rs +++ b/tests/ui/transmutability/region-infer.rs @@ -1,7 +1,6 @@ #![feature(transmutability)] use std::mem::{Assume, BikeshedIntrinsicFrom}; -pub struct Context; #[repr(C)] struct W<'a>(&'a ()); @@ -10,7 +9,6 @@ fn test<'a>() where W<'a>: BikeshedIntrinsicFrom< (), - Context, { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, >, { diff --git a/tests/ui/transmutability/region-infer.stderr b/tests/ui/transmutability/region-infer.stderr index 805862d6c4a..5497af2429e 100644 --- a/tests/ui/transmutability/region-infer.stderr +++ b/tests/ui/transmutability/region-infer.stderr @@ -1,11 +1,11 @@ -error[E0277]: `()` cannot be safely transmuted into `W<'_>` in the defining scope of `Context` - --> $DIR/region-infer.rs:20:5 +error[E0277]: `()` cannot be safely transmuted into `W<'_>` + --> $DIR/region-infer.rs:18:5 | LL | test(); | ^^^^^^ The size of `()` is smaller than the size of `W<'_>` | note: required by a bound in `test` - --> $DIR/region-infer.rs:11:12 + --> $DIR/region-infer.rs:10:12 | LL | fn test<'a>() | ---- required by a bound in this function @@ -13,7 +13,6 @@ LL | where LL | W<'a>: BikeshedIntrinsicFrom< | ____________^ LL | | (), -LL | | Context, LL | | { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, LL | | >, | |_________^ required by this bound in `test` diff --git a/tests/ui/transmutability/safety/assume/should_accept_if_dst_has_safety_invariant.rs b/tests/ui/transmutability/safety/assume/should_accept_if_dst_has_safety_invariant.rs new file mode 100644 index 00000000000..cb3c1cdf46c --- /dev/null +++ b/tests/ui/transmutability/safety/assume/should_accept_if_dst_has_safety_invariant.rs @@ -0,0 +1,24 @@ +//@ check-pass + +//! When safety is assumed, a transmutation should be accepted if the +//! destination type might carry a safety invariant. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::{Assume, BikeshedIntrinsicFrom}; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + {} +} + +fn test() { + type Src = (); + #[repr(C)] + struct Dst; + assert::is_transmutable::<Src, Dst>(); +} diff --git a/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs new file mode 100644 index 00000000000..b12c4a10d12 --- /dev/null +++ b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs @@ -0,0 +1,26 @@ +//@ check-pass + +//! When safety is assumed, a transmutation over exclusive references should be +//! accepted if the source type potentially carries safety invariants. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::{Assume, BikeshedIntrinsicFrom}; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + {} +} + +fn test() { + #[repr(C)] + struct Src { + non_zero: u8, + } + type Dst = u8; + assert::is_transmutable::<&mut Src, &mut Dst>(); +} diff --git a/tests/ui/transmutability/safety/assume/should_accept_if_src_has_safety_invariant.rs b/tests/ui/transmutability/safety/assume/should_accept_if_src_has_safety_invariant.rs new file mode 100644 index 00000000000..ff01462ffec --- /dev/null +++ b/tests/ui/transmutability/safety/assume/should_accept_if_src_has_safety_invariant.rs @@ -0,0 +1,24 @@ +//@ check-pass + +//! The presence of safety invariants in the source type does not affect +//! transmutability. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::{Assume, BikeshedIntrinsicFrom}; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + {} +} + +fn test() { + #[repr(C)] + struct Src; + type Dst = (); + assert::is_transmutable::<Src, Dst>(); +} diff --git a/tests/ui/transmutability/safety/should_accept_if_src_has_safety_invariant.rs b/tests/ui/transmutability/safety/should_accept_if_src_has_safety_invariant.rs new file mode 100644 index 00000000000..d516e9a7da5 --- /dev/null +++ b/tests/ui/transmutability/safety/should_accept_if_src_has_safety_invariant.rs @@ -0,0 +1,24 @@ +//@ check-pass + +//! The presence of safety invariants in the source type does not affect +//! transmutability. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src> // safety is NOT assumed + {} +} + +fn test() { + #[repr(C)] + struct Src; + type Dst = (); + assert::is_transmutable::<Src, Dst>(); +} diff --git a/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.rs b/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.rs new file mode 100644 index 00000000000..4f0aee31548 --- /dev/null +++ b/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.rs @@ -0,0 +1,22 @@ +//! Unless safety is assumed, a transmutation should be rejected if the +//! destination type may have a safety invariant. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src> // safety is NOT assumed + {} +} + +fn test() { + type Src = (); + #[repr(C)] + struct Dst; + assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted +} diff --git a/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.stderr b/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.stderr new file mode 100644 index 00000000000..2339c268326 --- /dev/null +++ b/tests/ui/transmutability/safety/should_reject_if_dst_has_safety_invariant.stderr @@ -0,0 +1,18 @@ +error[E0277]: `()` cannot be safely transmuted into `Dst` + --> $DIR/should_reject_if_dst_has_safety_invariant.rs:21:36 + | +LL | assert::is_transmutable::<Src, Dst>(); + | ^^^ `Dst` may carry safety invariants + | +note: required by a bound in `is_transmutable` + --> $DIR/should_reject_if_dst_has_safety_invariant.rs:13:14 + | +LL | pub fn is_transmutable<Src, Dst>() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom<Src> // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.rs b/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.rs new file mode 100644 index 00000000000..126059dd7b7 --- /dev/null +++ b/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.rs @@ -0,0 +1,24 @@ +//! Unless safety is assumed, a transmutation over exclusive references should +//! be rejected if the source potentially carries safety invariants. + +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code)] + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable<Src, Dst>() + where + Dst: BikeshedIntrinsicFrom<Src> // safety is NOT assumed + {} +} + +fn test() { + #[repr(C)] + struct Src { + non_zero: u8, + } + type Dst = u8; + assert::is_transmutable::<&mut Src, &mut Dst>(); //~ ERROR cannot be safely transmuted +} diff --git a/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.stderr b/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.stderr new file mode 100644 index 00000000000..99feebe9211 --- /dev/null +++ b/tests/ui/transmutability/safety/should_reject_if_ref_src_has_safety_invariant.stderr @@ -0,0 +1,18 @@ +error[E0277]: `u8` cannot be safely transmuted into `Src` + --> $DIR/should_reject_if_ref_src_has_safety_invariant.rs:23:41 + | +LL | assert::is_transmutable::<&mut Src, &mut Dst>(); + | ^^^^^^^^ `Src` may carry safety invariants + | +note: required by a bound in `is_transmutable` + --> $DIR/should_reject_if_ref_src_has_safety_invariant.rs:13:14 + | +LL | pub fn is_transmutable<Src, Dst>() + | --------------- required by a bound in this function +LL | where +LL | Dst: BikeshedIntrinsicFrom<Src> // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/structs/repr/should_handle_align.rs b/tests/ui/transmutability/structs/repr/should_handle_align.rs index ca18e0f1543..0c207766045 100644 --- a/tests/ui/transmutability/structs/repr/should_handle_align.rs +++ b/tests/ui/transmutability/structs/repr/should_handle_align.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/structs/repr/should_handle_packed.rs b/tests/ui/transmutability/structs/repr/should_handle_packed.rs index dcd4e5b80eb..4af32d6e84e 100644 --- a/tests/ui/transmutability/structs/repr/should_handle_packed.rs +++ b/tests/ui/transmutability/structs/repr/should_handle_packed.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.rs b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.rs index 9a65b4d702d..2e673601baf 100644 --- a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.rs +++ b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.rs @@ -6,11 +6,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr index 4c5062cd3b3..924422de538 100644 --- a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr @@ -1,16 +1,16 @@ -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:28:52 +error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:27:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -20,19 +20,19 @@ 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:29:47 +error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:28:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -42,19 +42,19 @@ 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:34:52 +error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:33:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -64,19 +64,19 @@ 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:35:47 +error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:34:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -86,19 +86,19 @@ 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:40:52 +error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:39:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -108,19 +108,19 @@ 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:41:47 +error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:40:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -130,19 +130,19 @@ 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:46:52 +error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:45:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `aligned::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -152,19 +152,19 @@ 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:47:47 +error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:46:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `aligned::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -174,19 +174,19 @@ 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:52:52 +error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:51:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `packed::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -196,19 +196,19 @@ 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:53:47 +error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:52:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `packed::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -218,19 +218,19 @@ 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:59:49 +error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:58:49 | LL | assert::is_maybe_transmutable::<repr_c, ()>(); | ^^ `nested::repr_c` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -240,19 +240,19 @@ 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:60:47 +error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` + --> $DIR/should_require_well_defined_layout.rs:59:47 | LL | assert::is_maybe_transmutable::<u128, repr_c>(); | ^^^^^^ `nested::repr_c` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs index 0be5b41c80b..4c285a616b3 100644 --- a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs +++ b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs @@ -8,11 +8,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context>, + Dst: BikeshedIntrinsicFrom<Src>, { } } diff --git a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.stderr b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.stderr index 0dedd5aaf73..7fb051f6625 100644 --- a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.stderr +++ b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.stderr @@ -1,5 +1,5 @@ error[E0072]: recursive type `ExplicitlyPadded` has infinite size - --> $DIR/transmute_infinitely_recursive_type.rs:22:5 + --> $DIR/transmute_infinitely_recursive_type.rs:21:5 | LL | struct ExplicitlyPadded(ExplicitlyPadded); | ^^^^^^^^^^^^^^^^^^^^^^^ ---------------- recursive without indirection @@ -12,7 +12,7 @@ LL | struct ExplicitlyPadded(Box<ExplicitlyPadded>); error[E0391]: cycle detected when computing layout of `should_pad_explicitly_packed_field::ExplicitlyPadded` | = note: ...which immediately requires computing layout of `should_pad_explicitly_packed_field::ExplicitlyPadded` again - = note: cycle used when evaluating trait selection obligation `(): core::mem::transmutability::BikeshedIntrinsicFrom<should_pad_explicitly_packed_field::ExplicitlyPadded, assert::Context, core::mem::transmutability::Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` + = note: cycle used when evaluating trait selection obligation `(): core::mem::transmutability::BikeshedIntrinsicFrom<should_pad_explicitly_packed_field::ExplicitlyPadded, core::mem::transmutability::Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error: aborting due to 2 previous errors diff --git a/tests/ui/transmutability/structs/should_order_fields_correctly.rs b/tests/ui/transmutability/structs/should_order_fields_correctly.rs index bda5bfb89a2..3675e4330ec 100644 --- a/tests/ui/transmutability/structs/should_order_fields_correctly.rs +++ b/tests/ui/transmutability/structs/should_order_fields_correctly.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) diff --git a/tests/ui/transmute/transmute-padding-ice.rs b/tests/ui/transmutability/transmute-padding-ice.rs index a1be7075a8a..3f3f75bc086 100644 --- a/tests/ui/transmute/transmute-padding-ice.rs +++ b/tests/ui/transmutability/transmute-padding-ice.rs @@ -4,13 +4,11 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where Dst: BikeshedIntrinsicFrom< Src, - Context, { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, >, { diff --git a/tests/ui/transmute/transmute-padding-ice.stderr b/tests/ui/transmutability/transmute-padding-ice.stderr index ff5c5c3a5dd..c48a5cd80ce 100644 --- a/tests/ui/transmute/transmute-padding-ice.stderr +++ b/tests/ui/transmutability/transmute-padding-ice.stderr @@ -1,11 +1,11 @@ -error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context` - --> $DIR/transmute-padding-ice.rs:27:40 +error[E0277]: `B` cannot be safely transmuted into `A` + --> $DIR/transmute-padding-ice.rs:25:40 | LL | assert::is_maybe_transmutable::<B, A>(); | ^ The size of `B` is smaller than the size of `A` | note: required by a bound in `is_maybe_transmutable` - --> $DIR/transmute-padding-ice.rs:11:14 + --> $DIR/transmute-padding-ice.rs:10:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function @@ -13,7 +13,6 @@ LL | where LL | Dst: BikeshedIntrinsicFrom< | ______________^ LL | | Src, -LL | | Context, LL | | { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, LL | | >, | |_________^ required by this bound in `is_maybe_transmutable` diff --git a/tests/ui/transmutability/unions/boolish.rs b/tests/ui/transmutability/unions/boolish.rs index 9ab5f2be59a..0ba59bcaa9f 100644 --- a/tests/ui/transmutability/unions/boolish.rs +++ b/tests/ui/transmutability/unions/boolish.rs @@ -8,11 +8,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> {} } diff --git a/tests/ui/transmutability/unions/repr/should_handle_align.rs b/tests/ui/transmutability/unions/repr/should_handle_align.rs index 652158ecf52..8668cca3cb5 100644 --- a/tests/ui/transmutability/unions/repr/should_handle_align.rs +++ b/tests/ui/transmutability/unions/repr/should_handle_align.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/unions/repr/should_handle_packed.rs b/tests/ui/transmutability/unions/repr/should_handle_packed.rs index 173fec9ff0c..4af6c1d3a61 100644 --- a/tests/ui/transmutability/unions/repr/should_handle_packed.rs +++ b/tests/ui/transmutability/unions/repr/should_handle_packed.rs @@ -7,11 +7,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.rs b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.rs index b1d5f71dcc5..8495b0ea88f 100644 --- a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.rs +++ b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.rs @@ -6,11 +6,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume { alignment: true, lifetimes: true, diff --git a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr index 4293d34f47b..ee0e8a66434 100644 --- a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr @@ -1,16 +1,16 @@ -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:30:48 +error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` + --> $DIR/should_require_well_defined_layout.rs:29:48 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); | ^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, @@ -20,19 +20,19 @@ 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:31:43 +error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` + --> $DIR/should_require_well_defined_layout.rs:30:43 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); | ^^^^^^^^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_require_well_defined_layout.rs:13:14 + --> $DIR/should_require_well_defined_layout.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume { LL | | alignment: true, diff --git a/tests/ui/transmutability/unions/should_pad_variants.rs b/tests/ui/transmutability/unions/should_pad_variants.rs index cabe544677e..1e4d2db8f74 100644 --- a/tests/ui/transmutability/unions/should_pad_variants.rs +++ b/tests/ui/transmutability/unions/should_pad_variants.rs @@ -8,9 +8,9 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub fn is_transmutable<Src, Dst, Context>() + pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { + Dst: BikeshedIntrinsicFrom<Src, { Assume::ALIGNMENT .and(Assume::LIFETIMES) .and(Assume::SAFETY) @@ -38,8 +38,7 @@ union Lopsided { #[repr(C)] struct Dst(V0, Lopsided, V2); fn should_pad_variants() { - struct Context; // If the implementation (incorrectly) fails to pad `Lopsided::smol` with // an uninitialized byte, this transmutation might be (wrongly) accepted: - assert::is_transmutable::<Src, Dst, Context>(); //~ ERROR cannot be safely transmuted + assert::is_transmutable::<Src, Dst>(); //~ ERROR cannot be safely transmuted } diff --git a/tests/ui/transmutability/unions/should_pad_variants.stderr b/tests/ui/transmutability/unions/should_pad_variants.stderr index fd98e355fb9..13b4c8053ad 100644 --- a/tests/ui/transmutability/unions/should_pad_variants.stderr +++ b/tests/ui/transmutability/unions/should_pad_variants.stderr @@ -1,16 +1,16 @@ -error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context` - --> $DIR/should_pad_variants.rs:44:36 +error[E0277]: `Src` cannot be safely transmuted into `Dst` + --> $DIR/should_pad_variants.rs:43:36 | -LL | assert::is_transmutable::<Src, Dst, Context>(); +LL | assert::is_transmutable::<Src, Dst>(); | ^^^ The size of `Src` is smaller than the size of `Dst` | note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 | -LL | pub fn is_transmutable<Src, Dst, Context>() +LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { +LL | Dst: BikeshedIntrinsicFrom<Src, { | ______________^ LL | | Assume::ALIGNMENT LL | | .and(Assume::LIFETIMES) diff --git a/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs b/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs index 82cf3aba8a7..7efe9ac70f1 100644 --- a/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs +++ b/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs @@ -8,11 +8,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::VALIDITY) }> {} } diff --git a/tests/ui/transmutability/unions/should_reject_contraction.rs b/tests/ui/transmutability/unions/should_reject_contraction.rs index a24dfccd318..62a0ee92919 100644 --- a/tests/ui/transmutability/unions/should_reject_contraction.rs +++ b/tests/ui/transmutability/unions/should_reject_contraction.rs @@ -6,11 +6,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> {} } diff --git a/tests/ui/transmutability/unions/should_reject_contraction.stderr b/tests/ui/transmutability/unions/should_reject_contraction.stderr index e3493e18489..a3e387a0f84 100644 --- a/tests/ui/transmutability/unions/should_reject_contraction.stderr +++ b/tests/ui/transmutability/unions/should_reject_contraction.stderr @@ -1,17 +1,17 @@ -error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context` - --> $DIR/should_reject_contraction.rs:35:41 +error[E0277]: `Superset` cannot be safely transmuted into `Subset` + --> $DIR/should_reject_contraction.rs:34:41 | LL | assert::is_transmutable::<Superset, Subset>(); | ^^^^^^ At least one value of `Superset` isn't a bit-valid value of `Subset` | note: required by a bound in `is_transmutable` - --> $DIR/should_reject_contraction.rs:13:14 + --> $DIR/should_reject_contraction.rs:12:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 1 previous error diff --git a/tests/ui/transmutability/unions/should_reject_disjoint.rs b/tests/ui/transmutability/unions/should_reject_disjoint.rs index 43aaa6905fd..732f92e8160 100644 --- a/tests/ui/transmutability/unions/should_reject_disjoint.rs +++ b/tests/ui/transmutability/unions/should_reject_disjoint.rs @@ -6,11 +6,10 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_maybe_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::VALIDITY) }> {} } diff --git a/tests/ui/transmutability/unions/should_reject_disjoint.stderr b/tests/ui/transmutability/unions/should_reject_disjoint.stderr index 178ae6f08c4..447ab6d9de7 100644 --- a/tests/ui/transmutability/unions/should_reject_disjoint.stderr +++ b/tests/ui/transmutability/unions/should_reject_disjoint.stderr @@ -1,32 +1,32 @@ -error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context` - --> $DIR/should_reject_disjoint.rs:33:40 +error[E0277]: `A` cannot be safely transmuted into `B` + --> $DIR/should_reject_disjoint.rs:32:40 | LL | assert::is_maybe_transmutable::<A, B>(); | ^ At least one value of `A` isn't a bit-valid value of `B` | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_reject_disjoint.rs:13:14 + --> $DIR/should_reject_disjoint.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { 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:34:40 +error[E0277]: `B` cannot be safely transmuted into `A` + --> $DIR/should_reject_disjoint.rs:33:40 | LL | assert::is_maybe_transmutable::<B, A>(); | ^ At least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_maybe_transmutable` - --> $DIR/should_reject_disjoint.rs:13:14 + --> $DIR/should_reject_disjoint.rs:12:14 | LL | pub fn is_maybe_transmutable<Src, Dst>() | --------------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY.and(Assume::VALIDITY) }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` error: aborting due to 2 previous errors diff --git a/tests/ui/transmutability/unions/should_reject_intersecting.rs b/tests/ui/transmutability/unions/should_reject_intersecting.rs index 9cd4233ee74..752a606c861 100644 --- a/tests/ui/transmutability/unions/should_reject_intersecting.rs +++ b/tests/ui/transmutability/unions/should_reject_intersecting.rs @@ -7,12 +7,11 @@ mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; - pub struct Context; pub fn is_transmutable<Src, Dst>() where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // validity is NOT assumed --------------^^^^^^^^^^^^^^^^^^ + Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + // validity is NOT assumed -----^^^^^^^^^^^^^^^^^^ {} } diff --git a/tests/ui/transmutability/unions/should_reject_intersecting.stderr b/tests/ui/transmutability/unions/should_reject_intersecting.stderr index 73c29ab1c97..f0763bc8be7 100644 --- a/tests/ui/transmutability/unions/should_reject_intersecting.stderr +++ b/tests/ui/transmutability/unions/should_reject_intersecting.stderr @@ -1,32 +1,32 @@ -error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context` - --> $DIR/should_reject_intersecting.rs:36:34 +error[E0277]: `A` cannot be safely transmuted into `B` + --> $DIR/should_reject_intersecting.rs:35:34 | LL | assert::is_transmutable::<A, B>(); | ^ At least one value of `A` isn't a bit-valid value of `B` | note: required by a bound in `is_transmutable` - --> $DIR/should_reject_intersecting.rs:14:14 + --> $DIR/should_reject_intersecting.rs:13:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { 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 +error[E0277]: `B` cannot be safely transmuted into `A` + --> $DIR/should_reject_intersecting.rs:36:34 | LL | assert::is_transmutable::<B, A>(); | ^ At least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_transmutable` - --> $DIR/should_reject_intersecting.rs:14:14 + --> $DIR/should_reject_intersecting.rs:13:14 | LL | pub fn is_transmutable<Src, Dst>() | --------------- required by a bound in this function LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 2 previous errors diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs deleted file mode 100644 index fa5569325b3..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs +++ /dev/null @@ -1,38 +0,0 @@ -//@ check-pass -//! If visibility is assumed, a transmutation should be accepted even if the -//! destination type contains a private field. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::{Assume, BikeshedIntrinsicFrom}; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ - {} -} - -mod src { - #[repr(C)] pub(self) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(self) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(self) field: Zst, // <- private field - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs deleted file mode 100644 index 8ff8e2de0e6..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs +++ /dev/null @@ -1,39 +0,0 @@ -//@ check-pass -//! If visibility is assumed, a transmutation should be accepted even if the -//! destination type contains a private variant. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::{Assume, BikeshedIntrinsicFrom}; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ - {} -} - -mod src { - #[repr(C)] pub(self) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(self) field: Zst, - } -} - -mod dst { - #[derive(Copy, Clone)] - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) union Dst { - pub(self) field: Zst, // <- private variant - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs deleted file mode 100644 index b9cf66ec310..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs +++ /dev/null @@ -1,46 +0,0 @@ -//@ check-pass -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) -//! -//! This test exercises a tricky-to-implement instance of this principle: the -//! "pub-in-priv trick". In the below example, the type `dst::private::Zst` is -//! unreachable from `Context`. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::{Assume, BikeshedIntrinsicFrom}; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - mod private { - #[repr(C)] pub struct Zst; // <- unreachable type - } - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: private::Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs deleted file mode 100644 index a56145f59d8..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs +++ /dev/null @@ -1,41 +0,0 @@ -//@ check-pass - -//! If visibility is assumed, a transmutation should be accepted even if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::{Assume, BikeshedIntrinsicFrom}; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ - {} -} - -mod src { - #[repr(C)] pub(self) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(self) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(self) struct Zst; // <- unreachable type - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, //~ WARNING type `dst::Zst` is more private than the item `Dst::field` - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.stderr b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.stderr deleted file mode 100644 index 80099388d63..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning: type `dst::Zst` is more private than the item `Dst::field` - --> $DIR/should_accept_if_dst_has_unreachable_field.rs:34:9 - | -LL | pub(in super) field: Zst, - | ^^^^^^^^^^^^^^^^^^^^^^^^ field `Dst::field` is reachable at visibility `pub(crate)` - | -note: but type `dst::Zst` is only usable at visibility `pub(self)` - --> $DIR/should_accept_if_dst_has_unreachable_field.rs:31:16 - | -LL | #[repr(C)] pub(self) struct Zst; // <- unreachable type - | ^^^^^^^^^^^^^^^^^^^^ - = note: `#[warn(private_interfaces)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs deleted file mode 100644 index b9b74d18338..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs +++ /dev/null @@ -1,40 +0,0 @@ -//! If visibility is assumed, a transmutation should be accepted even if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::{Assume, BikeshedIntrinsicFrom}; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }> - // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ - {} -} - -mod src { - #[repr(C)] pub(self) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(self) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - // unreachable type - #[repr(C)] pub(self) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); //~ ERROR `Dst` is private -} diff --git a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.stderr b/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.stderr deleted file mode 100644 index cf94d72b883..00000000000 --- a/tests/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0603]: struct `Dst` is private - --> $DIR/should_accept_if_dst_has_unreachable_ty.rs:39:46 - | -LL | assert::is_transmutable::<src::Src, dst::Dst, Context>(); - | ^^^ private struct - | -note: the struct `Dst` is defined here - --> $DIR/should_accept_if_dst_has_unreachable_ty.rs:32:16 - | -LL | #[repr(C)] pub(self) struct Dst { - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0603`. diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs b/tests/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs deleted file mode 100644 index 22392c53905..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs +++ /dev/null @@ -1,37 +0,0 @@ -//@ check-pass -//! The presence of a private field in the source type does not affect -//! transmutability. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(self) field: Zst, // <- private field - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs b/tests/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs deleted file mode 100644 index 876db7c6589..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs +++ /dev/null @@ -1,38 +0,0 @@ -//@ check-pass -//! The presence of a private variant in the source type does not affect -//! transmutability. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[derive(Copy, Clone)] - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) union Src { - pub(self) field: Zst, // <- private variant - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs b/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs deleted file mode 100644 index 8b6db9ff150..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs +++ /dev/null @@ -1,39 +0,0 @@ -//@ check-pass - -//! The presence of an unreachable field in the source type (e.g., a public -//! field with a private type does not affect transmutability. (This rule is -//! distinct from type privacy, which still may forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(self) struct Zst; // <- unreachable type - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, //~ WARNING type `src::Zst` is more private than the item `Src::field` - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr b/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr deleted file mode 100644 index 55fb3392305..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning: type `src::Zst` is more private than the item `Src::field` - --> $DIR/should_accept_if_src_has_unreachable_field.rs:24:9 - | -LL | pub(in super) field: Zst, - | ^^^^^^^^^^^^^^^^^^^^^^^^ field `Src::field` is reachable at visibility `pub(crate)` - | -note: but type `src::Zst` is only usable at visibility `pub(self)` - --> $DIR/should_accept_if_src_has_unreachable_field.rs:21:16 - | -LL | #[repr(C)] pub(self) struct Zst; // <- unreachable type - | ^^^^^^^^^^^^^^^^^^^^ - = note: `#[warn(private_interfaces)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs b/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs deleted file mode 100644 index acf9f230250..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs +++ /dev/null @@ -1,38 +0,0 @@ -//! The presence of an unreachable source type (i.e., the source type is -//! private) does not affect transmutability. (This rule is distinct from type -//! privacy, which still may forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - // unreachable type - #[repr(C)] pub(self) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); //~ ERROR `Src` is private -} diff --git a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr b/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr deleted file mode 100644 index 57ceac61f16..00000000000 --- a/tests/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0603]: struct `Src` is private - --> $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:22:16 - | -LL | #[repr(C)] pub(self) struct Src { - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0603`. diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs deleted file mode 100644 index e8c3fbc9a04..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs +++ /dev/null @@ -1,36 +0,0 @@ -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains a private field. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Dst { - pub(self) field: Zst, // <- private field - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); //~ ERROR cannot be safely transmuted -} diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr deleted file mode 100644 index cb2e7ec29a5..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr +++ /dev/null @@ -1,18 +0,0 @@ -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:35:41 - | -LL | assert::is_transmutable::<src::Src, dst::Dst, Context>(); - | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope - | -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 function -LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs deleted file mode 100644 index 47bca27abaa..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs +++ /dev/null @@ -1,37 +0,0 @@ -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains a private variant. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - #[derive(Copy, Clone)] - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) union Dst { - pub(self) field: Zst, // <- private variant - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); //~ ERROR cannot be safely transmuted -} diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr deleted file mode 100644 index 434c3fcd278..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr +++ /dev/null @@ -1,18 +0,0 @@ -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:36:41 - | -LL | assert::is_transmutable::<src::Src, dst::Dst, Context>(); - | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope - | -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 function -LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs b/tests/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs deleted file mode 100644 index 9b7b940ca69..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs +++ /dev/null @@ -1,51 +0,0 @@ -//@ check-pass -//! NOTE: This test documents a known-bug in the implementation of the -//! transmutability trait. Once fixed, the above "check-pass" header should be -//! removed, and an "ERROR cannot be safely transmuted" annotation should be added at the end -//! of the line starting with `assert::is_transmutable`. -//! -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) -//! -//! This test exercises a tricky-to-implement instance of this principle: the -//! "pub-in-priv trick". In the below example, the type `dst::private::Zst` is -//! unreachable from `Context`. Consequently, the transmute from `Src` to `Dst` -//! SHOULD be rejected. - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - mod private { - #[repr(C)] pub struct Zst; // <- unreachable type - } - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: private::Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); -} diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs deleted file mode 100644 index d7e21676fd3..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs +++ /dev/null @@ -1,38 +0,0 @@ -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(self) struct Zst; // <- unreachable type - - #[repr(C)] pub(in super) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); //~ ERROR cannot be safely transmuted -} diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr deleted file mode 100644 index e987aa595b9..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr +++ /dev/null @@ -1,18 +0,0 @@ -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:37:41 - | -LL | assert::is_transmutable::<src::Src, dst::Dst, Context>(); - | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope - | -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 function -LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs deleted file mode 100644 index c7b59f15b99..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs +++ /dev/null @@ -1,41 +0,0 @@ -//! Unless visibility is assumed, a transmutation should be rejected if the -//! destination type contains an unreachable field (e.g., a public field with a -//! private type). (This rule is distinct from type privacy, which still may -//! forbid naming such types.) - -#![crate_type = "lib"] -#![feature(transmutability)] -#![allow(dead_code)] - -mod assert { - use std::mem::BikeshedIntrinsicFrom; - - pub fn is_transmutable<Src, Dst, Context>() - where - Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - {} -} - -mod src { - #[repr(C)] pub(in super) struct Zst; - - #[repr(C)] pub(in super) struct Src { - pub(in super) field: Zst, - } -} - -mod dst { - #[repr(C)] pub(in super) struct Zst; - - // unreachable type - #[repr(C)] pub(self) struct Dst { - pub(in super) field: Zst, - } -} - -fn test() { - struct Context; - assert::is_transmutable::<src::Src, dst::Dst, Context>(); - //~^ ERROR `Dst` is private - //~| ERROR cannot be safely transmuted -} diff --git a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr b/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr deleted file mode 100644 index ea488980cdd..00000000000 --- a/tests/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0603]: struct `Dst` is private - --> $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: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:38:41 - | -LL | assert::is_transmutable::<src::Src, dst::Dst, Context>(); - | ^^^^^^^^ `Dst` is or contains a type or field that is not visible in that scope - | -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 function -LL | where -LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0277, E0603. -For more information about an error, try `rustc --explain E0277`. |
