diff --git a/Cargo.lock b/Cargo.lock index 2d143025241ee..2a38ed1f8db27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4234,6 +4234,7 @@ version = "0.1.0" dependencies = [ "itertools", "rustc_data_structures", + "rustc_hir", "rustc_infer", "rustc_macros", "rustc_middle", diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index 0c01326d0032a..f19d07d98dcb2 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -193,7 +193,8 @@ language_item_table! { DispatchFromDyn, sym::dispatch_from_dyn, dispatch_from_dyn_trait, Target::Trait, GenericRequirement::Minimum(1); // language items relating to transmutability - TransmuteTrait, sym::transmute_trait, transmute_trait, Target::Trait, GenericRequirement::Exact(6); + TransmuteOpts, sym::transmute_opts, transmute_opts, Target::Struct, GenericRequirement::Exact(0); + TransmuteTrait, sym::transmute_trait, transmute_trait, Target::Trait, GenericRequirement::Exact(3); Add(Op), sym::add, add_trait, Target::Trait, GenericRequirement::Exact(1); Sub(Op), sym::sub, sub_trait, Target::Trait, GenericRequirement::Exact(1); diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 64b919587e80d..c501fba21c60f 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -339,6 +339,7 @@ symbols! { alias, align, align_offset, + alignment, alignstack, all, alloc, @@ -866,6 +867,7 @@ symbols! { lib, libc, lifetime, + lifetimes, likely, line, line_macro, @@ -1294,6 +1296,7 @@ symbols! { rustfmt, rvalue_static_promotion, s, + safety, sanitize, sanitizer_runtime, saturating_add, @@ -1478,6 +1481,7 @@ symbols! { trait_alias, trait_upcasting, transmute, + transmute_opts, transmute_trait, transparent, transparent_enums, @@ -1573,6 +1577,7 @@ symbols! { va_list, va_start, val, + validity, values, var, variant_count, diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 2a1099fc82abc..e44f66657955e 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -279,29 +279,17 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let predicate = obligation.predicate; let type_at = |i| predicate.map_bound(|p| p.trait_ref.substs.type_at(i)); - let bool_at = |i| { - predicate - .skip_binder() - .trait_ref - .substs - .const_at(i) - .try_eval_bool(self.tcx(), obligation.param_env) - .unwrap_or(true) - }; + let const_at = |i| predicate.skip_binder().trait_ref.substs.const_at(i); let src_and_dst = predicate.map_bound(|p| rustc_transmute::Types { - src: p.trait_ref.substs.type_at(1), dst: p.trait_ref.substs.type_at(0), + src: p.trait_ref.substs.type_at(1), }); let scope = type_at(2).skip_binder(); - let assume = rustc_transmute::Assume { - alignment: bool_at(3), - lifetimes: bool_at(4), - validity: bool_at(5), - visibility: bool_at(6), - }; + let assume = + rustc_transmute::Assume::from_const(self.infcx.tcx, obligation.param_env, const_at(3)); let cause = obligation.cause.clone(); diff --git a/compiler/rustc_transmute/Cargo.toml b/compiler/rustc_transmute/Cargo.toml index 9dc96e08a8e27..aa6fe7d241968 100644 --- a/compiler/rustc_transmute/Cargo.toml +++ b/compiler/rustc_transmute/Cargo.toml @@ -7,7 +7,8 @@ edition = "2021" [dependencies] tracing = "0.1" -rustc_data_structures = { path = "../rustc_data_structures", optional = true} +rustc_data_structures = { path = "../rustc_data_structures"} +rustc_hir = { path = "../rustc_hir", optional = true} rustc_infer = { path = "../rustc_infer", optional = true} rustc_macros = { path = "../rustc_macros", optional = true} rustc_middle = { path = "../rustc_middle", optional = true} @@ -17,7 +18,7 @@ rustc_target = { path = "../rustc_target", optional = true} [features] rustc = [ "rustc_middle", - "rustc_data_structures", + "rustc_hir", "rustc_infer", "rustc_macros", "rustc_span", diff --git a/compiler/rustc_transmute/src/layout/dfa.rs b/compiler/rustc_transmute/src/layout/dfa.rs index b60ea6e7a24f2..b8922696e3067 100644 --- a/compiler/rustc_transmute/src/layout/dfa.rs +++ b/compiler/rustc_transmute/src/layout/dfa.rs @@ -104,7 +104,6 @@ where } #[instrument(level = "debug")] - #[cfg_attr(feature = "rustc", allow(rustc::potential_query_instability))] pub(crate) fn from_nfa(nfa: Nfa) -> Self { let Nfa { transitions: nfa_transitions, start: nfa_start, accepting: nfa_accepting } = nfa; diff --git a/compiler/rustc_transmute/src/layout/nfa.rs b/compiler/rustc_transmute/src/layout/nfa.rs index f25e3c1fd8a30..c2bc47bc043a0 100644 --- a/compiler/rustc_transmute/src/layout/nfa.rs +++ b/compiler/rustc_transmute/src/layout/nfa.rs @@ -119,8 +119,6 @@ where let mut transitions: Map, Set>> = self.transitions; - // the iteration order doesn't matter - #[cfg_attr(feature = "rustc", allow(rustc::potential_query_instability))] for (source, transition) in other.transitions { let fix_state = |state| if state == other.start { self.accepting } else { state }; let entry = transitions.entry(fix_state(source)).or_default(); @@ -142,8 +140,6 @@ where let mut transitions: Map, Set>> = self.transitions.clone(); - // the iteration order doesn't matter - #[cfg_attr(feature = "rustc", allow(rustc::potential_query_instability))] for (&(mut source), transition) in other.transitions.iter() { // if source is starting state of `other`, replace with starting state of `self` if source == other.start { @@ -152,8 +148,6 @@ where let entry = transitions.entry(source).or_default(); for (edge, destinations) in transition { let entry = entry.entry(edge.clone()).or_default(); - // the iteration order doesn't matter - #[cfg_attr(feature = "rustc", allow(rustc::potential_query_instability))] for &(mut destination) in destinations { // if dest is accepting state of `other`, replace with accepting state of `self` if destination == other.accepting { diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index 89b1ce5abe9e8..64cd70d367877 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -6,11 +6,7 @@ #[macro_use] extern crate tracing; -#[cfg(feature = "rustc")] -pub(crate) use rustc_data_structures::fx::{FxHashMap as Map, FxHashSet as Set}; - -#[cfg(not(feature = "rustc"))] -pub(crate) use std::collections::{HashMap as Map, HashSet as Set}; +pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set}; pub(crate) mod layout; pub(crate) mod maybe_transmutable; @@ -19,8 +15,8 @@ pub(crate) mod maybe_transmutable; pub struct Assume { pub alignment: bool, pub lifetimes: bool, + pub safety: bool, pub validity: bool, - pub visibility: bool, } /// The type encodes answers to the question: "Are these types transmutable?" @@ -62,11 +58,17 @@ pub enum Reason { #[cfg(feature = "rustc")] mod rustc { + use super::*; + + use rustc_hir::lang_items::LangItem; use rustc_infer::infer::InferCtxt; use rustc_macros::{TypeFoldable, TypeVisitable}; use rustc_middle::traits::ObligationCause; use rustc_middle::ty::Binder; + use rustc_middle::ty::Const; + use rustc_middle::ty::ParamEnv; use rustc_middle::ty::Ty; + use rustc_middle::ty::TyCtxt; /// The source and destination types of a transmutation. #[derive(TypeFoldable, TypeVisitable, Debug, Clone, Copy)] @@ -106,6 +108,54 @@ mod rustc { .answer() } } + + impl Assume { + /// Constructs an `Assume` from a given const-`Assume`. + pub fn from_const<'tcx>( + tcx: TyCtxt<'tcx>, + param_env: ParamEnv<'tcx>, + c: Const<'tcx>, + ) -> Self { + use rustc_middle::ty::ScalarInt; + use rustc_middle::ty::TypeVisitable; + use rustc_span::symbol::sym; + + let c = c.eval(tcx, param_env); + + if let Some(err) = c.error_reported() { + return Self { alignment: true, lifetimes: true, safety: true, validity: true }; + } + + let adt_def = c.ty().ty_adt_def().expect("The given `Const` must be an ADT."); + + assert_eq!( + tcx.require_lang_item(LangItem::TransmuteOpts, None), + adt_def.did(), + "The given `Const` was not marked with the `{}` lang item.", + LangItem::TransmuteOpts.name(), + ); + + let variant = adt_def.non_enum_variant(); + let fields = c.to_valtree().unwrap_branch(); + + let get_field = |name| { + let (field_idx, _) = variant + .fields + .iter() + .enumerate() + .find(|(_, field_def)| name == field_def.name) + .expect(&format!("There were no fields named `{name}`.")); + fields[field_idx].unwrap_leaf() == ScalarInt::TRUE + }; + + Self { + alignment: get_field(sym::alignment), + lifetimes: get_field(sym::lifetimes), + safety: get_field(sym::safety), + validity: get_field(sym::validity), + } + } + } } #[cfg(feature = "rustc")] diff --git a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs index 248ff1ec24164..1186eac37abd9 100644 --- a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs +++ b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs @@ -105,7 +105,7 @@ where #[inline(always)] #[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))] pub(crate) fn answer(self) -> Answer<::Ref> { - let assume_visibility = self.assume.visibility; + let assume_visibility = self.assume.safety; let query_or_answer = self.map_layouts(|src, dst, scope, context| { // Remove all `Def` nodes from `src`, without checking their visibility. let src = src.prune(&|def| true); diff --git a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs index d9d125687f656..4d5772a4f2ea5 100644 --- a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs +++ b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs @@ -13,7 +13,7 @@ mod bool { layout::Tree::::bool(), layout::Tree::::bool(), (), - crate::Assume { alignment: false, lifetimes: false, validity: true, visibility: false }, + crate::Assume { alignment: false, lifetimes: false, validity: true, safety: false }, UltraMinimal, ) .answer(); @@ -26,7 +26,7 @@ mod bool { layout::Dfa::::bool(), layout::Dfa::::bool(), (), - crate::Assume { alignment: false, lifetimes: false, validity: true, visibility: false }, + crate::Assume { alignment: false, lifetimes: false, validity: true, safety: false }, UltraMinimal, ) .answer(); diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index bf75796f1fcb2..9d857eb63da9c 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -93,6 +93,7 @@ #![warn(missing_debug_implementations)] #![warn(missing_docs)] #![allow(explicit_outlives_requirements)] +#![allow(incomplete_features)] // // Library features: #![feature(const_align_offset)] @@ -160,6 +161,7 @@ // // Language features: #![feature(abi_unadjusted)] +#![feature(adt_const_params)] #![feature(allow_internal_unsafe)] #![feature(allow_internal_unstable)] #![feature(associated_type_bounds)] diff --git a/library/core/src/mem/transmutability.rs b/library/core/src/mem/transmutability.rs index b4fabedad7829..87a378631050a 100644 --- a/library/core/src/mem/transmutability.rs +++ b/library/core/src/mem/transmutability.rs @@ -4,25 +4,20 @@ /// any value of type `Self` are safely transmutable into a value of type `Dst`, in a given `Context`, /// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied. #[unstable(feature = "transmutability", issue = "99571")] -#[lang = "transmute_trait"] +#[cfg_attr(not(bootstrap), lang = "transmute_trait")] #[rustc_on_unimplemented( message = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`.", label = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`." )] -pub unsafe trait BikeshedIntrinsicFrom< - Src, - Context, - const ASSUME_ALIGNMENT: bool, - const ASSUME_LIFETIMES: bool, - const ASSUME_VALIDITY: bool, - const ASSUME_VISIBILITY: bool, -> where +pub unsafe trait BikeshedIntrinsicFrom +where Src: ?Sized, { } /// What transmutation safety conditions shall the compiler assume that *you* are checking? #[unstable(feature = "transmutability", issue = "99571")] +#[cfg_attr(not(bootstrap), lang = "transmute_opts")] #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub struct Assume { /// When `true`, the compiler assumes that *you* are ensuring (either dynamically or statically) that @@ -33,11 +28,80 @@ pub struct Assume { /// that violates Rust's memory model. pub lifetimes: bool, + /// When `true`, the compiler assumes that *you* have ensured that it is safe for you to violate the + /// type and field privacy of the destination type (and sometimes of the source type, too). + pub safety: bool, + /// When `true`, the compiler assumes that *you* are ensuring that the source type is actually a valid /// instance of the destination type. pub validity: bool, +} - /// When `true`, the compiler assumes that *you* have ensured that it is safe for you to violate the - /// type and field privacy of the destination type (and sometimes of the source type, too). - pub visibility: bool, +impl Assume { + /// Do not assume that *you* have ensured any safety properties are met. + #[unstable(feature = "transmutability", issue = "99571")] + pub const NOTHING: Self = + Self { alignment: false, lifetimes: false, safety: false, validity: false }; + + /// Assume only that alignment conditions are met. + #[unstable(feature = "transmutability", issue = "99571")] + pub const ALIGNMENT: Self = Self { alignment: true, ..Self::NOTHING }; + + /// Assume only that lifetime conditions are met. + #[unstable(feature = "transmutability", issue = "99571")] + pub const LIFETIMES: Self = Self { lifetimes: true, ..Self::NOTHING }; + + /// Assume only that safety conditions are met. + #[unstable(feature = "transmutability", issue = "99571")] + pub const SAFETY: Self = Self { safety: true, ..Self::NOTHING }; + + /// Assume only that dynamically-satisfiable validity conditions are met. + #[unstable(feature = "transmutability", issue = "99571")] + pub const VALIDITY: Self = Self { validity: true, ..Self::NOTHING }; + + /// Assume both `self` and `other_assumptions`. + #[unstable(feature = "transmutability", issue = "99571")] + pub const fn and(self, other_assumptions: Self) -> Self { + Self { + alignment: self.alignment || other_assumptions.alignment, + lifetimes: self.lifetimes || other_assumptions.lifetimes, + safety: self.safety || other_assumptions.safety, + validity: self.validity || other_assumptions.validity, + } + } + + /// Assume `self`, excepting `other_assumptions`. + #[unstable(feature = "transmutability", issue = "99571")] + pub const fn but_not(self, other_assumptions: Self) -> Self { + Self { + alignment: self.alignment && !other_assumptions.alignment, + lifetimes: self.lifetimes && !other_assumptions.lifetimes, + safety: self.safety && !other_assumptions.safety, + validity: self.validity && !other_assumptions.validity, + } + } +} + +// FIXME(jswrenn): This const op is not actually usable. Why? +// https://github.com/rust-lang/rust/pull/100726#issuecomment-1219928926 +#[unstable(feature = "transmutability", issue = "99571")] +#[rustc_const_unstable(feature = "transmutability", issue = "99571")] +impl const core::ops::Add for Assume { + type Output = Assume; + + fn add(self, other_assumptions: Assume) -> Assume { + self.and(other_assumptions) + } +} + +// FIXME(jswrenn): This const op is not actually usable. Why? +// https://github.com/rust-lang/rust/pull/100726#issuecomment-1219928926 +#[unstable(feature = "transmutability", issue = "99571")] +#[rustc_const_unstable(feature = "transmutability", issue = "99571")] +impl const core::ops::Sub for Assume { + type Output = Assume; + + fn sub(self, other_assumptions: Assume) -> Assume { + self.but_not(other_assumptions) + } } diff --git a/src/test/ui/transmutability/abstraction/abstracted_assume.rs b/src/test/ui/transmutability/abstraction/abstracted_assume.rs index 2abbbf3c158d6..0225c4230dc4d 100644 --- a/src/test/ui/transmutability/abstraction/abstracted_assume.rs +++ b/src/test/ui/transmutability/abstraction/abstracted_assume.rs @@ -3,6 +3,7 @@ //! provided indirectly through an abstraction. #![crate_type = "lib"] +#![feature(adt_const_params)] #![feature(transmutability)] #![allow(dead_code, incomplete_features, non_camel_case_types)] @@ -13,19 +14,13 @@ mod assert { Src, Dst, Context, - const ASSUME_ALIGNMENT: bool, - const ASSUME_LIFETIMES: bool, - const ASSUME_VALIDITY: bool, - const ASSUME_VISIBILITY: bool, + const ASSUME: std::mem::Assume, >() where Dst: BikeshedIntrinsicFrom< Src, Context, - ASSUME_ALIGNMENT, - ASSUME_LIFETIMES, - ASSUME_VALIDITY, - ASSUME_VISIBILITY, + ASSUME, >, {} } @@ -35,7 +30,7 @@ fn direct() { #[repr(C)] struct Src; #[repr(C)] struct Dst; - assert::is_transmutable::(); + assert::is_transmutable::(); } fn via_const() { @@ -45,7 +40,7 @@ fn via_const() { const FALSE: bool = false; - assert::is_transmutable::(); + assert::is_transmutable::(); } fn via_associated_const() { @@ -65,9 +60,13 @@ fn via_associated_const() { Src, Dst, Context, - {Ty::FALSE}, - {Ty::FALSE}, - {Ty::FALSE}, - {Ty::FALSE} + { + std::mem::Assume { + alignment: {Ty::FALSE}, + lifetimes: {Ty::FALSE}, + safety: {Ty::FALSE}, + validity: {Ty::FALSE}, + } + } >(); } diff --git a/src/test/ui/transmutability/abstraction/const_generic_fn.rs b/src/test/ui/transmutability/abstraction/const_generic_fn.rs index 94c38bb28f7e2..e693a09570f3a 100644 --- a/src/test/ui/transmutability/abstraction/const_generic_fn.rs +++ b/src/test/ui/transmutability/abstraction/const_generic_fn.rs @@ -6,13 +6,13 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn array_like() where - T: BikeshedIntrinsicFrom<[E; N], Context, false, false, false, true>, - [E; N]: BikeshedIntrinsicFrom + T: BikeshedIntrinsicFrom<[E; N], Context, { Assume::SAFETY }>, + [E; N]: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/arrays/should_have_correct_length.rs b/src/test/ui/transmutability/arrays/should_have_correct_length.rs index bfe6d830a1be7..353797d0c4bb0 100644 --- a/src/test/ui/transmutability/arrays/should_have_correct_length.rs +++ b/src/test/ui/transmutability/arrays/should_have_correct_length.rs @@ -6,12 +6,12 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/arrays/should_inherit_alignment.rs b/src/test/ui/transmutability/arrays/should_inherit_alignment.rs index fcb1765ea6bb4..b00e5c7e4008c 100644 --- a/src/test/ui/transmutability/arrays/should_inherit_alignment.rs +++ b/src/test/ui/transmutability/arrays/should_inherit_alignment.rs @@ -6,12 +6,17 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs index 8e69527c1862c..853bd9cbc0fb3 100644 --- a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs +++ b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs @@ -5,12 +5,17 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr index eae0c947d4253..96a2fdc54dbb4 100644 --- a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr +++ b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr @@ -1,98 +1,134 @@ error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:21:52 + --> $DIR/should_require_well_defined_layout.rs:26:52 | LL | assert::is_maybe_transmutable::(); | ^^ `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, true, true, true, true>` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:22:47 + --> $DIR/should_require_well_defined_layout.rs:27:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 0]` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 0]` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:27:52 + --> $DIR/should_require_well_defined_layout.rs:32:52 | LL | assert::is_maybe_transmutable::(); | ^^ `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, true, true, true, true>` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:28:47 + --> $DIR/should_require_well_defined_layout.rs:33:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 1]` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 1]` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:33:52 + --> $DIR/should_require_well_defined_layout.rs:38:52 | LL | assert::is_maybe_transmutable::(); | ^^ `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, true, true, true, true>` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:34:47 + --> $DIR/should_require_well_defined_layout.rs:39:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 2]` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[String; 2]` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error: aborting due to 6 previous errors diff --git a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs index 18e02b0d2b908..940f070e7e360 100644 --- a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs +++ b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs @@ -5,11 +5,18 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr index fa2e3b89b079a..4da5fcea3374c 100644 --- a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr +++ b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr @@ -1,322 +1,462 @@ error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:41:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:48:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i8` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i8` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:43:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:50:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0i8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:49:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:56:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `Zst` cannot be safely transmuted into `V0u8` in the defining scope of `n8::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u8` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u8` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:51:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:58:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0u8` cannot be safely transmuted into `u16` in the defining scope of `n8::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:65:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:72:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u8` cannot be safely transmuted into `V0i16` in the defining scope of `n16::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i16` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:67:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:74:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0i16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:73:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:80:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u8` cannot be safely transmuted into `V0u16` in the defining scope of `n16::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u16` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:75:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:82:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0u16` cannot be safely transmuted into `u32` in the defining scope of `n16::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:89:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:96:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u16` cannot be safely transmuted into `V0i32` in the defining scope of `n32::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i32` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:91:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:98:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0i32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:97:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:104:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u16` cannot be safely transmuted into `V0u32` in the defining scope of `n32::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u32` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:99:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:106:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0u32` cannot be safely transmuted into `u64` in the defining scope of `n32::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:113:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:120:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u32` cannot be safely transmuted into `V0i64` in the defining scope of `n64::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0i64` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:115:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:122:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0i64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:121:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:128:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u32` cannot be safely transmuted into `V0u64` in the defining scope of `n64::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0u64` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:123:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:130:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0u64` cannot be safely transmuted into `u128` in the defining scope of `n64::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:137:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:144:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u8` cannot be safely transmuted into `V0isize` in the defining scope of `nsize::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0isize` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0isize` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:139:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:146:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0isize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[usize; 2]` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[usize; 2]` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:145:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:152:44 | LL | assert::is_transmutable::(); | ^^^^^^^ `u8` cannot be safely transmuted into `V0usize` in the defining scope of `nsize::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0usize` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `V0usize` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`. - --> $DIR/primitive_reprs_should_have_correct_length.rs:147:44 + --> $DIR/primitive_reprs_should_have_correct_length.rs:154:44 | LL | assert::is_transmutable::(); | ^^^^^^ `V0usize` cannot be safely transmuted into `[usize; 2]` in the defining scope of `nsize::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[usize; 2]` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `[usize; 2]` note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error: aborting due to 20 previous errors diff --git a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs index 978a12648f03a..102111ae291c6 100644 --- a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs +++ b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs @@ -6,12 +6,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr index 3273e87c89ff4..510b8c56e5ab8 100644 --- a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr +++ b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr @@ -1,98 +1,140 @@ error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:21:52 + --> $DIR/should_require_well_defined_layout.rs:28:52 | LL | assert::is_maybe_transmutable::(); | ^^ `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:22:47 + --> $DIR/should_require_well_defined_layout.rs:29:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `void::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `void::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:27:52 + --> $DIR/should_require_well_defined_layout.rs:34:52 | LL | assert::is_maybe_transmutable::(); | ^^ `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:28:47 + --> $DIR/should_require_well_defined_layout.rs:35:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `singleton::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `singleton::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:33:52 + --> $DIR/should_require_well_defined_layout.rs:40:52 | LL | assert::is_maybe_transmutable::(); | ^^ `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:34:47 + --> $DIR/should_require_well_defined_layout.rs:41:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `duplex::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `duplex::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:14:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error: aborting due to 6 previous errors diff --git a/src/test/ui/transmutability/enums/should_order_correctly.rs b/src/test/ui/transmutability/enums/should_order_correctly.rs index 6558d2658ee45..b753cf0e62d59 100644 --- a/src/test/ui/transmutability/enums/should_order_correctly.rs +++ b/src/test/ui/transmutability/enums/should_order_correctly.rs @@ -7,12 +7,17 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/enums/should_pad_variants.rs b/src/test/ui/transmutability/enums/should_pad_variants.rs index 466b6c8a15b52..c077c52a36ac7 100644 --- a/src/test/ui/transmutability/enums/should_pad_variants.rs +++ b/src/test/ui/transmutability/enums/should_pad_variants.rs @@ -6,11 +6,16 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/enums/should_pad_variants.stderr b/src/test/ui/transmutability/enums/should_pad_variants.stderr index 429f7211d17a8..a823503d594e9 100644 --- a/src/test/ui/transmutability/enums/should_pad_variants.stderr +++ b/src/test/ui/transmutability/enums/should_pad_variants.stderr @@ -1,18 +1,24 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`. - --> $DIR/should_pad_variants.rs:39:36 + --> $DIR/should_pad_variants.rs:44:36 | LL | assert::is_transmutable::(); | ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/enums/should_respect_endianness.rs b/src/test/ui/transmutability/enums/should_respect_endianness.rs index 67a3c4e94ba8f..19ff690050031 100644 --- a/src/test/ui/transmutability/enums/should_respect_endianness.rs +++ b/src/test/ui/transmutability/enums/should_respect_endianness.rs @@ -7,12 +7,17 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/enums/should_respect_endianness.stderr b/src/test/ui/transmutability/enums/should_respect_endianness.stderr index 78023cb378aca..fcb70813bd961 100644 --- a/src/test/ui/transmutability/enums/should_respect_endianness.stderr +++ b/src/test/ui/transmutability/enums/should_respect_endianness.stderr @@ -1,18 +1,24 @@ error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`. - --> $DIR/should_respect_endianness.rs:32:36 + --> $DIR/should_respect_endianness.rs:37:36 | LL | assert::is_transmutable::(); | ^^^^^^^^^^ `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Unexpected` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Unexpected` note: required by a bound in `is_transmutable` --> $DIR/should_respect_endianness.rs:15:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs index e13462d390b03..b3a1e13b85bed 100644 --- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs +++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs @@ -10,7 +10,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs index dc51e2a8f4d2b..092b205b77027 100644 --- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs +++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs @@ -10,7 +10,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs index 86fc8bd6b2856..ebe34e13432b5 100644 --- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs +++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs @@ -10,7 +10,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs index bd36748e7901b..354abf99d4d07 100644 --- a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs +++ b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs @@ -2,11 +2,13 @@ //! provided. #![crate_type = "lib"] +#![feature(adt_const_params)] +#![feature(generic_const_exprs)] #![feature(transmutability)] #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable< Src, @@ -14,19 +16,34 @@ mod assert { Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, + const ASSUME_SAFETY: bool, const ASSUME_VALIDITY: bool, - const ASSUME_VISIBILITY: bool, >() where Dst: BikeshedIntrinsicFrom< Src, Context, - ASSUME_ALIGNMENT, - ASSUME_LIFETIMES, - ASSUME_VALIDITY, - ASSUME_VISIBILITY, + { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } + //~^ ERROR E0080 + //~| ERROR E0080 + //~| ERROR E0080 + //~| ERROR E0080 >, {} + + const fn from_options( + alignment: bool, + lifetimes: bool, + safety: bool, + validity: bool, + ) -> Assume { + Assume { + alignment, + lifetimes, + safety, + validity, + } + } } fn test() { diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr index e1464e02352c6..a258f2ecea6d9 100644 --- a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr +++ b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr @@ -1,27 +1,52 @@ error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:36:51 + --> $DIR/wrong-type-assume.rs:53:51 | LL | assert::is_transmutable::(); | ^^^ expected `bool`, found `u8` +error[E0080]: evaluation of `assert::is_transmutable::::{constant#0}` failed + --> $DIR/wrong-type-assume.rs:26:15 + | +LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:37:58 + --> $DIR/wrong-type-assume.rs:54:58 | LL | assert::is_transmutable::(); | ^^^ expected `bool`, found `u8` +error[E0080]: evaluation of `assert::is_transmutable::::{constant#0}` failed + --> $DIR/wrong-type-assume.rs:26:15 + | +LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:38:65 + --> $DIR/wrong-type-assume.rs:55:65 | LL | assert::is_transmutable::(); | ^^^ expected `bool`, found `u8` +error[E0080]: evaluation of `assert::is_transmutable::::{constant#0}` failed + --> $DIR/wrong-type-assume.rs:26:15 + | +LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + error[E0308]: mismatched types - --> $DIR/wrong-type-assume.rs:39:72 + --> $DIR/wrong-type-assume.rs:56:72 | LL | assert::is_transmutable::(); | ^^^ expected `bool`, found `u8` -error: aborting due to 4 previous errors +error[E0080]: evaluation of `assert::is_transmutable::::{constant#0}` failed + --> $DIR/wrong-type-assume.rs:26:15 + | +LL | { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + +error: aborting due to 8 previous errors -For more information about this error, try `rustc --explain E0308`. +Some errors have detailed explanations: E0080, E0308. +For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/transmutability/primitives/bool.rs b/src/test/ui/transmutability/primitives/bool.rs index 4f79bc2533708..eebb74fff471c 100644 --- a/src/test/ui/transmutability/primitives/bool.rs +++ b/src/test/ui/transmutability/primitives/bool.rs @@ -4,17 +4,17 @@ #![allow(incomplete_features)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/primitives/bool.stderr b/src/test/ui/transmutability/primitives/bool.stderr index dc740251c871e..214b5e150edd2 100644 --- a/src/test/ui/transmutability/primitives/bool.stderr +++ b/src/test/ui/transmutability/primitives/bool.stderr @@ -4,15 +4,15 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope LL | assert::is_transmutable::(); | ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `bool` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `bool` note: required by a bound in `is_transmutable` --> $DIR/bool.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/primitives/numbers.rs b/src/test/ui/transmutability/primitives/numbers.rs index a5f79065d8aad..0df43d2045f72 100644 --- a/src/test/ui/transmutability/primitives/numbers.rs +++ b/src/test/ui/transmutability/primitives/numbers.rs @@ -9,7 +9,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/primitives/numbers.stderr b/src/test/ui/transmutability/primitives/numbers.stderr index 9b802a444e86a..7cb7ca8e6db52 100644 --- a/src/test/ui/transmutability/primitives/numbers.stderr +++ b/src/test/ui/transmutability/primitives/numbers.stderr @@ -4,15 +4,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope LL | assert::is_transmutable::< i8, i16>(); | ^^^ `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:63:40 @@ -20,15 +20,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope LL | assert::is_transmutable::< i8, u16>(); | ^^^ `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:64:40 @@ -36,15 +36,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope LL | assert::is_transmutable::< i8, i32>(); | ^^^ `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:65:40 @@ -52,15 +52,15 @@ error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope LL | assert::is_transmutable::< i8, f32>(); | ^^^ `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:66:40 @@ -68,15 +68,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope LL | assert::is_transmutable::< i8, u32>(); | ^^^ `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:67:40 @@ -84,15 +84,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< i8, u64>(); | ^^^ `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:68:40 @@ -100,15 +100,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< i8, i64>(); | ^^^ `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:69:40 @@ -116,15 +116,15 @@ error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< i8, f64>(); | ^^^ `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:70:39 @@ -132,15 +132,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope LL | assert::is_transmutable::< i8, u128>(); | ^^^^ `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:71:39 @@ -148,15 +148,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope LL | assert::is_transmutable::< i8, i128>(); | ^^^^ `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:73:40 @@ -164,15 +164,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope LL | assert::is_transmutable::< u8, i16>(); | ^^^ `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i16` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:74:40 @@ -180,15 +180,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope LL | assert::is_transmutable::< u8, u16>(); | ^^^ `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u16` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:75:40 @@ -196,15 +196,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope LL | assert::is_transmutable::< u8, i32>(); | ^^^ `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:76:40 @@ -212,15 +212,15 @@ error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope LL | assert::is_transmutable::< u8, f32>(); | ^^^ `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:77:40 @@ -228,15 +228,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope LL | assert::is_transmutable::< u8, u32>(); | ^^^ `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:78:40 @@ -244,15 +244,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< u8, u64>(); | ^^^ `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:79:40 @@ -260,15 +260,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< u8, i64>(); | ^^^ `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:80:40 @@ -276,15 +276,15 @@ error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< u8, f64>(); | ^^^ `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:81:39 @@ -292,15 +292,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope LL | assert::is_transmutable::< u8, u128>(); | ^^^^ `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:82:39 @@ -308,15 +308,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope LL | assert::is_transmutable::< u8, i128>(); | ^^^^ `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:84:40 @@ -324,15 +324,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope LL | assert::is_transmutable::< i16, i32>(); | ^^^ `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:85:40 @@ -340,15 +340,15 @@ error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope LL | assert::is_transmutable::< i16, f32>(); | ^^^ `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:86:40 @@ -356,15 +356,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope LL | assert::is_transmutable::< i16, u32>(); | ^^^ `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:87:40 @@ -372,15 +372,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< i16, u64>(); | ^^^ `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:88:40 @@ -388,15 +388,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< i16, i64>(); | ^^^ `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:89:40 @@ -404,15 +404,15 @@ error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< i16, f64>(); | ^^^ `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:90:39 @@ -420,15 +420,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< i16, u128>(); | ^^^^ `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:91:39 @@ -436,15 +436,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< i16, i128>(); | ^^^^ `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:93:40 @@ -452,15 +452,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope LL | assert::is_transmutable::< u16, i32>(); | ^^^ `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:94:40 @@ -468,15 +468,15 @@ error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope LL | assert::is_transmutable::< u16, f32>(); | ^^^ `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:95:40 @@ -484,15 +484,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope LL | assert::is_transmutable::< u16, u32>(); | ^^^ `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u32` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:96:40 @@ -500,15 +500,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< u16, u64>(); | ^^^ `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:97:40 @@ -516,15 +516,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< u16, i64>(); | ^^^ `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:98:40 @@ -532,15 +532,15 @@ error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< u16, f64>(); | ^^^ `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:99:39 @@ -548,15 +548,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< u16, u128>(); | ^^^^ `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:100:39 @@ -564,15 +564,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< u16, i128>(); | ^^^^ `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:102:40 @@ -580,15 +580,15 @@ error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< i32, u64>(); | ^^^ `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:103:40 @@ -596,15 +596,15 @@ error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< i32, i64>(); | ^^^ `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:104:40 @@ -612,15 +612,15 @@ error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< i32, f64>(); | ^^^ `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:105:39 @@ -628,15 +628,15 @@ error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< i32, u128>(); | ^^^^ `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:106:39 @@ -644,15 +644,15 @@ error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< i32, i128>(); | ^^^^ `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:108:40 @@ -660,15 +660,15 @@ error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< f32, u64>(); | ^^^ `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:109:40 @@ -676,15 +676,15 @@ error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< f32, i64>(); | ^^^ `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:110:40 @@ -692,15 +692,15 @@ error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< f32, f64>(); | ^^^ `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:111:39 @@ -708,15 +708,15 @@ error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< f32, u128>(); | ^^^^ `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:112:39 @@ -724,15 +724,15 @@ error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< f32, i128>(); | ^^^^ `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:114:40 @@ -740,15 +740,15 @@ error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope LL | assert::is_transmutable::< u32, u64>(); | ^^^ `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:115:40 @@ -756,15 +756,15 @@ error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope LL | assert::is_transmutable::< u32, i64>(); | ^^^ `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:116:40 @@ -772,15 +772,15 @@ error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope LL | assert::is_transmutable::< u32, f64>(); | ^^^ `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `f64` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:117:39 @@ -788,15 +788,15 @@ error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< u32, u128>(); | ^^^^ `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:118:39 @@ -804,15 +804,15 @@ error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< u32, i128>(); | ^^^^ `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:120:39 @@ -820,15 +820,15 @@ error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< u64, u128>(); | ^^^^ `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:121:39 @@ -836,15 +836,15 @@ error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< u64, i128>(); | ^^^^ `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:123:39 @@ -852,15 +852,15 @@ error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< i64, u128>(); | ^^^^ `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:124:39 @@ -868,15 +868,15 @@ error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< i64, i128>(); | ^^^^ `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:126:39 @@ -884,15 +884,15 @@ error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scop LL | assert::is_transmutable::< f64, u128>(); | ^^^^ `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `u128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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:127:39 @@ -900,15 +900,15 @@ error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scop LL | assert::is_transmutable::< f64, i128>(); | ^^^^ `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `i128` note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:12:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 57 previous errors diff --git a/src/test/ui/transmutability/primitives/unit.rs b/src/test/ui/transmutability/primitives/unit.rs index 86d4740300dff..1975a61de9882 100644 --- a/src/test/ui/transmutability/primitives/unit.rs +++ b/src/test/ui/transmutability/primitives/unit.rs @@ -5,11 +5,16 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/primitives/unit.stderr b/src/test/ui/transmutability/primitives/unit.stderr index cf27c0d17b337..8cabe44a0538c 100644 --- a/src/test/ui/transmutability/primitives/unit.stderr +++ b/src/test/ui/transmutability/primitives/unit.stderr @@ -1,18 +1,24 @@ error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. - --> $DIR/unit.rs:23:35 + --> $DIR/unit.rs:28:35 | LL | assert::is_transmutable::<(), u8, Context>(); | ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`. | - = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, true, true, true, true>` is not implemented for `u8` + = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8` note: required by a bound in `is_transmutable` --> $DIR/unit.rs:12:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/references.rs b/src/test/ui/transmutability/references.rs index c6fd4c43e95c0..af3ff0ec1d205 100644 --- a/src/test/ui/transmutability/references.rs +++ b/src/test/ui/transmutability/references.rs @@ -5,12 +5,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/references.stderr b/src/test/ui/transmutability/references.stderr index 17ffcf64177e3..e9c7b144a826c 100644 --- a/src/test/ui/transmutability/references.stderr +++ b/src/test/ui/transmutability/references.stderr @@ -1,18 +1,25 @@ error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. - --> $DIR/references.rs:19:52 + --> $DIR/references.rs:26:52 | LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); | ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, true, true, true, true>` is not implemented for `&'static Unit` + = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit` note: required by a bound in `is_maybe_transmutable` --> $DIR/references.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/structs/repr/should_handle_align.rs b/src/test/ui/transmutability/structs/repr/should_handle_align.rs index 71720165ab063..ea9bf2a237ed3 100644 --- a/src/test/ui/transmutability/structs/repr/should_handle_align.rs +++ b/src/test/ui/transmutability/structs/repr/should_handle_align.rs @@ -6,12 +6,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/structs/repr/should_handle_packed.rs b/src/test/ui/transmutability/structs/repr/should_handle_packed.rs index ae8acf5041897..17dc995fcd961 100644 --- a/src/test/ui/transmutability/structs/repr/should_handle_packed.rs +++ b/src/test/ui/transmutability/structs/repr/should_handle_packed.rs @@ -6,12 +6,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs index 556be989dbc25..9a65b4d702da6 100644 --- a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs +++ b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs @@ -5,12 +5,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr index 07355f7c2ad26..621dbee849f0c 100644 --- a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr +++ b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr @@ -1,194 +1,278 @@ error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:21:52 + --> $DIR/should_require_well_defined_layout.rs:28:52 | LL | assert::is_maybe_transmutable::(); | ^^ `should_reject_repr_rust::unit::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:22:47 + --> $DIR/should_require_well_defined_layout.rs:29:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::unit::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::unit::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::unit::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:27:52 + --> $DIR/should_require_well_defined_layout.rs:34:52 | LL | assert::is_maybe_transmutable::(); | ^^ `should_reject_repr_rust::tuple::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:28:47 + --> $DIR/should_require_well_defined_layout.rs:35:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::tuple::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::tuple::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::tuple::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:33:52 + --> $DIR/should_require_well_defined_layout.rs:40:52 | LL | assert::is_maybe_transmutable::(); | ^^ `should_reject_repr_rust::braces::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:34:47 + --> $DIR/should_require_well_defined_layout.rs:41:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::braces::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::braces::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::braces::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:39:52 + --> $DIR/should_require_well_defined_layout.rs:46:52 | LL | assert::is_maybe_transmutable::(); | ^^ `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:40:47 + --> $DIR/should_require_well_defined_layout.rs:47:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `aligned::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `aligned::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:45:52 + --> $DIR/should_require_well_defined_layout.rs:52:52 | LL | assert::is_maybe_transmutable::(); | ^^ `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:46:47 + --> $DIR/should_require_well_defined_layout.rs:53:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `packed::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `packed::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:52:49 + --> $DIR/should_require_well_defined_layout.rs:59:49 | LL | assert::is_maybe_transmutable::(); | ^^ `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:53:47 + --> $DIR/should_require_well_defined_layout.rs:60:47 | LL | assert::is_maybe_transmutable::(); | ^^^^^^ `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `nested::repr_c` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `nested::repr_c` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error: aborting due to 12 previous errors diff --git a/src/test/ui/transmutability/structs/should_order_fields_correctly.rs b/src/test/ui/transmutability/structs/should_order_fields_correctly.rs index db49b914fe065..28724562bad2c 100644 --- a/src/test/ui/transmutability/structs/should_order_fields_correctly.rs +++ b/src/test/ui/transmutability/structs/should_order_fields_correctly.rs @@ -6,12 +6,17 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/boolish.rs b/src/test/ui/transmutability/unions/boolish.rs index 975118b99b7ba..e469c497353bb 100644 --- a/src/test/ui/transmutability/unions/boolish.rs +++ b/src/test/ui/transmutability/unions/boolish.rs @@ -7,12 +7,12 @@ #![allow(incomplete_features)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/repr/should_handle_align.rs b/src/test/ui/transmutability/unions/repr/should_handle_align.rs index e215799a23240..09c13cc4dc759 100644 --- a/src/test/ui/transmutability/unions/repr/should_handle_align.rs +++ b/src/test/ui/transmutability/unions/repr/should_handle_align.rs @@ -6,12 +6,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/repr/should_handle_packed.rs b/src/test/ui/transmutability/unions/repr/should_handle_packed.rs index 34a53c7a80c42..24c2abd698e70 100644 --- a/src/test/ui/transmutability/unions/repr/should_handle_packed.rs +++ b/src/test/ui/transmutability/unions/repr/should_handle_packed.rs @@ -6,12 +6,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs index cec8e389f444e..b1d5f71dcc585 100644 --- a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs +++ b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs @@ -5,12 +5,19 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr index 2ed01b159ab0b..523bde85adfa9 100644 --- a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr +++ b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr @@ -1,34 +1,48 @@ error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:23:48 + --> $DIR/should_require_well_defined_layout.rs:30:48 | LL | assert::is_maybe_transmutable::(); | ^^ `should_reject_repr_rust::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `()` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`. - --> $DIR/should_require_well_defined_layout.rs:24:43 + --> $DIR/should_require_well_defined_layout.rs:31:43 | LL | assert::is_maybe_transmutable::(); | ^^^^^^^^^ `u128` cannot be safely transmuted into `should_reject_repr_rust::repr_rust` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::repr_rust` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `should_reject_repr_rust::repr_rust` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 | -LL | pub fn is_maybe_transmutable() - | --------------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | pub fn is_maybe_transmutable() + | --------------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_maybe_transmutable` error: aborting due to 2 previous errors diff --git a/src/test/ui/transmutability/unions/should_pad_variants.rs b/src/test/ui/transmutability/unions/should_pad_variants.rs index c4757900f9c3e..cabe544677e0f 100644 --- a/src/test/ui/transmutability/unions/should_pad_variants.rs +++ b/src/test/ui/transmutability/unions/should_pad_variants.rs @@ -6,11 +6,16 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/should_pad_variants.stderr b/src/test/ui/transmutability/unions/should_pad_variants.stderr index 429f7211d17a8..a823503d594e9 100644 --- a/src/test/ui/transmutability/unions/should_pad_variants.stderr +++ b/src/test/ui/transmutability/unions/should_pad_variants.stderr @@ -1,18 +1,24 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`. - --> $DIR/should_pad_variants.rs:39:36 + --> $DIR/should_pad_variants.rs:44:36 | LL | assert::is_transmutable::(); | ^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 | -LL | pub fn is_transmutable() - | --------------- required by a bound in this -LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | pub fn is_transmutable() + | --------------- required by a bound in this +LL | where +LL | Dst: BikeshedIntrinsicFrom + | |__________^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs b/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs index 2493d71554ad3..1007fdd795422 100644 --- a/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs +++ b/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs @@ -7,13 +7,12 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom - // validity IS assumed --------------------------------^^^^ + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/should_reject_contraction.rs b/src/test/ui/transmutability/unions/should_reject_contraction.rs index e8138d0e046c5..a24dfccd3187d 100644 --- a/src/test/ui/transmutability/unions/should_reject_contraction.rs +++ b/src/test/ui/transmutability/unions/should_reject_contraction.rs @@ -5,12 +5,12 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/should_reject_contraction.stderr b/src/test/ui/transmutability/unions/should_reject_contraction.stderr index 99f5890081728..41f0cedc3a311 100644 --- a/src/test/ui/transmutability/unions/should_reject_contraction.stderr +++ b/src/test/ui/transmutability/unions/should_reject_contraction.stderr @@ -4,15 +4,15 @@ error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defini LL | assert::is_transmutable::(); | ^^^^^^ `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Subset` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Subset` note: required by a bound in `is_transmutable` --> $DIR/should_reject_contraction.rs:13:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/unions/should_reject_disjoint.rs b/src/test/ui/transmutability/unions/should_reject_disjoint.rs index 16160e29a5469..43aaa6905fd4f 100644 --- a/src/test/ui/transmutability/unions/should_reject_disjoint.rs +++ b/src/test/ui/transmutability/unions/should_reject_disjoint.rs @@ -5,13 +5,12 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_maybe_transmutable() where - Dst: BikeshedIntrinsicFrom - // validity IS assumed --------------------------------^^^^ + Dst: BikeshedIntrinsicFrom {} } diff --git a/src/test/ui/transmutability/unions/should_reject_disjoint.stderr b/src/test/ui/transmutability/unions/should_reject_disjoint.stderr index 5714e2bf320c5..4323f9740665f 100644 --- a/src/test/ui/transmutability/unions/should_reject_disjoint.stderr +++ b/src/test/ui/transmutability/unions/should_reject_disjoint.stderr @@ -1,34 +1,34 @@ error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`. - --> $DIR/should_reject_disjoint.rs:34:40 + --> $DIR/should_reject_disjoint.rs:33:40 | LL | assert::is_maybe_transmutable::(); | ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `B` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `B` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_reject_disjoint.rs:13:14 | LL | pub fn is_maybe_transmutable() | --------------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`. - --> $DIR/should_reject_disjoint.rs:35:40 + --> $DIR/should_reject_disjoint.rs:34:40 | LL | assert::is_maybe_transmutable::(); | ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `A` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `A` note: required by a bound in `is_maybe_transmutable` --> $DIR/should_reject_disjoint.rs:13:14 | LL | pub fn is_maybe_transmutable() | --------------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable` error: aborting due to 2 previous errors diff --git a/src/test/ui/transmutability/unions/should_reject_intersecting.rs b/src/test/ui/transmutability/unions/should_reject_intersecting.rs index 58e399fb96225..9cd4233ee7455 100644 --- a/src/test/ui/transmutability/unions/should_reject_intersecting.rs +++ b/src/test/ui/transmutability/unions/should_reject_intersecting.rs @@ -6,13 +6,13 @@ #![allow(dead_code, incomplete_features, non_camel_case_types)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub struct Context; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // validity is NOT assumed ----------------------------^^^^^ + Dst: BikeshedIntrinsicFrom + // validity is NOT assumed --------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/unions/should_reject_intersecting.stderr b/src/test/ui/transmutability/unions/should_reject_intersecting.stderr index 92689a5f828b4..e009888ae8d31 100644 --- a/src/test/ui/transmutability/unions/should_reject_intersecting.stderr +++ b/src/test/ui/transmutability/unions/should_reject_intersecting.stderr @@ -4,15 +4,15 @@ error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of LL | assert::is_transmutable::(); | ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `B` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `B` note: required by a bound in `is_transmutable` --> $DIR/should_reject_intersecting.rs:14:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`. --> $DIR/should_reject_intersecting.rs:37:34 @@ -20,15 +20,15 @@ error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of LL | assert::is_transmutable::(); | ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `A` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `A` note: required by a bound in `is_transmutable` --> $DIR/should_reject_intersecting.rs:14:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 2 previous errors diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs index 5a8c810494c58..8a41669c65e74 100644 --- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs +++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs @@ -7,12 +7,12 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility IS assumed -------------------------------------^^^^ + Dst: BikeshedIntrinsicFrom + // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs index 77ab4fa6bff4b..dd57b877d78c0 100644 --- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs +++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs @@ -7,12 +7,12 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility IS assumed -------------------------------------^^^^ + Dst: BikeshedIntrinsicFrom + // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs index 2421b24cbf07f..ebce8ce87dfda 100644 --- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs +++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs @@ -13,12 +13,12 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility IS assumed -------------------------------------^^^^ + Dst: BikeshedIntrinsicFrom + // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs index 80b454fda560f..546fcbaa3de23 100644 --- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs +++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs @@ -8,12 +8,12 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility IS assumed -------------------------------------^^^^ + Dst: BikeshedIntrinsicFrom + // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs index 7c53c91e4eda7..b9b74d18338af 100644 --- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs +++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs @@ -8,12 +8,12 @@ #![allow(dead_code)] mod assert { - use std::mem::BikeshedIntrinsicFrom; + use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility IS assumed -------------------------------------^^^^ + Dst: BikeshedIntrinsicFrom + // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^ {} } diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs index c3f298f016325..5a0df09d49262 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs @@ -11,8 +11,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs index 73f6aece51eb5..0f69630cc64fa 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs @@ -11,8 +11,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs index 6d602601e96ab..9c8345a8e91a9 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs @@ -11,8 +11,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr index 3f7d08d0ae248..39b73302e364d 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr @@ -1,5 +1,5 @@ error[E0446]: private type `src::Zst` in public interface - --> $DIR/should_accept_if_src_has_unreachable_field.rs:23:9 + --> $DIR/should_accept_if_src_has_unreachable_field.rs:22:9 | LL | #[repr(C)] pub(self) struct Zst; // <- unreachable type | -------------------- `src::Zst` declared as private diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs index 1943fb8716a11..acf9f2302500a 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs @@ -11,8 +11,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr index e961984e18932..76dc7f3407555 100644 --- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr +++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr @@ -1,11 +1,11 @@ error[E0603]: struct `Src` is private - --> $DIR/should_accept_if_src_has_unreachable_ty.rs:38:36 + --> $DIR/should_accept_if_src_has_unreachable_ty.rs:37:36 | LL | assert::is_transmutable::(); | ^^^ private struct | note: the struct `Src` is defined here - --> $DIR/should_accept_if_src_has_unreachable_ty.rs:23:16 + --> $DIR/should_accept_if_src_has_unreachable_ty.rs:22:16 | LL | #[repr(C)] pub(self) struct Src { | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs index fcf3f3a527805..e8c3fbc9a0469 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs @@ -10,8 +10,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr index 85124019e7f03..d5d6d431b6f62 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr @@ -1,18 +1,18 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. - --> $DIR/should_reject_if_dst_has_private_field.rs:36:41 + --> $DIR/should_reject_if_dst_has_private_field.rs:35:41 | LL | assert::is_transmutable::(); | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_reject_if_dst_has_private_field.rs:13:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs index 566b56467124f..47bca27abaa88 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs @@ -10,8 +10,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr index 0be564d93e2d8..a1ca2ced53f29 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr @@ -1,18 +1,18 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. - --> $DIR/should_reject_if_dst_has_private_variant.rs:37:41 + --> $DIR/should_reject_if_dst_has_private_variant.rs:36:41 | LL | assert::is_transmutable::(); | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_reject_if_dst_has_private_variant.rs:13:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs index 35fff5966c85b..662c32af17aa8 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs @@ -23,8 +23,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs index 42799d803b028..d7e21676fd385 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs @@ -12,8 +12,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr index 95c68d452010b..4e648664d5abb 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr @@ -1,18 +1,18 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. - --> $DIR/should_reject_if_dst_has_unreachable_field.rs:38:41 + --> $DIR/should_reject_if_dst_has_unreachable_field.rs:37:41 | LL | assert::is_transmutable::(); | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_reject_if_dst_has_unreachable_field.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to previous error diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs index e13b32b30d964..c7b59f15b99cc 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs @@ -12,8 +12,7 @@ mod assert { pub fn is_transmutable() where - Dst: BikeshedIntrinsicFrom - // visibility is NOT assumed ---------------------------------^^^^^ + Dst: BikeshedIntrinsicFrom // safety is NOT assumed {} } diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr index 3391839e39e02..bd72d64ccd75f 100644 --- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr +++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr @@ -1,30 +1,30 @@ error[E0603]: struct `Dst` is private - --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:39:46 + --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:46 | LL | assert::is_transmutable::(); | ^^^ private struct | note: the struct `Dst` is defined here - --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:32:16 + --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:31:16 | LL | #[repr(C)] pub(self) struct Dst { | ^^^^^^^^^^^^^^^^^^^^ error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. - --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:39:41 + --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:41 | LL | assert::is_transmutable::(); | ^^^^^^^^ `Src` cannot be safely transmuted into `Dst` in the defining scope of `test::Context`. | - = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` + = help: the trait `BikeshedIntrinsicFrom` is not implemented for `Dst` note: required by a bound in `is_transmutable` --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:15:14 | LL | pub fn is_transmutable() | --------------- required by a bound in this LL | where -LL | Dst: BikeshedIntrinsicFrom - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` +LL | Dst: BikeshedIntrinsicFrom // safety is NOT assumed + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error: aborting due to 2 previous errors