diff --git a/codegen/Cargo.bootstrap.toml b/codegen/Cargo.bootstrap.toml index ad18aba78d..3ef934e8b1 100644 --- a/codegen/Cargo.bootstrap.toml +++ b/codegen/Cargo.bootstrap.toml @@ -5,13 +5,16 @@ version = "0.1.0" edition = "2024" [dependencies] + +# {{ANALYZED_CRATE}} bevy_mod_scripting_bindings = { path = "{{BMS_BINDINGS_PATH}}" } -bevy_reflect = { version = "0.17", features = [ - "smol_str", - "glam", - "petgraph", - "smallvec", - "uuid", -] } + +# bevy_reflect = { version = "0.17", features = [ +# "smol_str", +# "glam", +# "petgraph", +# "smallvec", +# "uuid", +# ] } [workspace] diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index f80a2dab8d..b55887d35d 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -62,6 +62,7 @@ syn = { version = "2", features = ["parsing"], default-features = false } itertools = "0.12" chrono = "0.4" pretty_assertions = "1.3" +regex = "1" [dependencies] crate_feature_graph = { workspace = true, features = ["dot_parser", "serde"] } @@ -81,6 +82,7 @@ serde = { workspace = true, features = ["std"] } prettyplease = { workspace = true } convert_case = { workspace = true } chrono = { workspace = true } +regex = { workspace = true } [build-dependencies] toml = "0.8" diff --git a/codegen/crates/crate_feature_graph/bin/main.rs b/codegen/crates/crate_feature_graph/bin/main.rs index 8902dbafea..1acb454c35 100644 --- a/codegen/crates/crate_feature_graph/bin/main.rs +++ b/codegen/crates/crate_feature_graph/bin/main.rs @@ -48,7 +48,7 @@ pub fn main() -> std::io::Result<()> { let mut graph = WorkspaceGraph::from(workspace); let root = args.root_package; - log::info!( + log::debug!( "Calculating features for root: {:?} with features: {:?}, default features: {}", root, args.features, diff --git a/codegen/crates/crate_feature_graph/src/feature.rs b/codegen/crates/crate_feature_graph/src/feature.rs index d3471b42e3..04a4849dd1 100644 --- a/codegen/crates/crate_feature_graph/src/feature.rs +++ b/codegen/crates/crate_feature_graph/src/feature.rs @@ -17,6 +17,12 @@ use log::error; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct CrateName(pub(crate) String); +impl AsRef for CrateName { + fn as_ref(&self) -> &str { + &self.0 + } +} + impl<'a, T: Borrow> From<&'a T> for CrateName { fn from(pkg: &'a T) -> Self { CrateName(pkg.borrow().name.clone()) diff --git a/codegen/crates/crate_feature_graph/src/graph.rs b/codegen/crates/crate_feature_graph/src/graph.rs index e04418189d..44a92505a6 100644 --- a/codegen/crates/crate_feature_graph/src/graph.rs +++ b/codegen/crates/crate_feature_graph/src/graph.rs @@ -227,7 +227,7 @@ impl WorkspaceGraph { // finally filter out nodes we don't want to show but connect edges if !only_show_crates.is_empty() { - log::info!("Filtering to only show crates: {only_show_crates:?}"); + log::debug!("Filtering to only show crates: {only_show_crates:?}"); let only_show_crates: HashSet<_> = only_show_crates .into_iter() .map(|s| s.to_string()) @@ -237,14 +237,14 @@ impl WorkspaceGraph { .filter(|c| !only_show_crates.contains(&c.to_string())) .collect(); - log::info!( + log::debug!( "Removing and interconnecting {} nodes, out of {}", to_remove.len(), visualiser_graph.node_count() ); for n in to_remove { - log::info!("Removing node {n}"); + log::debug!("Removing node {n}"); let node_index = match visualiser_graph.find_node_by_opt(|node| node.contains(&n.to_string())) { Some(n) => n, @@ -408,7 +408,7 @@ impl WorkspaceGraph { } } - log::info!("Parsed features map: {features_map:?}"); + log::debug!("Parsed features map: {features_map:?}"); self.calculate_enabled_features_and_dependencies(features_map, false); } @@ -454,7 +454,7 @@ impl WorkspaceGraph { open_set.extend(enabled_crates.keys().cloned()); - log::info!("Starting feature calculation with open set: {open_set:?}"); + log::debug!("Starting feature calculation with open set: {open_set:?}"); while let Some(krate) = open_set.pop_front() { log::trace!("Processing crate `{krate}`"); diff --git a/codegen/src/args.rs b/codegen/src/args.rs index 815bcbf50f..f5e712c5b6 100644 --- a/codegen/src/args.rs +++ b/codegen/src/args.rs @@ -284,6 +284,7 @@ impl WorkspaceMeta { /// Returns true if the given crate is in the workspace and if the plugin will run on it pub fn is_workspace_and_included_crate(&self, crate_name: &str) -> bool { + // TODO: temp self.include_crates .as_ref() .map(|include_crates| include_crates.contains(&crate_name.to_owned())) diff --git a/codegen/src/bin/driver.rs b/codegen/src/bin/driver.rs index c01c637a3d..0988bec427 100644 --- a/codegen/src/bin/driver.rs +++ b/codegen/src/bin/driver.rs @@ -1,5 +1,5 @@ #![feature(rustc_private)] -use bevy_mod_scripting_codegen::{driver::driver_main, *}; +use bevy_mod_scripting_codegen::{driver::rustc_driver_main, *}; // use rustc_log::LoggerConfig; extern crate rustc_log; @@ -10,5 +10,5 @@ fn main() { .parse_filters(&std::env::var("RUST_LOG").unwrap_or_else(|_| "warn".into())) .init(); - driver_main(BevyAnalyzer); + rustc_driver_main(BevyAnalyzer::initialize_from_env()); } diff --git a/codegen/src/bin/main.rs b/codegen/src/bin/main.rs index 2910caf82a..73d76df2a9 100644 --- a/codegen/src/bin/main.rs +++ b/codegen/src/bin/main.rs @@ -9,14 +9,15 @@ use std::{ }; use bevy_mod_scripting_codegen::{driver::*, *}; -use cargo_metadata::camino::{Utf8Path, Utf8PathBuf}; +use cargo_metadata::camino::Utf8PathBuf; use clap::Parser; -use crate_feature_graph::{Workspace, WorkspaceGraph}; -use log::{debug, error, info}; +use crate_feature_graph::{Crate, Workspace, WorkspaceGraph}; +use log::{debug, error}; use strum::VariantNames; use tera::Context; const BOOTSTRAP_DEPS: [&str; 2] = ["bevy_reflect", "bevy_mod_scripting_bindings"]; +// const INJECT_DEPS: [&str; 1] = ["bevy_mod_scripting_bindings"]; fn main() { // parse this here to early exit on wrong args @@ -27,41 +28,43 @@ fn main() { } pretty_env_logger::init(); - info!("Using RUST_LOG: {:?}", env::var("RUST_LOG")); + debug!("Using RUST_LOG: {:?}", env::var("RUST_LOG")); - info!( + debug!( "MSRV target: {}", args.mrsv_target() .map(|t| t.to_string()) .unwrap_or(String::from("unset")) ); - info!("Computing crate metadata"); + debug!("Computing crate metadata"); let metadata = cargo_metadata::MetadataCommand::new() .no_deps() .other_options(["--all-features".to_string(), "--offline".to_string()]) .exec() .unwrap(); + let root_crate = &metadata.root_package().unwrap().name; + let crates = metadata .workspace_packages() .iter() .map(|p| p.name.to_owned()) .collect::>(); - info!("Computing active features"); + debug!("Computing active features"); let include_crates = if !args.cmd.is_collect() { let workspace = Workspace::from(&metadata); let mut graph = WorkspaceGraph::from(workspace); - info!("Using workspace graph: \n{}", graph.to_dot()); + debug!("Using workspace graph: \n{}", graph.to_dot()); - info!( + debug!( "Computing all transitive dependencies for enabled top-level features: {}. using default features: {}", args.features.join(","), !args.no_default_features ); - graph.calculate_enabled_features_and_dependencies_parse(args.features, None); + graph.calculate_enabled_features_and_dependencies_parse(args.features.clone(), None); let mut dependencies = graph .workspace @@ -76,13 +79,13 @@ fn main() { if let Some(excluded_crates) = &args.exclude_crates { dependencies.retain(|c| !excluded_crates.contains(c)); - info!("Excluding crates: {excluded_crates:?}"); + debug!("Excluding crates: {excluded_crates:?}"); } let graph_path = PathBuf::from(fetch_target_directory(&metadata).join("workspace_graph.dot")); graph.serialize(&graph_path).unwrap(); - info!("Serialized workspace graph to: {}", graph_path.display()); + debug!("Serialized workspace graph to: {}", graph_path.display()); unsafe { std::env::set_var(WORKSPACE_GRAPH_FILE_ENV, graph_path) }; Some(dependencies) @@ -93,7 +96,7 @@ fn main() { let plugin_subdir = format!("plugin-{}", env!("RUSTC_CHANNEL")); let plugin_target_dir = metadata.target_directory.join(plugin_subdir); - info!("Computing workspace metadata"); + debug!("Computing workspace metadata"); // inform the deps about the workspace crates, this is going to be useful when working with meta files as we will be able to // know when to panic if a crate is not found @@ -129,7 +132,7 @@ fn main() { api_name, } => { let tera = configure_tera("no_crate", &templates); - info!("Collecting from: {output}"); + debug!("Collecting from: {output}"); if !output.is_dir() { panic!("Output is not a directory"); } @@ -168,7 +171,7 @@ fn main() { tera.render_to(&TemplateKind::SharedModule.to_string(), &context, &mut file) .expect("Failed to render mod.rs"); file.flush().unwrap(); - log::info!("Succesfully generated mod.rs"); + log::debug!("Succesfully generated mod.rs"); // put json of Collect context into stdout std::io::stdout() @@ -183,45 +186,40 @@ fn main() { debug!("Bootstrap directory: {}", &temp_dir.as_path().display()); - write_bootstrap_files(args.bms_bindings_path, temp_dir.as_path()); + write_bootstrap_files( + args.bms_bindings_path, + root_crate, + &PathBuf::from("."), + args.features.iter().map(|s| s.as_str()), + temp_dir.as_path(), + ); - let bootstrap_rlibs = build_bootstrap(temp_dir.as_path(), &plugin_target_dir.join("bootstrap")); - - if bootstrap_rlibs.len() == BOOTSTRAP_DEPS.len() { - let extern_args = bootstrap_rlibs - .iter() - .map(|(key, val)| format!("--extern {key}={val}",)) - .collect::>() - .join(" "); - - debug!("bootstrap paths: {bootstrap_rlibs:?}"); - unsafe { - env::set_var( - "RUSTFLAGS", - format!( - "{} {} -L dependency={}", - env::var("RUSTFLAGS").unwrap_or("".to_owned()), - extern_args, - bootstrap_rlibs.iter().next().unwrap().1.parent().unwrap() - ), - ) - }; - } else { - panic!("Could not find all bootstrap rlibs, found: {bootstrap_rlibs:?}"); - } + let bootstrap_rlibs = build_bootstrap(temp_dir.as_path()); debug!("Running bevy_api_gen main cargo command"); - debug!("RUSTFLAGS={}", env::var("RUSTFLAGS").unwrap_or_default()); - // disable incremental compilation unsafe { env::set_var("CARGO_INCREMENTAL", "0") }; - driver::cli_main( - BevyAnalyzer, - workspace_meta.include_crates.unwrap_or_default(), - &metadata, - ); + let analyzer = BevyAnalyzer { + args: crate::Args::parse_from(std::env::args().skip(1)), + payload: Payload { + bootstrap_rlibs: bootstrap_rlibs + .into_iter() + .map(|(a, b)| (a, b.to_string())) + .collect(), + include_crates: workspace_meta.include_crates.unwrap_or_default(), + bootstrap_deps_path: temp_dir + .join("target") + .join("debug") + .join("deps") + .to_str() + .unwrap() + .to_string(), + }, + }; + + driver::cli_main(analyzer, &metadata); // just making sure the temp dir lives until everything is done drop(temp_dir); @@ -229,23 +227,9 @@ fn main() { /// Build bootstrap files if they don't exist /// use cached ones otherwise -fn build_bootstrap( - temp_dir: &Path, - cache_dir: &Utf8Path, -) -> HashMap { +fn build_bootstrap(temp_dir: &Path) -> HashMap { debug!("Building bootstrapping crate"); - // first check cache - if cache_dir.exists() { - let mut bootstrap_rlibs = HashMap::with_capacity(BOOTSTRAP_DEPS.len()); - for entry in std::fs::read_dir(cache_dir).unwrap() { - let entry = entry.unwrap(); - let artifact = entry.path(); - process_artifact(artifact.try_into().unwrap(), &mut bootstrap_rlibs); - } - return bootstrap_rlibs; - } - // run build command let mut cmd = Command::new("cargo") .current_dir(temp_dir) @@ -255,7 +239,7 @@ fn build_bootstrap( .spawn() .unwrap(); - info!( + debug!( "cd {} && cargo build --message-format=json", temp_dir.display() ); @@ -263,8 +247,6 @@ fn build_bootstrap( let reader = std::io::BufReader::new(cmd.stdout.take().unwrap()); let err_reader = std::io::BufReader::new(cmd.stderr.take().unwrap()); - std::fs::create_dir_all(cache_dir).unwrap(); - let mut bootstrap_rlibs = HashMap::with_capacity(BOOTSTRAP_DEPS.len()); for msg in cargo_metadata::Message::parse_stream(reader) { let msg = msg.unwrap(); @@ -280,49 +262,70 @@ fn build_bootstrap( } } cargo_metadata::Message::TextLine(t) => { - info!("{t}"); + debug!("{t}"); } cargo_metadata::Message::CompilerMessage(msg) => { - info!("{msg}"); + debug!("{msg}"); } _ => {} } } } + + let fail = match cmd.wait() { + Ok(status) => { + if !status.success() { + true + // panic!("Building bootstrap crate returned a failure status code, {}",); + } else { + false + } + } + Err(_) => { + // panic!("Failed to wait on cargo build process: {e}"); + true + } + }; + for msg in err_reader.lines() { if let Ok(line) = msg { - info!("{line}"); + if fail { + println!("{line}"); + } } else { panic!("Failed to read cargo stderr"); } } - // cache bootstrap artifacts - if let Some(artifact) = bootstrap_rlibs.values().next() { - let deps_dir = artifact.parent().unwrap(); - - for dir in std::fs::read_dir(deps_dir).unwrap() { - let dir = dir.unwrap(); - let path = dir.path(); - - let dest = cache_dir.join(path.file_name().unwrap().to_str().unwrap()); - std::fs::copy(path, dest).unwrap(); - } - } - match cmd.wait() { - Ok(status) => { - if !status.success() { - panic!("Building bootstrap crate returned a failure status code"); - } - } - Err(e) => { - panic!("Failed to wait on cargo build process: {e}"); - } + if fail { + panic!("failed to build bootstrap crate"); } + let include_list: [&'static str; 13] = [ + "bevy_reflect", + "bevy_mod_scripting_bindings", + "bevy_ptr", + "bevy_utils", + "bevy_reflect_derive", + "bevy_platform", + "bevy_utils", + "serde", + "serde_core", + "glam", + "uuid", + "smallvec", + "hashbrown", + ]; + // for c in exclude_list { + // bootstrap_rlibs.remove(c); + // } + bootstrap_rlibs.retain(|k, _| include_list.contains(&k.as_str())); + bootstrap_rlibs } +const LINKABLE_EXTENSIONS: [&str; 3] = ["rlib", "so", "dll"]; + /// Process artifact and add it to the bootstrap rlibs if it's is for a bootstrap dependency and an rlib fn process_artifact( artifact: cargo_metadata::camino::Utf8PathBuf, @@ -332,8 +335,9 @@ fn process_artifact( let lib_name = file_name.split('-').next().unwrap().strip_prefix("lib"); if let Some(lib_name) = lib_name - && BOOTSTRAP_DEPS.contains(&lib_name) - && artifact.extension().is_some_and(|ext| ext == "rlib") + && artifact + .extension() + .is_some_and(|ext| LINKABLE_EXTENSIONS.contains(&ext)) { bootstrap_rlibs.insert(lib_name.to_owned(), artifact); } @@ -361,17 +365,46 @@ fn find_bootstrap_dir() -> PathBuf { path } +impl CrateRef { + pub fn into_toml_key_val(self) -> String { + match self { + CrateRef::Path(p) => format!("path = \"{p}\""), + CrateRef::Version(v) => format!("version = \"{v}\""), + } + } +} + /// Generate bootstrapping crate files -fn write_bootstrap_files(bms_bindings_path: Utf8PathBuf, path: &Path) { - const BMS_BINDINGS_PATH_PLACEHOLDER: &str = "{{BMS_BINDINGS_PATH}}"; +fn write_bootstrap_files<'a>( + bms_bindings_path: Utf8PathBuf, + dependencies: HashMap, + path: &Path, +) { + // const BMS_BINDINGS_PATH_PLACEHOLDER: &str = "{{BMS_BINDINGS_PATH}}"; + const DEPENDENCIES_PATH_PLACEHOLDER: &str = "{{DEPENDENCIES}}"; // write manifest file 'Cargo.toml' let mut manifest_content = String::from_utf8(include_bytes!("../../Cargo.bootstrap.toml").to_vec()) .expect("Could not read manifest template as utf8"); - manifest_content = - manifest_content.replace(BMS_BINDINGS_PATH_PLACEHOLDER, bms_bindings_path.as_str()); + let dependencies = dependencies + .into_iter() + .map(|krate, (version, features)| format!("{} = {{ {}}}", krate.into_toml_key_val(),)); + + manifest_content = manifest_content + .replace(DEPENDENCIES_PATH_PLACEHOLDER, bms_bindings_path.as_str()) + .replace( + ANALYSED_CRATE_PATH_PLACEHOLDER, + &format!( + "{analysed_crate_name} = {{ path = \"{}\", features = [{}]}}", + analysed_crate_path.to_string_lossy(), + analysed_crate_features + .map(|f| format!("\"{f}\"")) + .collect::>() + .join(",") + ), + ); let manifest_path = path.join("Cargo.toml"); diff --git a/codegen/src/callback.rs b/codegen/src/callback.rs deleted file mode 100644 index 8bb951ce61..0000000000 --- a/codegen/src/callback.rs +++ /dev/null @@ -1,109 +0,0 @@ -use std::path::PathBuf; - -use crate_feature_graph::WorkspaceGraph; -use log::{info, trace}; -use rustc_hir::def_id::LOCAL_CRATE; -use tera::Context; - -use crate::{ - ALL_PASSES, Args, TemplateKind, WorkspaceMeta, driver::WORKSPACE_GRAPH_FILE_ENV, - modifying_file_loader::ModifyingFileLoader, -}; - -pub(crate) struct BevyAnalyzerCallbacks { - args: Args, -} - -impl BevyAnalyzerCallbacks { - pub(crate) fn new(args: Args) -> Self { - Self { args } - } -} - -impl rustc_driver::Callbacks for BevyAnalyzerCallbacks { - fn after_expansion( - &mut self, - compiler: &rustc_interface::interface::Compiler, - tcx: rustc_middle::ty::TyCtxt<'_>, - ) -> rustc_driver::Compilation { - trace!("After expansion callback"); - - let sess = &compiler.sess; - - if sess.dcx().has_errors().is_some() { - sess.dcx().fatal("compilation failed, aborting analysis."); - } - - let mut meta_dirs = Vec::default(); - let mut templates_dir = None; - // add all relevant meta dirs to the context - meta_dirs.push(self.args.output.to_owned()); - if let crate::Command::Generate { - meta, - meta_output, - templates, - .. - } = &self.args.cmd - { - templates.clone_into(&mut templates_dir); - if let Some(meta_output) = meta_output { - meta_dirs.push(meta_output.to_owned()) - }; - meta.iter() - .flatten() - .for_each(|m| meta_dirs.push(m.to_owned())); - }; - - let include_private = match &self.args.cmd { - crate::Command::Generate { - include_private, .. - } => *include_private, - _ => false, - }; - - // tera environment for import processor - let tera = crate::configure_tera(tcx.crate_name(LOCAL_CRATE).as_str(), &templates_dir); - - info!("Using meta directories: {meta_dirs:?}"); - - let mut graph = WorkspaceGraph::deserialize(&PathBuf::from( - std::env::var(WORKSPACE_GRAPH_FILE_ENV).unwrap(), - )) - .unwrap(); - graph.stable_sort(); - - let mut ctxt = crate::BevyCtxt::new( - tcx, - &meta_dirs, - WorkspaceMeta::from_env(), - include_private, - Some(Box::new(move |import_path| { - let mut ctxt = Context::new(); - ctxt.insert("import", import_path); - tera.render(&TemplateKind::ImportProcessor.to_string(), &ctxt) - .unwrap() - })), - graph, - ); - - trace!("Running all passes"); - for p in ALL_PASSES { - info!( - "{}, in crate: {}", - p.description, - tcx.crate_name(LOCAL_CRATE), - ); - let continue_ = tcx.sess.time(p.name, || (p.cb)(&mut ctxt, &self.args)); - if !continue_ { - break; - } - trace!("Finished pass, continuing"); - } - - rustc_driver::Compilation::Continue - } - - fn config(&mut self, config: &mut rustc_interface::interface::Config) { - config.file_loader = Some(Box::new(ModifyingFileLoader)); - } -} diff --git a/codegen/src/candidate.rs b/codegen/src/candidate.rs index 68c2ca5d75..62b79012d0 100644 --- a/codegen/src/candidate.rs +++ b/codegen/src/candidate.rs @@ -169,6 +169,8 @@ impl FieldCandidate { #[derive(Debug, Clone)] pub enum GenerationExclusionNote { Reason(String), + #[allow(dead_code)] + Section(&'static str), } impl std::fmt::Display for GenerationExclusionNote { @@ -176,6 +178,7 @@ impl std::fmt::Display for GenerationExclusionNote { f.write_str("Excluded: ")?; match self { GenerationExclusionNote::Reason(reason) => f.write_str(reason.as_str())?, + GenerationExclusionNote::Section(section) => f.write_str(section)?, } Ok(()) } @@ -353,14 +356,14 @@ impl<'n, 'tcx> AnnotationContextCollector<'n, 'tcx> { } pub fn annotate_field(&mut self, ctxt: &str, field: &'n FieldCandidate) { - let ctxt = format!("{ctxt}::{}", field.friendly_name(self.ctxt)); + let ctxt = format!("{ctxt} {} (field)", field.friendly_name(self.ctxt)); for note in &field.notes { self.notes_with_context.push((ctxt.to_string(), note)) } } fn annotate_function(&mut self, ctxt: &str, function: &'n FunctionCandidate<'tcx>) { - let ctxt = format!("{ctxt}::{}", function.friendly_name(self.ctxt)); + let ctxt = format!("{ctxt} fn {}", function.friendly_name(self.ctxt)); for note in &function.notes { self.notes_with_context.push((ctxt.to_string(), note)) @@ -374,7 +377,7 @@ impl<'n, 'tcx> AnnotationContextCollector<'n, 'tcx> { } fn annotate_arg(&mut self, ctxt: &str, arg: &'n FunctionArgCandidate) { - let ctxt = format!("{ctxt}::{}", arg.friendly_name(self.ctxt)); + let ctxt = format!("{ctxt} {} (arg)", arg.friendly_name(self.ctxt)); for note in &arg.notes { self.notes_with_context.push((ctxt.to_string(), note)) diff --git a/codegen/src/context.rs b/codegen/src/context.rs index f8ef2b692e..c21fce4ff5 100644 --- a/codegen/src/context.rs +++ b/codegen/src/context.rs @@ -4,7 +4,7 @@ use cargo_metadata::camino::Utf8PathBuf; use crate_feature_graph::WorkspaceGraph; use indexmap::IndexMap; use log::debug; -use rustc_hir::def_id::DefId; +use rustc_hir::def_id::{CrateNum, DefId, DefIndex}; use rustc_middle::ty::{AdtDef, TyCtxt}; use serde::Serialize; @@ -15,7 +15,7 @@ pub(crate) struct BevyCtxt<'tcx> { pub(crate) meta_loader: MetaLoader, pub(crate) reflect_types: IndexMap>>, pub(crate) excluded_reflect_types: Vec>>>, - pub(crate) cached_traits: CachedTraits, + pub(crate) cached_traits: CachedItems, pub(crate) path_finder: ImportPathFinder<'tcx>, pub(crate) workspace: WorkspaceGraph, @@ -65,12 +65,26 @@ pub(crate) const DEF_PATHS_BMS_FROM_SCRIPT: [&str; 2] = pub(crate) const DEF_PATHS_BMS_INTO_SCRIPT: [&str; 2] = ["bevy_mod_scripting_bindings::IntoScript", "IntoScript"]; -pub(crate) const DEF_PATHS_REFLECT: [&str; 2] = - ["bevy_reflect::PartialReflect", "reflect::PartialReflect"]; +pub(crate) const DEF_PATHS_REFLECT: [&str; 2] = [ + "bevy_reflect::reflect::PartialReflect", + "reflect::PartialReflect", +]; pub(crate) const DEF_PATHS_GET_TYPE_REGISTRATION: [&str; 2] = [ - "bevy_reflect::GetTypeRegistration", + "bevy_reflect::type_registry::GetTypeRegistration", "type_registry::GetTypeRegistration", ]; +pub(crate) const DEF_PATHS_BMS_REF_WRAPPER: [&str; 2] = [ + "bevy_mod_scripting_bindings::Ref", + "bevy_mod_scripting_bindings::function::Ref", +]; +pub(crate) const DEF_PATHS_BMS_MUT_WRAPPER: [&str; 2] = [ + "bevy_mod_scripting_bindings::Mut", + "bevy_mod_scripting_bindings::function::Mut", +]; +pub(crate) const DEF_PATHS_BMS_VAL_WRAPPER: [&str; 2] = [ + "bevy_mod_scripting_bindings::Val", + "bevy_mod_scripting_bindings::function::Val", +]; /// A collection of traits which we search for in the codebase, some are included purely for the methods they provide, /// others are later used for quick lookup of the type "does this type implement Display" etc. @@ -95,42 +109,65 @@ pub(crate) const STD_OR_CORE_TRAITS: [&str; 13] = [ "cmp::PartialOrd", ]; -/// A collection of common traits stored for quick access. -#[derive(Default)] -pub(crate) struct CachedTraits { - pub(crate) bms_into_script: Option, - pub(crate) bms_from_script: Option, - pub(crate) bevy_reflect_reflect: Option, - pub(crate) bevy_reflect_get_type_registration: Option, - /// Map from def_path_str to DefId of common std traits we work with - /// these are the only trait impls from which we generate methods - pub(crate) std_only_traits: HashMap, - pub(crate) std_or_core_traits: HashMap, +pub(crate) struct BmsTypes { + #[allow(dead_code)] + pub bindings_crate: CrateNum, + pub into_script: DefId, + pub from_script: DefId, + pub ref_wrapper: DefId, + pub val_wrapper: DefId, + pub mut_wrapper: DefId, } -impl CachedTraits { - pub(crate) fn missing_bms_traits(&self) -> Vec<&'static str> { - let mut missing = Vec::new(); - if self.bms_into_script.is_none() { - missing.extend(DEF_PATHS_BMS_INTO_SCRIPT); - } - if self.bms_from_script.is_none() { - missing.extend(DEF_PATHS_BMS_FROM_SCRIPT); +pub(crate) struct BevyTypes { + #[allow(dead_code)] + pub reflect_crate: CrateNum, + pub reflect: DefId, + #[allow(dead_code)] + pub get_type_registration: DefId, +} + +impl Default for BevyTypes { + fn default() -> Self { + Self { + reflect_crate: INVALID_CRATE_NUM, + reflect: INVALID_DEF_ID, + get_type_registration: INVALID_DEF_ID, } - missing } +} - pub(crate) fn missing_bevy_traits(&self) -> Vec<&'static str> { - let mut missing = Vec::new(); - if self.bevy_reflect_reflect.is_none() { - missing.extend(DEF_PATHS_REFLECT); - } - if self.bevy_reflect_get_type_registration.is_none() { - missing.extend(DEF_PATHS_GET_TYPE_REGISTRATION); +const INVALID_CRATE_NUM: CrateNum = CrateNum::from_u16(u16::MAX); +const INVALID_DEF_ID: DefId = DefId { + index: DefIndex::from_u16(u16::MAX), + krate: INVALID_CRATE_NUM, +}; + +impl Default for BmsTypes { + fn default() -> Self { + Self { + bindings_crate: INVALID_CRATE_NUM, + into_script: INVALID_DEF_ID, + from_script: INVALID_DEF_ID, + ref_wrapper: INVALID_DEF_ID, + val_wrapper: INVALID_DEF_ID, + mut_wrapper: INVALID_DEF_ID, } - missing } +} + +/// A collection of common traits stored for quick access. +#[derive(Default)] +pub(crate) struct CachedItems { + pub(crate) bms_types: BmsTypes, + pub(crate) bevy_types: BevyTypes, + /// Map from def_path_str to DefId of common std traits we work with + /// these are the only trait impls from which we generate methods + pub(crate) std_only_traits: HashMap, + pub(crate) std_or_core_traits: HashMap, +} +impl CachedItems { pub(crate) fn missing_std_traits(&self) -> Vec { let mut missing = Vec::new(); for trait_name in STD_ONLY_TRAITS { diff --git a/codegen/src/driver/mod.rs b/codegen/src/driver/mod.rs index 3ad259c229..010d23556d 100644 --- a/codegen/src/driver/mod.rs +++ b/codegen/src/driver/mod.rs @@ -14,7 +14,6 @@ use cargo_metadata::{Metadata, camino::Utf8PathBuf}; pub use plugin::*; use rustc_session::{EarlyDiagCtxt, config::ErrorOutputType}; -pub const CRATES_TO_RUN_PLUGIN_ON_ENV: &str = "CRATES_TO_RUN_PLUGIN_ON"; pub const CARGO_VERBOSE: &str = "CARGO_VERBOSE"; pub const WORKSPACE_GRAPH_FILE_ENV: &str = "WORKSPACE_GRAPH_FILE"; @@ -24,16 +23,14 @@ pub fn fetch_target_directory(metadata: &Metadata) -> Utf8PathBuf { } /// The top-level function that should be called in your user-facing binary. -pub fn cli_main(plugin: T, include_crates: Vec, metadata: &Metadata) { +pub fn cli_main(plugin: T, metadata: &Metadata) { if env::args().any(|arg| arg == "-V") { - println!("{}", plugin.version()); + println!("{}", T::version()); return; } let target_dir = fetch_target_directory(metadata); - let args = plugin.args(&target_dir); - let mut cmd = Command::new("cargo"); cmd.env("CARGO_TERM_COLOR", "always"); cmd.stdout(Stdio::inherit()).stderr(Stdio::inherit()); @@ -56,51 +53,53 @@ pub fn cli_main(plugin: T, include_crates: Vec, metadata cmd.arg("-q"); } - cmd.env(CRATES_TO_RUN_PLUGIN_ON_ENV, include_crates.join(",")); - - let args_str = serde_json::to_string(&args.args).unwrap(); - log::debug!("{PLUGIN_ARGS}={args_str}"); - cmd.env(PLUGIN_ARGS, args_str); + plugin.serialize_to_env(); - plugin.modify_cargo(&mut cmd, &args.args); + plugin.modify_cargo(&mut cmd); let exit_status = cmd.status().expect("failed to wait for cargo?"); exit(exit_status.code().unwrap_or(-1)); } -// use std::{ -// env, -// ops::Deref, -// path::{Path, PathBuf}, -// process::{Command, exit}, -// }; - -// use rustc_session::{EarlyDiagCtxt, config::ErrorOutputType}; -// use rustc_tools_util::VersionInfo; - -// use super::plugin::{PLUGIN_ARGS, RustcPlugin}; +fn with_next(iter: I) -> impl Iterator)> +where + I: Iterator, + I::Item: Clone, +{ + let mut it = iter.peekable(); + std::iter::from_fn(move || { + let current = it.next()?; + let next = it.peek().cloned(); + Some((current, next)) + }) +} /// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If /// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`. -fn arg_value<'a, T: Deref>( +fn arg_values<'a, T: Deref>( args: &'a [T], - find_arg: &str, - pred: impl Fn(&str) -> bool, -) -> Option<&'a str> { - let mut args = args.iter().map(Deref::deref); - while let Some(arg) = args.next() { - let mut arg = arg.splitn(2, '='); - if arg.next() != Some(find_arg) { - continue; + find_arg: &'a str, + pred: impl Fn(&'a str) -> bool + 'static, +) -> impl Iterator { + with_next(args.iter().map(Deref::deref)).filter_map(move |(arg, next_arg)| { + let mut split_arg = arg.splitn(2, '='); + if split_arg.next() != Some(find_arg) { + return None; } - - match arg.next().or_else(|| args.next()) { - Some(v) if pred(v) => return Some(v), - _ => {} + match split_arg.next().or(next_arg) { + Some(v) if pred(v) => Some(v), + _ => None, } - } - None + }) +} + +pub fn arg_value<'a, T: Deref>( + args: &'a [T], + find_arg: &'a str, + pred: impl Fn(&'a str) -> bool + 'static, +) -> Option<&'a str> { + arg_values(args, find_arg, pred).next() } fn toolchain_path(home: Option, toolchain: Option) -> Option { @@ -165,11 +164,8 @@ fn get_sysroot(orig_args: &[String]) -> (bool, String) { (have_sys_root_arg, sys_root) } -struct DefaultCallbacks; -impl rustc_driver::Callbacks for DefaultCallbacks {} - /// The top-level function that should be called by your internal driver binary. -pub fn driver_main(plugin: T) { +pub fn rustc_driver_main(plugin: T) { let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default()); rustc_driver::init_rustc_env_logger(&early_dcx); @@ -179,7 +175,7 @@ pub fn driver_main(plugin: T) { let (have_sys_root_arg, sys_root) = get_sysroot(&orig_args); if orig_args.iter().any(|a| a == "--version" || a == "-V") { - println!("{}", plugin.version()); + println!("{}", T::version()); exit(0); } @@ -200,37 +196,33 @@ pub fn driver_main(plugin: T) { args.extend(["--sysroot".into(), sys_root.clone()]); }; + plugin.modify_rustc(&mut args); + // On a given invocation of rustc, we have to decide whether to act as rustc, // or actually execute the plugin. There are two conditions for executing the plugin: // 1. Either we're supposed to run on all crates, or CARGO_PRIMARY_PACKAGE is set. // 2. --print is NOT passed, since Cargo does that to get info about rustc. - let primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok(); + // let primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok(); let crate_being_built = arg_value(&args, "--crate-name", |_| true) .as_ref() .map(|s| s.to_string()) .unwrap_or_default(); - let is_target_crate = env::var(CRATES_TO_RUN_PLUGIN_ON_ENV) - .is_ok_and(|crates| crates.split(',').any(|c| c == crate_being_built)); - let normal_rustc = arg_value(&args, "--print", |_| true).is_some(); - let run_plugin = !normal_rustc && is_target_crate; + // let run_mode = plugin.should_run(&crate_being_built); + // log::info!("crate {crate_being_built}, run mode: {run_mode:?}"); + // let (should_run_plugin, should_skip) = match run_mode { + // RunMode::NormalRustc => (false, false), + // RunMode::Plugin => (true, false), + // RunMode::Skip => (false, true), + // }; + + let normal_rustc_cli_override = arg_value(&args, "--print", |_| true).is_some(); // TODO: this is dangerous // ignore all lints that could break the comp in crates that we don't care about // args.extend([String::from("--cap-lints"), String::from("warn")]); - if run_plugin { - log::debug!("Running plugin on crate: {crate_being_built}"); - let plugin_args: T::Args = - serde_json::from_str(&env::var(PLUGIN_ARGS).unwrap()).unwrap(); - plugin.run(args, plugin_args); - } else { - log::debug!( - "Running normal Rust. Relevant variables:\ -normal_rustc={normal_rustc}, \ -is_target_crate={is_target_crate}, \ -primary_package={primary_package}" - ); - rustc_driver_impl::run_compiler(&args, &mut DefaultCallbacks); - } + + log::debug!("Running plugin on crate: {crate_being_built}"); + plugin.run(&crate_being_built, args, normal_rustc_cli_override); })) } diff --git a/codegen/src/driver/plugin.rs b/codegen/src/driver/plugin.rs index a15cf3164b..a830ae8a3d 100644 --- a/codegen/src/driver/plugin.rs +++ b/codegen/src/driver/plugin.rs @@ -1,30 +1,16 @@ use std::{borrow::Cow, process::Command}; -use cargo_metadata::camino::Utf8Path; use serde::{Serialize, de::DeserializeOwned}; -/// Specification of a set of crates. -pub enum CrateFilter { - /// Every crate in the workspace and all transitive dependencies. - AllCrates, - /// Just crates in the workspace. - OnlyWorkspace, -} - -/// Arguments from your plugin to the rustc_plugin framework. -pub struct RustcPluginArgs { - /// Whatever CLI arguments you want to pass along. - pub args: Args, - - /// Which crates you want to run the plugin on. - pub filter: CrateFilter, +#[derive(Debug)] +pub enum RunMode { + NormalRustc, + Plugin, + Skip, } /// Interface between your plugin and the rustc_plugin framework. -pub trait RustcPlugin: Sized { - /// Command-line arguments passed by the user. - type Args: Serialize + DeserializeOwned; - +pub trait RustcPlugin: Sized + Serialize + DeserializeOwned { /// Returns the version of your plugin. /// /// A sensible default is your plugin's Cargo version: @@ -32,24 +18,31 @@ pub trait RustcPlugin: Sized { /// ```ignore /// env!("CARGO_PKG_VERSION").into() /// ``` - fn version(&self) -> Cow<'static, str>; + fn version() -> Cow<'static, str>; /// Returns the name of your driver binary as it's installed in the filesystem. /// /// Should be just the filename, not the full path. fn driver_name(&self) -> Cow<'static, str>; - /// Parses and returns the CLI arguments for the plugin. - fn args(&self, target_dir: &Utf8Path) -> RustcPluginArgs; - /// Optionally modify the `cargo` command that launches rustc. /// For example, you could pass a `--feature` flag here. - fn modify_cargo(&self, _cargo: &mut Command, _args: &Self::Args) {} + fn modify_cargo(&self, _cargo: &mut Command) {} + + fn modify_rustc(&self, _compiler_args: &mut Vec) {} /// Executes the plugin with a set of compiler and plugin args. - fn run(self, compiler_args: Vec, plugin_args: Self::Args); + fn run(self, crate_name: &str, compiler_args: Vec, is_not_build_invocation: bool); + + /// To be used after the PAYLOAD is initialized + fn initialize_from_env() -> Self { + serde_json::from_str(&std::env::var(PLUGIN_PAYLOAD).unwrap()).unwrap() + } + + /// persists the plugin in the process environment for children to be able to call [`Self::initialize_from_env`] + fn serialize_to_env(&self) { + unsafe { std::env::set_var(PLUGIN_PAYLOAD, serde_json::to_string(&self).unwrap()) } + } } -/// The name of the environment variable shared between the CLI and the driver. -/// Must not conflict with any other env var used by Cargo. -pub const PLUGIN_ARGS: &str = "PLUGIN_ARGS"; +pub const PLUGIN_PAYLOAD: &str = "PLUGIN_PAYLOAD"; diff --git a/codegen/src/impls.rs b/codegen/src/impls.rs new file mode 100644 index 0000000000..2d4adde82f --- /dev/null +++ b/codegen/src/impls.rs @@ -0,0 +1,92 @@ +use rustc_infer::{ + infer::TyCtxtInferExt, + traits::{Obligation, ObligationCause, PredicateObligation}, +}; +use rustc_middle::ty::{Ty, TyCtxt, TypingEnv}; +use rustc_trait_selection::traits::ObligationCtxt; + +use crate::{BmsTypes, candidate::GenerationExclusionNote}; + +pub(crate) trait BmsTraitChecker<'tcx> { + /// Checks if the given type implements 'FromScript', assuming a monomorphised type. + fn implements_from_script( + &self, + self_type: Ty<'tcx>, + bms_types: &BmsTypes, + tcx: TyCtxt<'tcx>, + ) -> Result<(), GenerationExclusionNote>; + + /// Checks if the given type implements 'IntoScript', assuming a monomorphised type. + fn implements_into_script( + &self, + self_type: Ty<'tcx>, + bms_types: &BmsTypes, + tcx: TyCtxt<'tcx>, + ) -> Result<(), GenerationExclusionNote>; +} + +fn typing_env_for_impl<'tcx>(_self_type: Ty<'tcx>, _tcx: TyCtxt<'tcx>) -> TypingEnv<'tcx> { + // if let Some(adt) = self_type.ty_adt_def() { + // TypingEnv::non_body_analysis(tcx, adt.did()) + // } else { + TypingEnv::fully_monomorphized() + // } +} + +impl<'tcx> BmsTraitChecker<'tcx> for Ty<'tcx> { + fn implements_from_script( + &self, + self_type: Ty<'tcx>, + bms_types: &BmsTypes, + tcx: TyCtxt<'tcx>, + ) -> Result<(), GenerationExclusionNote> { + let typing_env = typing_env_for_impl(self_type, tcx); + check_trait_impl(tcx, typing_env, self_type, bms_types.from_script) + } + + fn implements_into_script( + &self, + self_type: Ty<'tcx>, + bms_types: &BmsTypes, + tcx: TyCtxt<'tcx>, + ) -> Result<(), GenerationExclusionNote> { + let typing_env = typing_env_for_impl(self_type, tcx); + check_trait_impl(tcx, typing_env, self_type, bms_types.into_script) + } +} + +fn check_trait_impl<'tcx>( + tcx: TyCtxt<'tcx>, + typing_env: TypingEnv<'tcx>, + self_ty: Ty<'tcx>, + trait_def_id: rustc_hir::def_id::DefId, +) -> Result<(), GenerationExclusionNote> { + let param_env = typing_env.param_env; + + let infcx = tcx.infer_ctxt().build(typing_env.typing_mode); + + let trait_ref = rustc_middle::ty::TraitRef::new(tcx, trait_def_id, [self_ty]); + + let obligation: PredicateObligation<'tcx> = + Obligation::new(tcx, ObligationCause::dummy(), param_env, trait_ref); + + let ocx = ObligationCtxt::new_with_diagnostics(&infcx); + ocx.register_obligation(obligation); + + let errors = ocx.evaluate_obligations_error_on_ambiguity(); + + if errors.is_empty() { + return Ok(()); + } + + let msg = format!( + "type `{self_ty}` does NOT implement required trait, errors: {}. param env: {param_env:?}", + errors + .into_iter() + .map(|e| format!("{e:?}")) + .collect::>() + .join(",") + ); + + Err(GenerationExclusionNote::Reason(msg)) +} diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index de0271bbe6..6397fa8057 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -14,27 +14,29 @@ extern crate rustc_middle; extern crate rustc_session; extern crate rustc_span; extern crate rustc_trait_selection; +extern crate rustc_type_ir; mod args; -mod callback; mod candidate; mod context; +mod impls; mod import_path; mod meta; mod modifying_file_loader; mod passes; mod plugin; mod template; +mod ty_convert; // pub(crate) use args::*; pub use args::{Args, Command, WorkspaceMeta}; -pub(crate) use callback::*; pub(crate) use context::*; +pub use driver::*; pub(crate) use import_path::*; pub use meta::MetaLoader; pub(crate) use meta::*; pub(crate) use passes::*; -pub use plugin::BevyAnalyzer; +pub use plugin::*; pub(crate) use template::*; pub use template::{ Collect, Crate, TEMPLATE_DIR, TemplateKind, configure_tera, extend_context_with_args, diff --git a/codegen/src/modifying_file_loader.rs b/codegen/src/modifying_file_loader.rs index 07f2075fbe..672b8e023d 100644 --- a/codegen/src/modifying_file_loader.rs +++ b/codegen/src/modifying_file_loader.rs @@ -27,23 +27,16 @@ impl FileLoader for ModifyingFileLoader { ); RealFileLoader.read_file(path).map(|mut f| { // we make it pub so in case we are re-exporting this crate we won't run into private re-export issues - for (crate_, excluded_files) in &[ - ("bevy_reflect", vec!["crates/bevy_reflect/src/lib.rs"]), - ("bevy_mod_scripting_bindings", vec![]), - ] { - if !f.contains(&format!("extern crate {crate_}")) - && !excluded_files - .iter() - .any(|s| path.to_str().unwrap().contains(s)) - { - if f.contains(&format!("pub use {crate_}")) { + for krate in &["bevy_mod_scripting_bindings"] { + if !f.contains(&format!("extern crate {krate}")) { + if f.contains(&format!("pub use {krate}")) { f.push_str(&format!( - "#[allow(unused_extern_crates)] pub extern crate {crate_};" + "#[allow(unused_extern_crates)] pub extern crate {krate};" )); } else { // this causes issues in proc macros so let's make it private where we can f.push_str(&format!( - "#[allow(unused_extern_crates)] extern crate {crate_};" + "#[allow(unused_extern_crates)] extern crate {krate};" )); } } diff --git a/codegen/src/passes/cache_items.rs b/codegen/src/passes/cache_items.rs new file mode 100644 index 0000000000..6aeb0329f6 --- /dev/null +++ b/codegen/src/passes/cache_items.rs @@ -0,0 +1,180 @@ +use log::{debug, trace}; +use rustc_hir::def_id::LOCAL_CRATE; +use rustc_span::Symbol; + +use crate::{ + Args, BevyCtxt, BevyTypes, BmsTypes, DEF_PATHS_BMS_FROM_SCRIPT, DEF_PATHS_BMS_INTO_SCRIPT, + DEF_PATHS_BMS_MUT_WRAPPER, DEF_PATHS_BMS_REF_WRAPPER, DEF_PATHS_BMS_VAL_WRAPPER, + DEF_PATHS_GET_TYPE_REGISTRATION, DEF_PATHS_REFLECT, STD_ONLY_TRAITS, STD_OR_CORE_TRAITS, +}; +// tODO: verify there is only one Reflect trait impl +// fn dump_items(ctxt: &BevyCtxt) -> String { +// let mut buffer = String::new(); +// buffer.push_str("traits:\n"); +// for t in ctxt.tcx.all_traits_including_private() { +// buffer.push_str(&ctxt.tcx.def_path_str(t)); +// buffer.push_str(", "); +// } +// buffer.push_str("bms_bindings items:\n"); +// for item in ctxt +// .path_finder +// .crawled_items_in_crate(ctxt.cached_traits.bms_types.bindings_crate) +// { +// buffer.push_str(&ctxt.tcx.def_path_str(item)); +// buffer.push_str(", "); +// } + +// buffer +// } + +pub(crate) fn cache_bms_items(ctxt: &mut BevyCtxt<'_>) -> BmsTypes { + let bindings_crate = *ctxt + .tcx + .crates(()) + .iter() + .find(|c| ctxt.tcx.crate_name(**c).as_str() == "bevy_mod_scripting_bindings") + .expect("bevy_mod_scripting_bindings crate not linked"); + let mut val_wrapper = None; + let mut ref_wrapper = None; + let mut mut_wrapper = None; + let mut into_script = None; + let mut from_script = None; + ctxt.path_finder.ensure_crate_crawled(bindings_crate); + for item in ctxt.path_finder.crawled_items_in_crate(bindings_crate) { + let item_name = ctxt.tcx.def_path_str(item); + let item_name = item_name.as_str(); + if DEF_PATHS_BMS_VAL_WRAPPER.contains(&item_name) { + val_wrapper = Some(item) + } else if DEF_PATHS_BMS_REF_WRAPPER.contains(&item_name) { + ref_wrapper = Some(item) + } else if DEF_PATHS_BMS_MUT_WRAPPER.contains(&item_name) { + mut_wrapper = Some(item) + } else if DEF_PATHS_BMS_FROM_SCRIPT.contains(&item_name) { + from_script = Some(item) + } else if DEF_PATHS_BMS_INTO_SCRIPT.contains(&item_name) { + into_script = Some(item) + } + } + + BmsTypes { + bindings_crate, + into_script: into_script.expect("could not find IntoScript trait from bms linked"), + from_script: from_script.expect("could not find FromScript trait from bms linked"), + ref_wrapper: ref_wrapper.expect("could not find Ref type from bms linked"), + val_wrapper: val_wrapper.expect("could not find Val type from bms linked"), + mut_wrapper: mut_wrapper.expect("could not find Mut type from bms linked"), + } +} + +pub(crate) fn cache_bevy_items(ctxt: &mut BevyCtxt<'_>) -> Result { + let reflect_crates = ctxt + .tcx + .crates(()) + .iter() + .chain(std::iter::once(&LOCAL_CRATE)) + .filter(|c| ctxt.tcx.crate_name(**c).as_str() == "bevy_reflect") + .collect::>(); + + // if reflect_crates.len() != 1 { + // return Err(format!( + // "Either found none or multiple bevy_reflect crates: {:?}", + // reflect_crates + // .iter() + // .map(|c| ctxt.tcx.def_path_str(c.as_def_id())) + // .collect::>() + // .join(",") + // )); + // } + let reflect_crate = **reflect_crates.last().unwrap(); + + ctxt.path_finder.ensure_crate_crawled(reflect_crate); + let mut reflect = None; + let mut get_type_registration = None; + for item in ctxt.path_finder.crawled_items_in_crate(reflect_crate) { + let item_name = ctxt.tcx.def_path_str(item); + let item_name = item_name.as_str(); + if DEF_PATHS_REFLECT.contains(&item_name) { + reflect = Some(item) + } else if DEF_PATHS_GET_TYPE_REGISTRATION.contains(&item_name) { + get_type_registration = Some(item) + } + } + + Ok(BevyTypes { + reflect_crate, + reflect: reflect.ok_or("could not find Reflect from bevy_reflect linked")?, + get_type_registration: get_type_registration + .ok_or("could not find GetTypeRegistration from bevy_reflect linked")?, + }) +} + +/// Finds and caches relevant traits, if they cannot be found throws an ICE +pub(crate) fn cache_items(ctxt: &mut BevyCtxt<'_>, _args: &Args) -> bool { + ctxt.cached_traits.bms_types = cache_bms_items(ctxt); + ctxt.cached_traits.bevy_types = match cache_bevy_items(ctxt) { + Ok(t) => t, + Err(err) => { + log::warn!( + "could not cache bevy types in crate {}. {err}. Will not generate bindings.", + ctxt.tcx.crate_name(LOCAL_CRATE) + ); + return false; + } + }; + + let tcx = &ctxt.tcx; + + for trait_did in tcx.all_traits_including_private() { + let def_path_str = tcx.def_path_str(trait_did); + if STD_ONLY_TRAITS.contains(&def_path_str.as_str()) { + trace!("found std trait def id: {trait_did:?}"); + ctxt.cached_traits + .std_only_traits + .insert(def_path_str.to_string(), trait_did); + } else if let Some(full_name) = STD_OR_CORE_TRAITS.iter().find(|name| { + (Some(**name) == def_path_str.strip_prefix("core::")) + || (Some(**name) == def_path_str.strip_prefix("std::")) + }) { + trace!("found core trait def id: {trait_did:?}"); + ctxt.cached_traits + .std_or_core_traits + .insert(full_name.to_string(), trait_did); + } + } + + let missing_std_traits = ctxt.cached_traits.missing_std_traits(); + if !missing_std_traits.is_empty() { + debug!( + "Could not find std traits: [{}] in crate: {}, this might lead to missing methods in the generated API.", + missing_std_traits.join(", "), + tcx.crate_name(LOCAL_CRATE), + ); + } + + // some crates specifically do not have std in scope via `#![no_std]` which means we do not care about these traits + let has_std = tcx + .get_attrs_by_path(LOCAL_CRATE.as_def_id(), &[Symbol::intern("no_std")]) + .map(|_| ()) + .next() + .is_none(); + + log::trace!("has_std: {has_std}"); + + // if has_std && !ctxt.cached_traits.has_all_std_source_traits() { + // log::debug!( + // "all traits: {}", + // tcx.all_traits() + // .map(|t| tcx.def_path_str(t).to_string()) + // .collect::>() + // .join(", ") + // ); + + // panic!( + // "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong?", + // ctxt.cached_traits.missing_std_source_traits().join(", "), + // tcx.crate_name(LOCAL_CRATE) + // ) + // } + + true +} diff --git a/codegen/src/passes/cache_traits.rs b/codegen/src/passes/cache_traits.rs deleted file mode 100644 index b06e6aef72..0000000000 --- a/codegen/src/passes/cache_traits.rs +++ /dev/null @@ -1,109 +0,0 @@ -use log::{trace, warn}; -use rustc_hir::def_id::LOCAL_CRATE; -use rustc_middle::ty::TyCtxt; -use rustc_span::Symbol; - -use crate::{ - Args, BevyCtxt, DEF_PATHS_BMS_FROM_SCRIPT, DEF_PATHS_BMS_INTO_SCRIPT, - DEF_PATHS_GET_TYPE_REGISTRATION, DEF_PATHS_REFLECT, STD_ONLY_TRAITS, STD_OR_CORE_TRAITS, -}; - -fn dump_traits(tcx: &TyCtxt) -> String { - let mut buffer = String::new(); - for t in tcx.all_traits_including_private() { - buffer.push_str(&tcx.def_path_str(t)); - buffer.push_str(", "); - } - buffer -} - -/// Finds and caches relevant traits, if they cannot be found throws an ICE -pub(crate) fn cache_traits(ctxt: &mut BevyCtxt<'_>, _args: &Args) -> bool { - let tcx = &ctxt.tcx; - - for trait_did in tcx.all_traits_including_private() { - let def_path_str = tcx.def_path_str(trait_did); - if DEF_PATHS_REFLECT.contains(&def_path_str.as_str()) { - trace!("found Reflect trait def id: {trait_did:?}"); - ctxt.cached_traits.bevy_reflect_reflect = Some(trait_did); - } else if DEF_PATHS_GET_TYPE_REGISTRATION.contains(&def_path_str.as_str()) { - trace!("found GetTypeRegistration trait def id: {trait_did:?}"); - ctxt.cached_traits.bevy_reflect_get_type_registration = Some(trait_did); - } else if STD_ONLY_TRAITS.contains(&def_path_str.as_str()) { - trace!("found std trait def id: {trait_did:?}"); - ctxt.cached_traits - .std_only_traits - .insert(def_path_str.to_string(), trait_did); - } else if let Some(full_name) = STD_OR_CORE_TRAITS.iter().find(|name| { - (Some(**name) == def_path_str.strip_prefix("core::")) - || (Some(**name) == def_path_str.strip_prefix("std::")) - }) { - trace!("found core trait def id: {trait_did:?}"); - ctxt.cached_traits - .std_or_core_traits - .insert(full_name.to_string(), trait_did); - } else if DEF_PATHS_BMS_INTO_SCRIPT.contains(&def_path_str.as_str()) { - trace!("found IntoScript trait def id: {trait_did:?}"); - ctxt.cached_traits.bms_into_script = Some(trait_did); - } else if DEF_PATHS_BMS_FROM_SCRIPT.contains(&def_path_str.as_str()) { - trace!("found FromScript trait def id: {trait_did:?}"); - ctxt.cached_traits.bms_from_script = Some(trait_did); - } - } - - let missing_bevy_traits = ctxt.cached_traits.missing_bevy_traits(); - if !missing_bevy_traits.is_empty() { - panic!( - "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong? Available traits: {}", - missing_bevy_traits.join(", "), - tcx.crate_name(LOCAL_CRATE), - dump_traits(tcx) - ); - } - - let missing_bms_traits = ctxt.cached_traits.missing_bms_traits(); - if !missing_bms_traits.is_empty() { - panic!( - "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong? Available traits: {}", - missing_bms_traits.join(", "), - tcx.crate_name(LOCAL_CRATE), - dump_traits(tcx) - ); - } - - let missing_std_traits = ctxt.cached_traits.missing_std_traits(); - if !missing_std_traits.is_empty() { - warn!( - "Could not find std traits: [{}] in crate: {}, this might lead to missing methods in the generated API.", - missing_std_traits.join(", "), - tcx.crate_name(LOCAL_CRATE), - ); - } - - // some crates specifically do not have std in scope via `#![no_std]` which means we do not care about these traits - let has_std = tcx - .get_attrs_by_path(LOCAL_CRATE.as_def_id(), &[Symbol::intern("no_std")]) - .map(|_| ()) - .next() - .is_none(); - - log::trace!("has_std: {has_std}"); - - // if has_std && !ctxt.cached_traits.has_all_std_source_traits() { - // log::debug!( - // "all traits: {}", - // tcx.all_traits() - // .map(|t| tcx.def_path_str(t).to_string()) - // .collect::>() - // .join(", ") - // ); - - // panic!( - // "Could not find traits: [{}] in crate: {}, did bootstrapping go wrong?", - // ctxt.cached_traits.missing_std_source_traits().join(", "), - // tcx.crate_name(LOCAL_CRATE) - // ) - // } - - true -} diff --git a/codegen/src/passes/codegen.rs b/codegen/src/passes/codegen.rs index 4f3d2af650..a038932266 100644 --- a/codegen/src/passes/codegen.rs +++ b/codegen/src/passes/codegen.rs @@ -3,7 +3,7 @@ use std::{ io::Write, }; -use log::info; +use log::debug; use rustc_hir::def_id::LOCAL_CRATE; use tera::Context; @@ -20,7 +20,7 @@ pub(crate) fn codegen(ctxt: &mut BevyCtxt<'_>, args: &Args) -> bool { // perform code gen using templates fs::create_dir_all(&args.output).unwrap(); - info!("Writing code files to : {}", args.output); + debug!("Writing code files to : {}", args.output); let template_data = ctxt.template_context.as_ref().unwrap(); let mut context = Context::from_serialize(template_data).unwrap(); diff --git a/codegen/src/passes/find_methods_and_fields.rs b/codegen/src/passes/find_methods_and_fields.rs index a054ebb145..d0c5157851 100644 --- a/codegen/src/passes/find_methods_and_fields.rs +++ b/codegen/src/passes/find_methods_and_fields.rs @@ -7,18 +7,17 @@ use rustc_hir::{ StableSince, def_id::{DefId, LOCAL_CRATE}, }; -use rustc_infer::infer::TyCtxtInferExt; -use rustc_middle::ty::{AdtDef, AssocKind, FnSig, GenericArgs, Ty, TyCtxt, TyKind, TypingEnv}; +use rustc_infer::{infer::TyCtxtInferExt, traits::{Obligation, ObligationCause}}; +use rustc_middle::ty::{self, AdtDef, AssocKind, FnSig, GenericArgs, Ty, TyCtxt, TyKind, TypingEnv}; use rustc_span::Symbol; -use rustc_trait_selection::infer::InferCtxtExt; +use rustc_trait_selection::{infer::InferCtxtExt, traits::ObligationCtxt}; use crate::{ - Args, BevyCtxt, CachedTraits, MetaLoader, ReflectionStrategy, candidate::{ Annotated, AnnotationContextCollector, FieldCandidate, FunctionArgCandidate, FunctionCandidate, FunctionCandidateKind, GenerationCandidate, GenerationExclusionNote, VariantCandidate, - }, + }, impls::BmsTraitChecker, ty_convert::{wrap_non_primtiives}, Args, BevyCtxt, CachedItems, MetaLoader, ReflectionStrategy }; /// Finds all methods and fields which can be wrapped on a proxy, stores them in sorted order. @@ -190,47 +189,39 @@ fn generate_functions<'tcx>( return Err(fn_candidate.with_note(GenerationExclusionNote::Reason("Function is not public and does not come from a trait impl".to_string()))); } - let param_env = TypingEnv::non_body_analysis(ctxt.tcx, def_id); let arg_names = ctxt.tcx.fn_arg_idents(fn_candidate.did); fn_candidate.arguments = fn_candidate.sig.inputs().iter().zip(arg_names).enumerate().map(|(index, (arg_ty, ident))| { let candidate_input = FunctionArgCandidate::new(ident.map(|id| id.to_string()).unwrap_or(index.to_string())); - if type_is_supported_as_non_proxy_arg( - ctxt.tcx, - param_env, - &ctxt.cached_traits, - *arg_ty, - ) { - candidate_input.with_reflection_strategy(ReflectionStrategy::Primitive) - } else if type_is_supported_as_proxy_arg( - ctxt.tcx, - &ctxt.reflect_types, - &ctxt.meta_loader, - *arg_ty, - ) { - candidate_input.with_reflection_strategy(ReflectionStrategy::Proxy) - } else { - candidate_input.with_note(GenerationExclusionNote::Reason("argument is neither a primitive type implementing FromScript or a reflectable type".to_string())) + + let alternative_type = wrap_non_primtiives(*arg_ty, ctxt.tcx, &ctxt.cached_traits.bms_types); + let supported_as_primitive = alternative_type.implements_from_script( + alternative_type, + &ctxt.cached_traits.bms_types, + ctxt.tcx + ); + + match supported_as_primitive { + Ok(_) => candidate_input.with_reflection_strategy(ReflectionStrategy::Primitive), + Err(e1) => candidate_input + .with_note(GenerationExclusionNote::Reason("argument is neither a primitive type implementing FromScript or a reflectable type".to_string())) + .with_note(e1) } }).collect::>(); - if type_is_supported_as_non_proxy_return_val( - ctxt.tcx, - param_env, - &ctxt.cached_traits, - fn_candidate.sig.output(), - ) { - fn_candidate.ret = fn_candidate.ret.with_reflection_strategy(ReflectionStrategy::Primitive); - } else if type_is_supported_as_proxy_return_val( - ctxt.tcx, - &ctxt.reflect_types, - &ctxt.meta_loader, - fn_candidate.sig.output(), - ) { - fn_candidate.ret = fn_candidate.ret.with_reflection_strategy(ReflectionStrategy::Proxy); - } else { - fn_candidate.ret = fn_candidate.ret.with_note(GenerationExclusionNote::Reason("return type is neither a primitive type implementing IntoScript, or a reflectable type, or is a reference".to_string())) - } + let alternative_type = wrap_non_primtiives(fn_candidate.sig.output(), ctxt.tcx, &ctxt.cached_traits.bms_types); + let supported_as_primitive = alternative_type.implements_into_script( + alternative_type, + &ctxt.cached_traits.bms_types, + ctxt.tcx + ); + fn_candidate.ret = match supported_as_primitive { + Ok(_) => fn_candidate.ret.with_reflection_strategy(ReflectionStrategy::Primitive), + Err(e1) => fn_candidate.ret + .with_note(GenerationExclusionNote::Reason("return type is neither a primitive type implementing IntoScript or a reflectable type".to_string())) + .with_note(e1) + }; + if fn_candidate.applying_notes().next().is_some() { // notes inside will suffice here @@ -297,24 +288,32 @@ fn generate_variants<'tcx>( param_env, &ctxt.cached_traits, field_ty, - ) && type_is_supported_as_non_proxy_return_val( - ctxt.tcx, - param_env, - &ctxt.cached_traits, - field_ty, - ) { + ) + .is_ok() + && type_is_supported_as_non_proxy_return_val( + ctxt.tcx, + param_env, + &ctxt.cached_traits, + field_ty, + ) + .is_ok() + { candidate.with_reflection_strategy(ReflectionStrategy::Primitive) } else if type_is_supported_as_proxy_arg( ctxt.tcx, &ctxt.reflect_types, &ctxt.meta_loader, field_ty, - ) && type_is_supported_as_proxy_return_val( - ctxt.tcx, - &ctxt.reflect_types, - &ctxt.meta_loader, - field_ty, - ) { + ) + .is_ok() + && type_is_supported_as_proxy_return_val( + ctxt.tcx, + &ctxt.reflect_types, + &ctxt.meta_loader, + field_ty, + ) + .is_ok() + { candidate.with_reflection_strategy(ReflectionStrategy::Proxy) } else { candidate.with_reflection_strategy(ReflectionStrategy::Reflection) @@ -362,7 +361,7 @@ fn type_is_supported_as_proxy_arg<'tcx>( reflect_types: &IndexMap>>, meta_loader: &MetaLoader, ty: Ty, -) -> bool { +) -> Result<(), GenerationExclusionNote> { log::trace!("Checking type is supported as proxy arg: '{ty}'"); // nested references are not allowed for now @@ -382,7 +381,7 @@ fn type_is_supported_as_proxy_return_val<'tcx>( reflect_types: &IndexMap>>, meta_loader: &MetaLoader, ty: Ty, -) -> bool { +) -> Result<(), GenerationExclusionNote> { log::trace!("Checking type is supported as proxy return val: '{ty}'"); type_is_adt_and_reflectable(tcx, reflect_types, meta_loader, ty) } @@ -393,66 +392,66 @@ fn type_is_adt_and_reflectable<'tcx>( reflect_types: &IndexMap>>, meta_loader: &MetaLoader, ty: Ty, -) -> bool { - ty.ty_adt_def().is_some_and(|adt_def| { +) -> Result<(), GenerationExclusionNote> { + let adt_def = match ty.ty_adt_def() { + Some(v) => v, + None => { + return Err(GenerationExclusionNote::Reason(format!( + "Type is not an ADT: {ty}", + ))); + } + }; - let did = adt_def.did(); + let did = adt_def.did(); - // even though our meta might already be written at this point, we use this as a quick out - if reflect_types.contains_key(&did) { - // local types are easy to check - return true; - } + // even though our meta might already be written at this point, we use this as a quick out + if reflect_types.contains_key(&did) { + // local types are easy to check + return Ok(()); + } - // for other crates, reach for meta data - // we know a reflect impl can ONLY exist in one of two places due to orphan rules: - // 1) the bevy_reflect crate - // 2) the crate that defines the type - // so search for these metas! - let crate_name = tcx.crate_name(did.krate).to_ident_string(); + // for other crates, reach for meta data + // we know a reflect impl can ONLY exist in one of two places due to orphan rules: + // 1) the bevy_reflect crate + // 2) the crate that defines the type + // so search for these metas! + let crate_name = tcx.crate_name(did.krate).to_ident_string(); + + let contains_hash = meta_loader.one_of_meta_files_contains( + &[&crate_name, "bevy_reflect"], + Some(&tcx.crate_name(LOCAL_CRATE).to_ident_string()), + tcx.def_path_hash(did), + ); - let contains_hash = meta_loader.one_of_meta_files_contains( - &[&crate_name, "bevy_reflect"], - Some(&tcx.crate_name(LOCAL_CRATE).to_ident_string()), + if !contains_hash { + return Err(GenerationExclusionNote::Reason(format!( + "Meta for type: `{}` with hash: `{:?}`, was not found in meta files for {crate_name} or in bevy_reflect, meaning it will not generate a proxy.", + tcx.item_name(did), tcx.def_path_hash(did), - ); - - if contains_hash { - log::info!( - "Meta for type: `{}` with hash: `{:?}`, contained in the meta file", - tcx.item_name(did), - tcx.def_path_hash(did), - ); - } else { - log::info!( - "Meta for type: `{}` with hash: `{:?}`, was not found in meta files for {crate_name} or in bevy_reflect, meaning it will not generate a proxy.", - tcx.item_name(did), - tcx.def_path_hash(did), - ); - } + ))); + } - contains_hash - }) + Ok(()) } /// Checks if the type can be used directly as a lua function argument, by checking if it implements the FromLua trait fn type_is_supported_as_non_proxy_arg<'tcx>( tcx: TyCtxt<'tcx>, param_env: TypingEnv<'tcx>, - cached_traits: &CachedTraits, + cached_traits: &CachedItems, ty: Ty<'tcx>, -) -> bool { +) -> Result<(), GenerationExclusionNote> { trace!("Checking type is supported as non proxy arg: '{ty:?}' with param_env: '{param_env:?}'"); - impls_trait(tcx, param_env, ty, cached_traits.bms_from_script.unwrap()) + impls_trait(tcx, param_env, ty, cached_traits.bms_types.from_script) } /// Checks if the type can be used directly as a lua function output fn type_is_supported_as_non_proxy_return_val<'tcx>( tcx: TyCtxt<'tcx>, param_env: TypingEnv<'tcx>, - cached_traits: &CachedTraits, + cached_traits: &CachedItems, ty: Ty<'tcx>, -) -> bool { +) -> Result<(), GenerationExclusionNote> { trace!( "Checkign type is supported as non proxy return val: '{ty:?}' with param_env: '{param_env:?}'" ); @@ -461,10 +460,12 @@ fn type_is_supported_as_non_proxy_return_val<'tcx>( .get_name(tcx) .is_none_or(|rn| rn.as_str() != "'static") { - return false; + return Err(GenerationExclusionNote::Reason(format!( + "{ty} cannot be used as a return value. References are not supported as return values.", + ))); } - impls_trait(tcx, param_env, ty, cached_traits.bms_into_script.unwrap()) + impls_trait(tcx, param_env, ty, cached_traits.bms_types.into_script) } pub(crate) fn impls_trait<'tcx>( @@ -472,9 +473,93 @@ pub(crate) fn impls_trait<'tcx>( param_env: TypingEnv<'tcx>, ty: Ty<'tcx>, trait_did: DefId, -) -> bool { - tcx.infer_ctxt() +) -> Result<(), GenerationExclusionNote> { + + + if tcx + .infer_ctxt() .build(param_env.typing_mode) .type_implements_trait(trait_did, [ty], param_env.param_env) .must_apply_modulo_regions() + { + Ok(()) + } else { + let failure = debug_trait_impl_failure(tcx, param_env, trait_did, [ty].into_iter()); + Err(GenerationExclusionNote::Reason(format!( + "type {ty}, does not implement the trait {}. {}", + tcx.item_name(trait_did), + failure.unwrap_err() + ))) + } } + +pub fn debug_trait_impl_failure<'tcx>( + tcx: TyCtxt<'tcx>, + param_env: TypingEnv<'tcx>, + trait_def: DefId, + trait_params: impl Iterator>, +) -> Result<(), String> { + // let trait_generics = tcx.generics_of(trait_def); + + let params = trait_params.collect::>(); + + // if params.len() != trait_generics.count() { + // panic!("Expected generics for trait {:?}", trait_generics); + // } + + // 1) Build a trait ref for trait_def + // Use tcx.mk_trait_ref if present, otherwise create the TraitRef directly. + // let trait_args = tcx.mk_args(&[GenericArg::from(ty_to_check)]); + let trait_ref = ty::TraitRef::new(tcx, trait_def, params); + + // 2) Convert to a predicate (poly trait predicate) + // Some rustc versions allow: let pred = ty::Binder::dummy(trait_ref).to_predicate(tcx); + // If `to_predicate` is not found on Binder in your toolchain, use: + // let poly_trait_pred = ty::Binder::dummy(trait_ref); + // let predicate: Predicate<'tcx> = trait_ref.upcast(tcx); // <- if this errors, see notes below + // let obligation = traits::Obligation { + // cause: traits::ObligationCause::dummy(), + // param_env, + // recursion_depth: 0, + // predicate: trait_ref.upcast(self.tcx), + // }; + // 3) Build an obligation + let cause = ObligationCause::dummy(); + let obligation = Obligation::new(tcx, cause, param_env.param_env, trait_ref); + + // 4) Create an infer context and selection machinery + // The build(...) call needs a `typing_mode` argument in some versions. + // Use your existing typing_mode (you should have it alongside param_env). + let infcx = tcx.infer_ctxt().build(param_env.typing_mode); + + // Create an obligation context (fulfillment/selection helper) + // In some versions this is `ObligationCtxt::new(&infcx)`, in others `ObligationCtxt::new_infer(&infcx)`. + let ocx = ObligationCtxt::new(&infcx); + + // Register the obligation and try to select/fulfill. + ocx.register_obligation(obligation); + + // This will attempt all obligation selection and return any errors (empty vec == ok) + // API name may be `select_all_or_error`, `select_all_or_error(&mut infcx)`, or + // `select_all_or_error(&infcx)` depending on version. Try the no-arg one first. + let errors = ocx.evaluate_obligations_error_on_ambiguity(); + if errors.is_empty() { + return Ok(()); + } + + // If there are errors, gather text + nested obligations for debugging + let mut msgs = Vec::new(); + for err in errors { + // FulfillmentError (or FulfillmentErrorCode) pretty-printers vary; we stringify: + msgs.push(format!("fulfillment error: {:#?}", err)); + } + + // Also dump any nested obligations from the obligation stack if possible: + // (some APIs expose ocx.fulfillment_cx or ocx.infcx; if not available, skip) + + // This is version-dependent; if not present, ignore. + // msgs.push(format!("fulfillment_cx: {:#?}", ocx.infcx.)); + + + Err(msgs.join("\n")) +} \ No newline at end of file diff --git a/codegen/src/passes/find_reflect_types.rs b/codegen/src/passes/find_reflect_types.rs index 157c43a3ab..1b7f25e2d5 100644 --- a/codegen/src/passes/find_reflect_types.rs +++ b/codegen/src/passes/find_reflect_types.rs @@ -3,7 +3,7 @@ use rustc_hir::def_id::LOCAL_CRATE; use rustc_middle::ty::AdtDef; use crate::{ - Args, BevyCtxt, DEF_PATHS_REFLECT, + Args, BevyCtxt, candidate::{Annotated, GenerationCandidate, GenerationExclusionNote}, }; @@ -16,27 +16,46 @@ pub(crate) fn find_reflect_types(ctxt: &mut BevyCtxt<'_>, args: &Args) -> bool { _ => return true, }; - for trait_did in tcx.all_local_trait_impls(()).keys() { - // we want to find the canonical `Reflect` trait's implemenations across crates, so let's check all impls and choose those - // whose def_path is equal to what we know the Reflect trait's is - - let def_path_str = tcx.def_path_str(trait_did); - - if !DEF_PATHS_REFLECT.contains(&def_path_str.as_str()) { - continue; - } - - // this returns non-local impls as well - let reflect_trait_impls = tcx.trait_impls_of(trait_did); - - // blanket impls are implementations on generics directly, i.e. `impl From for T` - // non blanket impls may also contain generics but those will be contained within another type i.e. `impl Default for Vec` - // ignore anything with a generic, so blanket_impls are out for now - // we also make sure to only work over types and impls directly in the local crate - let (reflect_adts_did, excluded_candidates): (Vec<_>, Vec<_>) = reflect_trait_impls + let reflect_ref = ctxt.cached_traits.bevy_types.reflect; + let reflect_impls = tcx.trait_impls_of(reflect_ref); + // let sess = ctxt.tcx.sess; + // let source_map = sess.source_map(); + // log::info!( + // "found impls: {:?}", + // reflect_impls.non_blanket_impls().iter().map(|impl_| sess + // .source_map() + // .span_to_location_info(ctxt.tcx.def_span(impl_.))) + // ); + + // blanket impls are implementations on generics directly, i.e. `impl From for T` + // non blanket impls may also contain generics but those will be contained within another type i.e. `impl Default for Vec` + // ignore anything with a generic, so blanket_impls are out for now + // we also make sure to only work over types and impls directly in the local crate + // log::info!( + // "reflect_crate: {:?}, {:?}", + // ctxt.cached_traits.bevy_types.reflect_crate, + // ctxt.tcx + // .def_path(ctxt.cached_traits.bevy_types.reflect_crate.as_def_id()) + // ); + // log::info!( + // "local_crate: {:?}, {:?}", + // ctxt.cached_traits.bevy_types.reflect_crate, + // ctxt.tcx.def_path(LOCAL_CRATE.as_def_id()) + // ); + let (reflect_adts_did, excluded_candidates): (Vec<_>, Vec<_>) = + reflect_impls .non_blanket_impls() .iter() .flat_map(|(self_ty, impl_dids)| impl_dids.iter().zip(std::iter::repeat(self_ty))) + // .inspect(|(impl_did, _)| { + // log::info!( + // "in crate: {LOCAL_CRATE:?}, found impl: \n{impl_did:?}\n{:?}\nis_local: {}\n", + // source_map.span_to_diagnostic_string(tcx.def_span(*impl_did)), + // impl_did.is_local() + // ) + // }) + // non local impls are not relevant, we only care about what a crate implements, we don't want to include in the excluded set either, as these aren't even considered + .filter(|(impl_did, _)| impl_did.is_local()) .map(|(impl_did, self_ty)| { let mut early_candidate = GenerationCandidate::>::default(); @@ -51,12 +70,6 @@ pub(crate) fn find_reflect_types(ctxt: &mut BevyCtxt<'_>, args: &Args) -> bool { early_candidate.did = Some(did); - if !impl_did.is_local() { - return Err(early_candidate.with_note(GenerationExclusionNote::Reason( - format!("impl block {impl_did:?}, is not local"), - ))); - } - let generics = tcx.generics_of(*impl_did); if generics.count() > 0 { return Err(early_candidate.with_note(GenerationExclusionNote::Reason( @@ -110,16 +123,15 @@ pub(crate) fn find_reflect_types(ctxt: &mut BevyCtxt<'_>, args: &Args) -> bool { Ok(early_candidate.promote(adt)) }) .partition_result(); - ctxt.reflect_types - .extend(reflect_adts_did.into_iter().map(|a| (a.def.did(), a))); - ctxt.excluded_reflect_types.extend(excluded_candidates); - } + ctxt.reflect_types + .extend(reflect_adts_did.into_iter().map(|a| (a.def.did(), a))); + ctxt.excluded_reflect_types.extend(excluded_candidates); ctxt.reflect_types .sort_by_cached_key(|did, _| tcx.item_name(*did)); - log::info!("Found: {} types", ctxt.reflect_types.len()); - log::info!("Excluded: {} types", ctxt.excluded_reflect_types.len()); + log::debug!("Found: {} types", ctxt.reflect_types.len()); + log::debug!("Excluded: {} types", ctxt.excluded_reflect_types.len()); true } diff --git a/codegen/src/passes/find_trait_impls.rs b/codegen/src/passes/find_trait_impls.rs index cb1e220daf..dda4ef6c61 100644 --- a/codegen/src/passes/find_trait_impls.rs +++ b/codegen/src/passes/find_trait_impls.rs @@ -31,13 +31,13 @@ pub(crate) fn find_trait_impls(ctxt: &mut BevyCtxt<'_>, _args: &Args) -> bool { // filter out types which have impls both ways let retaining = type_impl_of_trait( tcx, - ctxt.cached_traits.bms_from_script.unwrap(), + ctxt.cached_traits.bms_types.from_script, reflect_ty_did, ) .is_empty() || type_impl_of_trait( tcx, - ctxt.cached_traits.bms_into_script.unwrap(), + ctxt.cached_traits.bms_types.into_script, reflect_ty_did, ) .is_empty(); diff --git a/codegen/src/passes/mod.rs b/codegen/src/passes/mod.rs index 24549f80d7..af99d799db 100644 --- a/codegen/src/passes/mod.rs +++ b/codegen/src/passes/mod.rs @@ -1,6 +1,6 @@ use crate::{Args, BevyCtxt}; -mod cache_traits; +mod cache_items; mod codegen; mod crawl_paths; mod find_methods_and_fields; @@ -28,10 +28,10 @@ pub(crate) const FIND_METHODS_AND_FIELDS: Pass = Pass { cb: find_methods_and_fields::find_methods_and_fields, }; -pub(crate) const CACHE_TRAITS: Pass = Pass { - name: "Cache traits", - description: "Searching for necessary traits", - cb: cache_traits::cache_traits, +pub(crate) const CACHE_ITEMS: Pass = Pass { + name: "Cache items", + description: "Searching for necessary traits and items", + cb: cache_items::cache_items, }; pub(crate) const WRITE_META: Pass = Pass { @@ -65,7 +65,7 @@ pub(crate) const CRAWL_PATHS: Pass = Pass { }; pub(crate) const ALL_PASSES: [Pass; 8] = [ - CACHE_TRAITS, + CACHE_ITEMS, CRAWL_PATHS, // paths needed in the reflect type finder step FIND_REFLECT_TYPES, FIND_TRAIT_IMPLS, // we have to do this before meta as we still filter some things here diff --git a/codegen/src/plugin.rs b/codegen/src/plugin.rs index bc5c88cfd6..043578c147 100644 --- a/codegen/src/plugin.rs +++ b/codegen/src/plugin.rs @@ -1,19 +1,36 @@ -use std::env; +use std::{collections::HashMap, env, path::PathBuf}; -use cargo_metadata::camino::Utf8Path; -use clap::Parser; -use log::debug; +use crate_feature_graph::WorkspaceGraph; +use log::{debug, trace}; +use regex::Regex; +use rustc_hir::def_id::LOCAL_CRATE; +use serde::{Deserialize, Serialize}; +use tera::Context; use crate::{ - BevyAnalyzerCallbacks, WorkspaceMeta, - driver::{CrateFilter, RustcPluginArgs}, + ALL_PASSES, Args, TemplateKind, WORKSPACE_GRAPH_FILE_ENV, WorkspaceMeta, + modifying_file_loader::ModifyingFileLoader, }; -pub struct BevyAnalyzer; -impl crate::driver::RustcPlugin for BevyAnalyzer { - type Args = crate::Args; +#[derive(Clone, Serialize, Deserialize)] +pub struct Payload { + /// The rmeta for the bootstrapped reflect crate + pub bootstrap_deps_path: String, + pub bootstrap_rlibs: HashMap, + pub include_crates: Vec, +} + +#[derive(Serialize, Deserialize)] +pub struct BevyAnalyzer { + pub payload: Payload, + pub args: Args, +} + +struct DefaultCallbacks; +impl rustc_driver::Callbacks for DefaultCallbacks {} - fn version(&self) -> std::borrow::Cow<'static, str> { +impl crate::driver::RustcPlugin for BevyAnalyzer { + fn version() -> std::borrow::Cow<'static, str> { env!("CARGO_PKG_VERSION").into() } @@ -21,35 +38,73 @@ impl crate::driver::RustcPlugin for BevyAnalyzer { "bms-codegen-driver".into() } - fn args(&self, target_dir: &Utf8Path) -> RustcPluginArgs { - debug!("Target dir: {target_dir}"); - - RustcPluginArgs { - args: crate::Args::parse_from(std::env::args().skip(1)), - filter: CrateFilter::OnlyWorkspace, + fn run( + mut self, + crate_name: &str, + mut compiler_args: Vec, + is_not_build_invocation: bool, + ) { + // bootstrapped crates already have artifacts ready to inject + // we don't want to build these, it will only generate errors + let bootstrapped_crate = self.payload.bootstrap_rlibs.contains_key(crate_name); + if bootstrapped_crate { + return; } - } - fn run(self, compiler_args: Vec, plugin_args: Self::Args) { - let mut callbacks = BevyAnalyzerCallbacks::new(plugin_args); + let workspace_crate = self + .payload + .include_crates + .contains(&crate_name.to_string()); + + self.inject_bootstrapped_artifacts(&mut compiler_args); + + // let active_features: Vec = compiler_args + // .windows(2) + // .filter_map(|w| { + // if w[0] == "--cfg" { + // let arg = &w[1]; + + // // Match --cfg feature="foo" + // if let Some(feat) = arg.strip_prefix("feature=") { + // // Trim quotes + // return Some(feat.trim_matches('"').to_string()); + // } + // } + // None + // }) + // .collect(); + + // log::trace!("Rustc received featuress: {}", active_features.join(", ")); - rustc_driver_impl::run_compiler(&compiler_args, &mut callbacks); - log::trace!("Finished compiling with plugin"); + // non-workspace crates can be run as normal without any analysis + // we don't care about these for now, but still need to modify externs to avoid errors, they need to compile fine + if is_not_build_invocation || !workspace_crate { + // for things like --print from cargo + log::info!("Analysing: {crate_name}"); + rustc_driver_impl::run_compiler(&compiler_args, &mut DefaultCallbacks); + } else { + log::info!("Building: {crate_name}"); + rustc_driver_impl::run_compiler(&compiler_args, &mut self); + } } - fn modify_cargo(&self, cmd: &mut std::process::Command, args: &Self::Args) { + fn modify_cargo(&self, cmd: &mut std::process::Command) { *cmd = copy_command_without_args(cmd, &["-q", "-v", "--all", "--workspace"]); cmd.args(["--color", "always"]); - if !args.features.is_empty() { - cmd.args(["--features", &args.features.join(",")]); + if !self.args.features.is_empty() { + log::info!( + "Running cargo with features: {}", + self.args.features.join(",") + ); + cmd.args(["--features", &self.args.features.join(",")]); } - if args.no_default_features { + if self.args.no_default_features { cmd.arg("--no-default-features"); } // make cargo chatty as well - if args.verbose.get_log_level_int() >= 3 { + if self.args.verbose.get_log_level_int() >= 3 { cmd.arg("-vv"); } else { cmd.arg("-q"); @@ -76,6 +131,51 @@ impl crate::driver::RustcPlugin for BevyAnalyzer { .join(" "); log::debug!("Running cargo build command: \n{all_env} {bin_name} {args}",); } + + fn initialize_from_env() -> Self { + serde_json::from_str(&std::env::var(crate::PLUGIN_PAYLOAD).unwrap()).unwrap() + } + + fn serialize_to_env(&self) { + unsafe { std::env::set_var(crate::PLUGIN_PAYLOAD, serde_json::to_string(&self).unwrap()) } + } +} + +impl BevyAnalyzer { + fn inject_bootstrapped_artifacts(&self, compiler_args: &mut Vec) { + log::info!("args: {compiler_args:?}"); + // we now modify externs before running anything via rustc + let regex = + Regex::new(r"(?P(?P(?:\./|/)?[A-Za-z0-9_\-./]*)?(?Plib(?P[A-Za-z0-9_]+)-(?P[A-Fa-f0-9]+)\.(rmeta|rlib)))").unwrap(); + + // inject deps directory as linking dir + compiler_args.extend([ + String::from("-L"), + format!("dependency={}", self.payload.bootstrap_deps_path), + ]); + + // replace existing externs, and if none are found + // inject + for (krate, rlib) in &self.payload.bootstrap_rlibs { + let mut replaced = false; + for arg in compiler_args.iter_mut() { + for matches in regex.captures_iter(&arg.to_string()) { + let rlib_krate = &matches["crate"]; + if rlib_krate == krate { + let found_rlib = &matches["full"]; + log::info!("replacing rlib {found_rlib} with {rlib} for crate {krate}"); + *arg = arg.replace(found_rlib, rlib); + replaced = true; + } + } + } + if !replaced { + let new_args = [String::from("--extern"), format!("{krate}={rlib}")]; + log::info!("injecting rlib for {krate}, injecting: {new_args:?}"); + compiler_args.extend(new_args); + } + } + } } fn copy_command_without_args( @@ -90,3 +190,97 @@ fn copy_command_without_args( new_cmd.envs(cmd.get_envs().filter_map(|(a, b)| b.map(|b| (a, b)))); new_cmd } + +impl rustc_driver::Callbacks for BevyAnalyzer { + fn after_expansion( + &mut self, + compiler: &rustc_interface::interface::Compiler, + tcx: rustc_middle::ty::TyCtxt<'_>, + ) -> rustc_driver::Compilation { + trace!("After expansion callback"); + + let sess = &compiler.sess; + + if sess.dcx().has_errors().is_some() { + sess.dcx().fatal("compilation failed, aborting analysis."); + } + + let mut meta_dirs = Vec::default(); + let mut templates_dir = None; + // add all relevant meta dirs to the context + meta_dirs.push(self.args.output.to_owned()); + if let crate::Command::Generate { + meta, + meta_output, + templates, + .. + } = &self.args.cmd + { + templates.clone_into(&mut templates_dir); + if let Some(meta_output) = meta_output { + meta_dirs.push(meta_output.to_owned()) + }; + meta.iter() + .flatten() + .for_each(|m| meta_dirs.push(m.to_owned())); + }; + + let include_private = match &self.args.cmd { + crate::Command::Generate { + include_private, .. + } => *include_private, + _ => false, + }; + + // tera environment for import processor + let tera = crate::configure_tera(tcx.crate_name(LOCAL_CRATE).as_str(), &templates_dir); + + debug!("Using meta directories: {meta_dirs:?}"); + + let mut graph = WorkspaceGraph::deserialize(&PathBuf::from( + std::env::var(WORKSPACE_GRAPH_FILE_ENV).unwrap(), + )) + .unwrap(); + graph.stable_sort(); + + let mut ctxt = crate::BevyCtxt::new( + tcx, + &meta_dirs, + WorkspaceMeta::from_env(), + include_private, + Some(Box::new(move |import_path| { + let mut ctxt = Context::new(); + ctxt.insert("import", import_path); + tera.render(&TemplateKind::ImportProcessor.to_string(), &ctxt) + .unwrap() + })), + graph, + ); + + trace!("Running all passes"); + for p in ALL_PASSES { + debug!( + "{}, in crate: {}", + p.description, + tcx.crate_name(LOCAL_CRATE), + ); + let continue_ = tcx.sess.time(p.name, || (p.cb)(&mut ctxt, &self.args)); + if !continue_ { + break; + } + trace!("Finished pass, continuing"); + } + + log::info!( + "Analyzed crate: {} (found {} types)", + tcx.crate_name(LOCAL_CRATE), + ctxt.reflect_types.len(), + ); + + rustc_driver::Compilation::Continue + } + + fn config(&mut self, config: &mut rustc_interface::interface::Config) { + config.file_loader = Some(Box::new(ModifyingFileLoader)); + } +} diff --git a/codegen/src/ty_convert.rs b/codegen/src/ty_convert.rs new file mode 100644 index 0000000000..ffb293af6f --- /dev/null +++ b/codegen/src/ty_convert.rs @@ -0,0 +1,186 @@ +use rustc_ast::Mutability; +use rustc_hir::def_id::DefId; +use rustc_middle::ty::{ + self, AliasTy, GenericArg, GenericArgKind, GenericParamDef, GenericParamDefKind, Ty, TyCtxt, + TyKind, +}; + +use crate::BmsTypes; +pub fn wrap_non_primtiives<'tcx>( + ty: Ty<'tcx>, + tcx: TyCtxt<'tcx>, + wrapper_ids: &BmsTypes, +) -> Ty<'tcx> { + wrap_type_signature(tcx, ty, wrapper_ids) +} + +pub fn wrap_type_signature<'tcx>( + tcx: TyCtxt<'tcx>, + ty: Ty<'tcx>, + bms_types: &BmsTypes, +) -> Ty<'tcx> { + fn go<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, bms_types: &BmsTypes) -> Ty<'tcx> { + match ty.kind() { + // ----- ADTs ----- + TyKind::Adt(adt_def, args) => { + // if w.primitive_adts.contains(&adt_def.did()) { + // return ty; + // } + if ty.type_in_bms_wrapper(bms_types).is_some() { + return ty; + } + + // generics preserved + if !args.is_empty() { + let new_args = + tcx.mk_args_from_iter(args.iter().map(|a| go_generic(tcx, a, bms_types))); + return tcx.mk_ty_from_kind(TyKind::Adt(*adt_def, new_args)); + } + + // Non-generic ADT → wrap in Val + let new_args = + tcx.mk_args_from_iter(args.iter().map(|a| go_generic(tcx, a, bms_types))); + let inner = tcx.mk_ty_from_kind(TyKind::Adt(*adt_def, new_args)); + + wrap_val(tcx, inner, bms_types) + } + + // ----- Alias types ----- + TyKind::Alias(kind, alias_ty) => { + let new_args = tcx + .mk_args_from_iter(alias_ty.args.iter().map(|a| go_generic(tcx, a, bms_types))); + let new_alias = AliasTy::new_from_args(tcx, alias_ty.def_id, new_args); + + // Do NOT wrap an alias — keep structure. + tcx.mk_ty_from_kind(TyKind::Alias(*kind, new_alias)) + } + + // ----- References (&T, &mut T) ----- + TyKind::Ref(_region, inner, mutbl) => { + let inner_wrapped = go(tcx, *inner, bms_types); + + match mutbl { + Mutability::Not => { + if matches!(inner_wrapped.kind(), + TyKind::Adt(adt, _) if adt.did() == bms_types.ref_wrapper + ) { + inner_wrapped + } else { + wrap_ref(tcx, inner_wrapped, bms_types) + } + } + Mutability::Mut => { + if matches!(inner_wrapped.kind(), + TyKind::Adt(adt, _) if adt.did() == bms_types.mut_wrapper + ) { + inner_wrapped + } else { + wrap_mut(tcx, inner_wrapped, bms_types) + } + } + } + } + + // ----- Arrays / slices ----- + TyKind::Array(elem, len) => { + let new_elem = go(tcx, *elem, bms_types); + tcx.mk_ty_from_kind(TyKind::Array(new_elem, *len)) + } + + TyKind::Slice(elem) => { + let new_elem = go(tcx, *elem, bms_types); + tcx.mk_ty_from_kind(TyKind::Slice(new_elem)) + } + + // ----- Everything else left unchanged ----- + _ => ty, + } + } + + fn go_generic<'tcx>( + tcx: TyCtxt<'tcx>, + arg: GenericArg<'tcx>, + bms_types: &BmsTypes, + ) -> GenericArg<'tcx> { + match arg.kind() { + GenericArgKind::Type(t) => go(tcx, t, bms_types).into(), + _ => arg, + } + } + + /// Build GenericArgs for a wrapper ADT so the arg kinds match the wrapper's generics. + /// The `inner` type will be placed into the first Type generic parameter encountered. + /// Lifetime parameters will receive an erased region. + fn make_wrapper_args<'tcx>( + tcx: TyCtxt<'tcx>, + wrapper_def_id: DefId, + inner: Ty<'tcx>, + ) -> ty::GenericArgsRef<'tcx> { + let generics = tcx.generics_of(wrapper_def_id); + + // iterator producing GenericArg<'tcx> + let args_iter = generics.own_params.iter().map(|param: &GenericParamDef| { + match param.kind { + GenericParamDefKind::Lifetime => { + // produce erased region GenericArg + + let erased_region = tcx.lifetimes.re_erased; // adjust if your API differs + GenericArg::from(erased_region) + } + + GenericParamDefKind::Type { .. } => GenericArg::from(inner), + + GenericParamDefKind::Const { .. } => { + // Most wrapper ADTs won't have const params; if they do, you must create a const GenericArg. + // For now, abort so the mismatch is explicit. + panic!( + "wrapper ADT has const generic param; not supported by make_wrapper_args" + ); + } + } + }); + + tcx.mk_args_from_iter(args_iter) + } + + fn wrap_val<'tcx>(tcx: TyCtxt<'tcx>, inner: Ty<'tcx>, bms_types: &BmsTypes) -> Ty<'tcx> { + // guard double-wrap + if inner.type_in_bms_wrapper(bms_types).is_some() { + return inner; + } + + let adt = tcx.adt_def(bms_types.val_wrapper); + let args = make_wrapper_args(tcx, adt.did(), inner); + tcx.mk_ty_from_kind(TyKind::Adt(adt, args)) + } + + fn wrap_ref<'tcx>(tcx: TyCtxt<'tcx>, inner: Ty<'tcx>, bms_types: &BmsTypes) -> Ty<'tcx> { + let adt = tcx.adt_def(bms_types.ref_wrapper); + let args = make_wrapper_args(tcx, adt.did(), inner); + tcx.mk_ty_from_kind(TyKind::Adt(adt, args)) + } + + fn wrap_mut<'tcx>(tcx: TyCtxt<'tcx>, inner: Ty<'tcx>, bms_types: &BmsTypes) -> Ty<'tcx> { + let adt = tcx.adt_def(bms_types.mut_wrapper); + let args = make_wrapper_args(tcx, adt.did(), inner); + tcx.mk_ty_from_kind(TyKind::Adt(adt, args)) + } + + go(tcx, ty, bms_types) +} + +pub(crate) trait UnwrapWrapper<'tcx> { + fn type_in_bms_wrapper(&self, ctxt: &BmsTypes) -> Option>; +} + +impl<'tcx> UnwrapWrapper<'tcx> for Ty<'tcx> { + fn type_in_bms_wrapper(&self, ctxt: &BmsTypes) -> Option> { + if let TyKind::Adt(ty, args) = self.kind() + && [ctxt.mut_wrapper, ctxt.ref_wrapper, ctxt.val_wrapper].contains(&ty.did()) + && let Some(inner) = args.iter().find_map(|a| a.as_type()) + { + return Some(inner); + } + None + } +} diff --git a/codegen/templates/footer.tera b/codegen/templates/footer.tera index 82e2c1544c..65d27c141f 100644 --- a/codegen/templates/footer.tera +++ b/codegen/templates/footer.tera @@ -21,7 +21,7 @@ impl {{item.import_path}} { : {{ arg.proxy_ty -}}, {%- endfor -%} ) -> {{ function.output.proxy_ty }} { - let output: {{ function.output.proxy_ty }} = + let output: {{ function.output.ty }} = {%- if function.from_trait_path -%} {{- function_call_expression(type=item.import_path, trait=function.from_trait_path, function=function.ident) -}} {%- else -%} @@ -29,18 +29,10 @@ impl {{item.import_path}} { {%- endif -%} ( {%- for arg in function.args -%} - {%- if arg.proxy_ty is matching("Ref.*")-%} - & {{ arg.ident | to_arg_pattern() -}} - {%- elif arg.proxy_ty is matching ("Mut.*")-%} - &mut {{ arg.ident | to_arg_pattern() -}} - {%- elif arg.proxy_ty is matching("Val.*")-%} - {{- arg.ident | to_arg_pattern() -}}.into_inner() - {%- else -%} - {{- arg.ident | to_arg_pattern() -}} - {%- endif -%}, + safe_transmute({{arg.ident | to_arg_pattern() }}), {%- endfor -%} - ).into(); - output + ); + safe_transmute(output) } {% endfor %} } diff --git a/codegen/templates/header.tera b/codegen/templates/header.tera index e5fbb05c0a..ba0e6a6fbd 100644 --- a/codegen/templates/header.tera +++ b/codegen/templates/header.tera @@ -4,7 +4,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, - function::{from::{Ref, Mut, Val}, namespace::{NamespaceBuilder}} + function::{from::{Ref, Mut, Val}, namespace::{NamespaceBuilder}, glue::safe_transmute} }; use bevy_ecs::{prelude::*}; use bevy_app::{App, Plugin}; diff --git a/crates/bevy_mod_scripting_bindings/src/function/from.rs b/crates/bevy_mod_scripting_bindings/src/function/from.rs index 33fa2d8006..7d2465cf98 100644 --- a/crates/bevy_mod_scripting_bindings/src/function/from.rs +++ b/crates/bevy_mod_scripting_bindings/src/function/from.rs @@ -183,6 +183,7 @@ impl FromScript for ReflectReference { /// This can be used to retrieve a value out of a [`ScriptValue::Reference`] corresponding to the type `T`. /// You can also use this to return values from a script function to be allocated directly as a [`ScriptValue::Reference`]. #[derive(Reflect)] +#[repr(transparent)] pub struct Val(pub T); #[profiling::all_functions] @@ -253,6 +254,7 @@ impl FromScript for Val { /// /// However, the access is NOT released when the `Mut` is dropped. This is not unsafe but can lead to deadlocks if not released later. /// The script function calling mechanism will take care of releasing all accesses claimed during the function call. +#[repr(transparent)] pub struct Ref<'w, T>(pub &'w T); impl Deref for Ref<'_, T> { @@ -314,6 +316,7 @@ impl<'a, T> From<&'a T> for Ref<'a, T> { /// /// However, the access is NOT released when the `Mut` is dropped. This is not unsafe but can lead to deadlocks if not released later. /// The [`ScriptFunction`] calling mechanism will take care of releasing all accesses claimed during the function call. +#[repr(transparent)] pub struct Mut<'w, T>(pub &'w mut T); impl Deref for Mut<'_, T> { diff --git a/crates/bevy_mod_scripting_bindings/src/function/glue.rs b/crates/bevy_mod_scripting_bindings/src/function/glue.rs new file mode 100644 index 0000000000..8652232855 --- /dev/null +++ b/crates/bevy_mod_scripting_bindings/src/function/glue.rs @@ -0,0 +1,334 @@ +//! Glue traits for "unwrapping" bindings to their raw form + +use std::{mem, ptr}; + +use variadics_please::all_tuples; + +use crate::{Mut, Ref, Val}; + +// glue.rs (or wherever) +mod sealed { + // Sealed relationship for a *pair* (L -> R). + // This prevents external crates from implementing CanTransmute for arbitrary pairs. + pub trait Sealed {} +} + +// Public trait: L can transmute to R +pub trait CanTransmute: sealed::Sealed { + fn safe_transmute(self) -> Rhs; +} + +// === Implementations === + +// ======================= +// Primitive / wrapper identity impls +// ======================= + +// For string slices — generic over any lifetime +impl<'a> sealed::Sealed<&'a str> for &'a str {} +impl<'a> CanTransmute<&'a str> for &'a str { + fn safe_transmute(self) -> &'a str { + self + } +} + +// Identity for primitives / base types +macro_rules! impl_identity { + ($($t:ty),*) => { + $( + impl sealed::Sealed<$t> for $t {} + impl CanTransmute<$t> for $t { + fn safe_transmute(self) -> $t { self } + } + )* + }; +} + +// Add the types you need +impl_identity!( + (), + usize, + isize, + u8, + u16, + u32, + u64, + u128, + i8, + i16, + i32, + i64, + i128, + bool, + char, + f32, + f64, + String +); + +// === Wrapper -> Inner === + +// Ref<'a, T> -> &'b T +impl<'a, 'b, T> sealed::Sealed<&'b T> for Ref<'a, T> where 'a: 'b {} +impl<'a, 'b, T> CanTransmute<&'b T> for Ref<'a, T> +where + 'a: 'b, +{ + fn safe_transmute(self) -> &'b T { + let Ref(inner) = self; + inner + } +} + +// Mut<'a, T> -> &'b mut T +impl<'a, 'b, T> sealed::Sealed<&'b mut T> for Mut<'a, T> where 'a: 'b {} +impl<'a, 'b, T> CanTransmute<&'b mut T> for Mut<'a, T> +where + 'a: 'b, +{ + fn safe_transmute(self) -> &'b mut T { + let Mut(inner) = self; + inner + } +} + +// Val -> T +impl sealed::Sealed for Val {} +impl CanTransmute for Val { + fn safe_transmute(self) -> T { + unsafe { + let out = std::ptr::read(&self as *const Val as *const T); + std::mem::forget(self); + out + } + } +} + +// ======================= +// Recursive container impls +// ======================= + +// Vec +impl sealed::Sealed> for Vec where T: CanTransmute {} +impl CanTransmute> for Vec +where + T: CanTransmute, +{ + fn safe_transmute(self) -> Vec { + unsafe { std::mem::transmute(self) } + } +} + +impl sealed::Sealed> for Option where T: CanTransmute {} + +// Option +impl CanTransmute> for Option +where + T: CanTransmute, +{ + fn safe_transmute(self) -> Option { + unsafe { + // Bitwise move the whole Option into Option + let out = ptr::read(&self as *const Option as *const Option); + mem::forget(self); + out + } + } +} + +// Result +impl sealed::Sealed> for Result +where + T: CanTransmute, + E: CanTransmute, +{ +} +impl CanTransmute> for Result +where + T: CanTransmute, + E: CanTransmute, +{ + fn safe_transmute(self) -> Result { + unsafe { + let out = ptr::read(&self as *const Result as *const Result); + mem::forget(self); + out + } + } +} +impl sealed::Sealed<[U; N]> for [T; N] where T: CanTransmute {} + +impl CanTransmute<[U; N]> for [T; N] +where + T: CanTransmute, +{ + fn safe_transmute(self) -> [U; N] { + use core::{mem, ptr}; + + // Move `self` into a raw pointer + let ptr = &self as *const [T; N] as *const [U; N]; + + // Prevent drop of `self` + let out = unsafe { ptr::read(ptr) }; + + mem::forget(self); + + out + } +} + +pub fn safe_transmute(input: In) -> Out +where + In: CanTransmute + Sized, + Out: Sized, +{ + input.safe_transmute() +} + +impl sealed::Sealed> for T {} +impl CanTransmute> for T { + fn safe_transmute(self) -> Val { + Val(self) + } +} + +impl<'a, T> sealed::Sealed> for &'a T {} +impl<'a, T> CanTransmute> for &'a T { + fn safe_transmute(self) -> Ref<'a, T> { + Ref(self) + } +} + +impl<'a, T> sealed::Sealed> for &'a mut T {} +impl<'a, T> CanTransmute> for &'a mut T { + fn safe_transmute(self) -> Mut<'a, T> { + Mut(self) + } +} + +macro_rules! impl_can_transmute_tuple { + // Each entry gives us three identifiers: T, U, t + ($(($T:ident, $U:ident, $t:ident)),*) => { + impl< $( $T: CanTransmute<$U>, $U ),* > + sealed::Sealed<( $( $U ),* )> + for ( $( $T ),* ) + {} + + impl< $( $T: CanTransmute<$U>, $U ),* > + CanTransmute<( $( $U ),* )> + for ( $( $T ),* ) + { + fn safe_transmute(self) -> ( $( $U ),* ) { + let ( $( $t ),* ) = self; + ( $( $t.safe_transmute() ),* ) + } + } + } +} + +all_tuples!(impl_can_transmute_tuple, 2, 15, T, U, t); + +#[doc(hidden)] +pub const fn assert_layout_equiv() { + // SAFETY: W must be #[repr(transparent)] over T + if std::mem::size_of::() != std::mem::size_of::() { + panic!("Invariant broken, size of types is differnt.",) + } + if std::mem::align_of::() != std::mem::align_of::() { + panic!("Invariant broken, alignment of types is differnt.",) + } +} + +#[doc(hidden)] +#[allow(dead_code)] +const SAFETY_ASSERTION: () = { + assert_layout_equiv::, &mut usize>(); + assert_layout_equiv::, &usize>(); + assert_layout_equiv::, usize>(); +}; + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_identity_transmute() { + let x: u32 = safe_transmute::(123); + assert_eq!(x, 123); + } + + #[test] + fn test_val_to_inner() { + let v = Val(vec![1, 2, 3]); + let out: Vec = safe_transmute(v); + assert_eq!(out, vec![1, 2, 3]); + } + + #[test] + fn test_ref_to_ref() { + let x = 10; + let r = Ref(&x); + + let out: &i32 = safe_transmute(r); + assert_eq!(*out, 10); + } + + #[test] + fn test_mut_to_mut() { + let mut x = 5; + let m = Mut(&mut x); + + let out: &mut i32 = safe_transmute(m); + *out = 99; + assert_eq!(x, 99); + } + + #[test] + fn test_vec_of_val() { + let v = vec![Val(1), Val(2), Val(3)]; + let out: Vec = safe_transmute(v); + assert_eq!(out, vec![1, 2, 3]); + } + + #[test] + fn test_option_of_val_some() { + let v = Some(Val(42)); + let out: Option = safe_transmute(v); + assert_eq!(out, Some(42)); + } + + #[test] + fn test_option_of_val_none() { + let v: Option> = None; + let out: Option = safe_transmute(v); + assert_eq!(out, None); + } + + #[test] + fn test_result_of_val_ok() { + let r: Result, Val<&str>> = Ok(Val(10)); + let out: Result = safe_transmute(r); + assert!(matches!(out, Ok(10))); + } + + #[test] + fn test_result_of_val_err() { + let r: Result, Val<&str>> = Err(Val("fail")); + let out: Result = safe_transmute(r); + assert!(matches!(out, Err("fail"))); + } + + #[test] + fn test_vec_of_option_of_val() { + let v = vec![Some(Val(1)), None, Some(Val(3))]; + let out: Vec> = safe_transmute(v); + assert_eq!(out, vec![Some(1), None, Some(3)]); + } + + #[test] + fn test_nested_result_vec_val() { + let r: Result>, Val<&str>> = Ok(vec![Val(1), Val(2)]); + let out: Result, &str> = safe_transmute(r); + assert_eq!(out.unwrap(), vec![1, 2]); + } +} diff --git a/crates/bevy_mod_scripting_bindings/src/function/mod.rs b/crates/bevy_mod_scripting_bindings/src/function/mod.rs index c309d18131..524d250c3d 100644 --- a/crates/bevy_mod_scripting_bindings/src/function/mod.rs +++ b/crates/bevy_mod_scripting_bindings/src/function/mod.rs @@ -3,6 +3,8 @@ pub mod arg_meta; pub mod from; pub mod from_ref; +#[doc(hidden)] +pub mod glue; pub mod into; pub mod into_ref; pub mod magic_functions; diff --git a/crates/bindings/bevy_a11y_bms_bindings/src/lib.rs b/crates/bindings/bevy_a11y_bms_bindings/src/lib.rs index 7b7f72cd41..9250ca8ca0 100644 --- a/crates/bindings/bevy_a11y_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_a11y_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_accessibility_requested_functions(world: &mut World) { |_self: Ref<::bevy_a11y::AccessibilityRequested>| { let output: Val<::bevy_a11y::AccessibilityRequested> = { { - let output: Val<::bevy_a11y::AccessibilityRequested> = <::bevy_a11y::AccessibilityRequested as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_a11y::AccessibilityRequested = <::bevy_a11y::AccessibilityRequested as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -42,10 +41,9 @@ pub(crate) fn register_accessibility_requested_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_a11y::AccessibilityRequested::get( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -59,11 +57,10 @@ pub(crate) fn register_accessibility_requested_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_a11y::AccessibilityRequested::set( - &_self, - value, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -88,11 +85,10 @@ pub(crate) fn register_manage_accessibility_updates_functions(world: &mut World) |_self: Ref<::bevy_a11y::ManageAccessibilityUpdates>| { let output: Val<::bevy_a11y::ManageAccessibilityUpdates> = { { - let output: Val<::bevy_a11y::ManageAccessibilityUpdates> = <::bevy_a11y::ManageAccessibilityUpdates as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_a11y::ManageAccessibilityUpdates = <::bevy_a11y::ManageAccessibilityUpdates as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -106,10 +102,9 @@ pub(crate) fn register_manage_accessibility_updates_functions(world: &mut World) let output: bool = { { let output: bool = ::bevy_a11y::ManageAccessibilityUpdates::get( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -123,11 +118,10 @@ pub(crate) fn register_manage_accessibility_updates_functions(world: &mut World) let output: () = { { let output: () = ::bevy_a11y::ManageAccessibilityUpdates::set( - &mut _self, - value, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -153,10 +147,9 @@ pub(crate) fn register_accessibility_systems_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_a11y::AccessibilitySystems as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -169,11 +162,10 @@ pub(crate) fn register_accessibility_systems_functions(world: &mut World) { |_self: Ref<::bevy_a11y::AccessibilitySystems>| { let output: Val<::bevy_a11y::AccessibilitySystems> = { { - let output: Val<::bevy_a11y::AccessibilitySystems> = <::bevy_a11y::AccessibilitySystems as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_a11y::AccessibilitySystems = <::bevy_a11y::AccessibilitySystems as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -191,9 +183,8 @@ pub(crate) fn register_accessibility_systems_functions(world: &mut World) { { let output: bool = <::bevy_a11y::AccessibilitySystems as ::core::cmp::PartialEq< ::bevy_a11y::AccessibilitySystems, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_animation_bms_bindings/src/lib.rs b/crates/bindings/bevy_animation_bms_bindings/src/lib.rs index 9670f0b3b2..64a5ad33fd 100644 --- a/crates/bindings/bevy_animation_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_animation_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_animation_node_type_functions(world: &mut World) { |_self: Ref<::bevy_animation::graph::AnimationNodeType>| { let output: Val<::bevy_animation::graph::AnimationNodeType> = { { - let output: Val<::bevy_animation::graph::AnimationNodeType> = <::bevy_animation::graph::AnimationNodeType as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::graph::AnimationNodeType = <::bevy_animation::graph::AnimationNodeType as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -54,10 +53,9 @@ pub(crate) fn register_animation_graph_handle_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_animation::graph::AnimationGraphHandle as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -70,11 +68,10 @@ pub(crate) fn register_animation_graph_handle_functions(world: &mut World) { |_self: Ref<::bevy_animation::graph::AnimationGraphHandle>| { let output: Val<::bevy_animation::graph::AnimationGraphHandle> = { { - let output: Val<::bevy_animation::graph::AnimationGraphHandle> = <::bevy_animation::graph::AnimationGraphHandle as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::graph::AnimationGraphHandle = <::bevy_animation::graph::AnimationGraphHandle as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -92,9 +89,8 @@ pub(crate) fn register_animation_graph_handle_functions(world: &mut World) { { let output: bool = <::bevy_animation::graph::AnimationGraphHandle as ::std::cmp::PartialEq< ::bevy_animation::graph::AnimationGraphHandle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -131,11 +127,10 @@ pub(crate) fn register_animation_clip_functions(world: &mut World) { |_self: Ref<::bevy_animation::AnimationClip>| { let output: Val<::bevy_animation::AnimationClip> = { { - let output: Val<::bevy_animation::AnimationClip> = <::bevy_animation::AnimationClip as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::AnimationClip = <::bevy_animation::AnimationClip as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -149,10 +144,9 @@ pub(crate) fn register_animation_clip_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_animation::AnimationClip::duration( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -166,11 +160,10 @@ pub(crate) fn register_animation_clip_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_animation::AnimationClip::set_duration( - &mut _self, - duration_sec, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(duration_sec), + ); + safe_transmute(output) } }; output @@ -196,10 +189,9 @@ pub(crate) fn register_animation_player_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_animation::AnimationPlayer::all_finished( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -213,10 +205,9 @@ pub(crate) fn register_animation_player_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_animation::AnimationPlayer::all_paused( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -229,11 +220,10 @@ pub(crate) fn register_animation_player_functions(world: &mut World) { |_self: Ref<::bevy_animation::AnimationPlayer>| { let output: Val<::bevy_animation::AnimationPlayer> = { { - let output: Val<::bevy_animation::AnimationPlayer> = <::bevy_animation::AnimationPlayer as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::AnimationPlayer = <::bevy_animation::AnimationPlayer as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -250,11 +240,10 @@ pub(crate) fn register_animation_player_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_animation::AnimationPlayer as ::std::clone::Clone>::clone_from( - &mut _self, - &source, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(source), + ); + safe_transmute(output) } }; output @@ -284,12 +273,11 @@ pub(crate) fn register_animation_graph_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_animation::graph::AnimationGraph::add_target_to_mask_group( - &mut _self, - target.into_inner(), - mask_group, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(target), + safe_transmute(mask_group), + ); + safe_transmute(output) } }; output @@ -302,11 +290,10 @@ pub(crate) fn register_animation_graph_functions(world: &mut World) { |_self: Ref<::bevy_animation::graph::AnimationGraph>| { let output: Val<::bevy_animation::graph::AnimationGraph> = { { - let output: Val<::bevy_animation::graph::AnimationGraph> = <::bevy_animation::graph::AnimationGraph as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::graph::AnimationGraph = <::bevy_animation::graph::AnimationGraph as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -319,9 +306,8 @@ pub(crate) fn register_animation_graph_functions(world: &mut World) { || { let output: Val<::bevy_animation::graph::AnimationGraph> = { { - let output: Val<::bevy_animation::graph::AnimationGraph> = ::bevy_animation::graph::AnimationGraph::new() - .into(); - output + let output: ::bevy_animation::graph::AnimationGraph = ::bevy_animation::graph::AnimationGraph::new(); + safe_transmute(output) } }; output @@ -347,10 +333,9 @@ pub(crate) fn register_animation_target_id_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_animation::AnimationTargetId as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -363,11 +348,10 @@ pub(crate) fn register_animation_target_id_functions(world: &mut World) { |_self: Ref<::bevy_animation::AnimationTargetId>| { let output: Val<::bevy_animation::AnimationTargetId> = { { - let output: Val<::bevy_animation::AnimationTargetId> = <::bevy_animation::AnimationTargetId as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::AnimationTargetId = <::bevy_animation::AnimationTargetId as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -385,9 +369,8 @@ pub(crate) fn register_animation_target_id_functions(world: &mut World) { { let output: bool = <::bevy_animation::AnimationTargetId as ::std::cmp::PartialEq< ::bevy_animation::AnimationTargetId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -400,11 +383,10 @@ pub(crate) fn register_animation_target_id_functions(world: &mut World) { |name: Ref<::bevy_ecs::name::Name>| { let output: Val<::bevy_animation::AnimationTargetId> = { { - let output: Val<::bevy_animation::AnimationTargetId> = ::bevy_animation::AnimationTargetId::from_name( - &name, - ) - .into(); - output + let output: ::bevy_animation::AnimationTargetId = ::bevy_animation::AnimationTargetId::from_name( + safe_transmute(name), + ); + safe_transmute(output) } }; output @@ -429,11 +411,10 @@ pub(crate) fn register_animation_target_functions(world: &mut World) { |_self: Ref<::bevy_animation::AnimationTarget>| { let output: Val<::bevy_animation::AnimationTarget> = { { - let output: Val<::bevy_animation::AnimationTarget> = <::bevy_animation::AnimationTarget as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::AnimationTarget = <::bevy_animation::AnimationTarget as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -459,10 +440,9 @@ pub(crate) fn register_repeat_animation_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_animation::RepeatAnimation as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -475,11 +455,10 @@ pub(crate) fn register_repeat_animation_functions(world: &mut World) { |_self: Ref<::bevy_animation::RepeatAnimation>| { let output: Val<::bevy_animation::RepeatAnimation> = { { - let output: Val<::bevy_animation::RepeatAnimation> = <::bevy_animation::RepeatAnimation as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::RepeatAnimation = <::bevy_animation::RepeatAnimation as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -497,9 +476,8 @@ pub(crate) fn register_repeat_animation_functions(world: &mut World) { { let output: bool = <::bevy_animation::RepeatAnimation as ::std::cmp::PartialEq< ::bevy_animation::RepeatAnimation, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -524,11 +502,10 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { |_self: Ref<::bevy_animation::ActiveAnimation>| { let output: Val<::bevy_animation::ActiveAnimation> = { { - let output: Val<::bevy_animation::ActiveAnimation> = <::bevy_animation::ActiveAnimation as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::ActiveAnimation = <::bevy_animation::ActiveAnimation as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -542,10 +519,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_animation::ActiveAnimation::completions( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -559,10 +535,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_animation::ActiveAnimation::elapsed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -576,10 +551,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_animation::ActiveAnimation::is_finished( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -593,10 +567,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_animation::ActiveAnimation::is_paused( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -610,10 +583,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_animation::ActiveAnimation::is_playback_reversed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -626,11 +598,10 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { |_self: Ref<::bevy_animation::ActiveAnimation>| { let output: Val<::bevy_animation::RepeatAnimation> = { { - let output: Val<::bevy_animation::RepeatAnimation> = ::bevy_animation::ActiveAnimation::repeat_mode( - &_self, - ) - .into(); - output + let output: ::bevy_animation::RepeatAnimation = ::bevy_animation::ActiveAnimation::repeat_mode( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -644,10 +615,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_animation::ActiveAnimation::replay( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -661,10 +631,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_animation::ActiveAnimation::seek_time( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -678,10 +647,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_animation::ActiveAnimation::speed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -695,10 +663,9 @@ pub(crate) fn register_active_animation_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_animation::ActiveAnimation::weight( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -723,11 +690,10 @@ pub(crate) fn register_weights_curve_functions(world: &mut World) { |_self: Ref<::bevy_animation::gltf_curves::WeightsCurve>| { let output: Val<::bevy_animation::gltf_curves::WeightsCurve> = { { - let output: Val<::bevy_animation::gltf_curves::WeightsCurve> = <::bevy_animation::gltf_curves::WeightsCurve as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::gltf_curves::WeightsCurve = <::bevy_animation::gltf_curves::WeightsCurve as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -752,13 +718,10 @@ pub(crate) fn register_cubic_rotation_curve_functions(world: &mut World) { |_self: Ref<::bevy_animation::gltf_curves::CubicRotationCurve>| { let output: Val<::bevy_animation::gltf_curves::CubicRotationCurve> = { { - let output: Val< - ::bevy_animation::gltf_curves::CubicRotationCurve, - > = <::bevy_animation::gltf_curves::CubicRotationCurve as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::gltf_curves::CubicRotationCurve = <::bevy_animation::gltf_curves::CubicRotationCurve as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -783,11 +746,10 @@ pub(crate) fn register_animation_graph_node_functions(world: &mut World) { |_self: Ref<::bevy_animation::graph::AnimationGraphNode>| { let output: Val<::bevy_animation::graph::AnimationGraphNode> = { { - let output: Val<::bevy_animation::graph::AnimationGraphNode> = <::bevy_animation::graph::AnimationGraphNode as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::graph::AnimationGraphNode = <::bevy_animation::graph::AnimationGraphNode as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -824,13 +786,10 @@ pub(crate) fn register_animation_transitions_functions(world: &mut World) { |_self: Ref<::bevy_animation::transition::AnimationTransitions>| { let output: Val<::bevy_animation::transition::AnimationTransitions> = { { - let output: Val< - ::bevy_animation::transition::AnimationTransitions, - > = <::bevy_animation::transition::AnimationTransitions as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::transition::AnimationTransitions = <::bevy_animation::transition::AnimationTransitions as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -847,11 +806,10 @@ pub(crate) fn register_animation_transitions_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_animation::transition::AnimationTransitions as ::std::clone::Clone>::clone_from( - &mut _self, - &source, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(source), + ); + safe_transmute(output) } }; output @@ -864,11 +822,8 @@ pub(crate) fn register_animation_transitions_functions(world: &mut World) { || { let output: Val<::bevy_animation::transition::AnimationTransitions> = { { - let output: Val< - ::bevy_animation::transition::AnimationTransitions, - > = ::bevy_animation::transition::AnimationTransitions::new() - .into(); - output + let output: ::bevy_animation::transition::AnimationTransitions = ::bevy_animation::transition::AnimationTransitions::new(); + safe_transmute(output) } }; output @@ -893,13 +848,10 @@ pub(crate) fn register_animation_transition_functions(world: &mut World) { |_self: Ref<::bevy_animation::transition::AnimationTransition>| { let output: Val<::bevy_animation::transition::AnimationTransition> = { { - let output: Val< - ::bevy_animation::transition::AnimationTransition, - > = <::bevy_animation::transition::AnimationTransition as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_animation::transition::AnimationTransition = <::bevy_animation::transition::AnimationTransition as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_asset_bms_bindings/src/lib.rs b/crates/bindings/bevy_asset_bms_bindings/src/lib.rs index 4c474c9c87..d3ea9a7b8d 100644 --- a/crates/bindings/bevy_asset_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_asset_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_untyped_handle_functions(world: &mut World) { |_self: Ref<::bevy_asset::UntypedHandle>| { let output: Val<::bevy_asset::UntypedHandle> = { { - let output: Val<::bevy_asset::UntypedHandle> = <::bevy_asset::UntypedHandle as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_asset::UntypedHandle = <::bevy_asset::UntypedHandle as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -46,9 +45,8 @@ pub(crate) fn register_untyped_handle_functions(world: &mut World) { { let output: bool = <::bevy_asset::UntypedHandle as ::core::cmp::PartialEq< ::bevy_asset::UntypedHandle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -61,11 +59,10 @@ pub(crate) fn register_untyped_handle_functions(world: &mut World) { |_self: Ref<::bevy_asset::UntypedHandle>| { let output: Val<::bevy_asset::UntypedAssetId> = { { - let output: Val<::bevy_asset::UntypedAssetId> = ::bevy_asset::UntypedHandle::id( - &_self, - ) - .into(); - output + let output: ::bevy_asset::UntypedAssetId = ::bevy_asset::UntypedHandle::id( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -78,11 +75,10 @@ pub(crate) fn register_untyped_handle_functions(world: &mut World) { |_self: Ref<::bevy_asset::UntypedHandle>| { let output: Val<::core::any::TypeId> = { { - let output: Val<::core::any::TypeId> = ::bevy_asset::UntypedHandle::type_id( - &_self, - ) - .into(); - output + let output: ::core::any::TypeId = ::bevy_asset::UntypedHandle::type_id( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -107,11 +103,10 @@ pub(crate) fn register_untyped_asset_id_functions(world: &mut World) { |_self: Ref<::bevy_asset::UntypedAssetId>| { let output: Val<::bevy_asset::UntypedAssetId> = { { - let output: Val<::bevy_asset::UntypedAssetId> = <::bevy_asset::UntypedAssetId as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_asset::UntypedAssetId = <::bevy_asset::UntypedAssetId as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -129,9 +124,8 @@ pub(crate) fn register_untyped_asset_id_functions(world: &mut World) { { let output: bool = <::bevy_asset::UntypedAssetId as ::core::cmp::PartialEq< ::bevy_asset::UntypedAssetId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -144,11 +138,10 @@ pub(crate) fn register_untyped_asset_id_functions(world: &mut World) { |_self: Ref<::bevy_asset::UntypedAssetId>| { let output: Val<::core::any::TypeId> = { { - let output: Val<::core::any::TypeId> = ::bevy_asset::UntypedAssetId::type_id( - &_self, - ) - .into(); - output + let output: ::core::any::TypeId = ::bevy_asset::UntypedAssetId::type_id( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -174,10 +167,9 @@ pub(crate) fn register_asset_index_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_asset::AssetIndex as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -190,11 +182,10 @@ pub(crate) fn register_asset_index_functions(world: &mut World) { |_self: Ref<::bevy_asset::AssetIndex>| { let output: Val<::bevy_asset::AssetIndex> = { { - let output: Val<::bevy_asset::AssetIndex> = <::bevy_asset::AssetIndex as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_asset::AssetIndex = <::bevy_asset::AssetIndex as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -209,9 +200,8 @@ pub(crate) fn register_asset_index_functions(world: &mut World) { { let output: bool = <::bevy_asset::AssetIndex as ::core::cmp::PartialEq< ::bevy_asset::AssetIndex, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -224,11 +214,10 @@ pub(crate) fn register_asset_index_functions(world: &mut World) { |bits: u64| { let output: Val<::bevy_asset::AssetIndex> = { { - let output: Val<::bevy_asset::AssetIndex> = ::bevy_asset::AssetIndex::from_bits( - bits, - ) - .into(); - output + let output: ::bevy_asset::AssetIndex = ::bevy_asset::AssetIndex::from_bits( + safe_transmute(bits), + ); + safe_transmute(output) } }; output @@ -242,10 +231,9 @@ pub(crate) fn register_asset_index_functions(world: &mut World) { let output: u64 = { { let output: u64 = ::bevy_asset::AssetIndex::to_bits( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -270,9 +258,8 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { || { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::all() - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::all(); + safe_transmute(output) } }; output @@ -286,10 +273,9 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_asset::RenderAssetUsages as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -302,9 +288,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { |_self: Ref<::bevy_asset::RenderAssetUsages>| { let output: u8 = { { - let output: u8 = ::bevy_asset::RenderAssetUsages::bits(&_self) - .into(); - output + let output: u8 = ::bevy_asset::RenderAssetUsages::bits( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -317,11 +304,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { |_self: Ref<::bevy_asset::RenderAssetUsages>| { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = <::bevy_asset::RenderAssetUsages as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = <::bevy_asset::RenderAssetUsages as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -334,11 +320,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { |_self: Val<::bevy_asset::RenderAssetUsages>| { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::complement( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::complement( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -355,11 +340,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_asset::RenderAssetUsages::contains( - &_self, - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -375,12 +359,11 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::difference( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::difference( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -393,9 +376,8 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { || { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::empty() - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::empty(); + safe_transmute(output) } }; output @@ -413,9 +395,8 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: bool = <::bevy_asset::RenderAssetUsages as ::core::cmp::PartialEq< ::bevy_asset::RenderAssetUsages, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -428,11 +409,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { |bits: u8| { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::from_bits_retain( - bits, - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::from_bits_retain( + safe_transmute(bits), + ); + safe_transmute(output) } }; output @@ -445,11 +425,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { |bits: u8| { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::from_bits_truncate( - bits, - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::from_bits_truncate( + safe_transmute(bits), + ); + safe_transmute(output) } }; output @@ -466,11 +445,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_asset::RenderAssetUsages::insert( - &mut _self, - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -486,12 +464,11 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::intersection( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::intersection( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -508,11 +485,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_asset::RenderAssetUsages::intersects( - &_self, - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -526,10 +502,9 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_asset::RenderAssetUsages::is_all( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -543,10 +518,9 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_asset::RenderAssetUsages::is_empty( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -563,11 +537,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_asset::RenderAssetUsages::remove( - &mut _self, - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -585,12 +558,11 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_asset::RenderAssetUsages::set( - &mut _self, - other.into_inner(), - value, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -606,11 +578,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = <::bevy_asset::RenderAssetUsages as ::core::ops::Sub< + let output: ::bevy_asset::RenderAssetUsages = <::bevy_asset::RenderAssetUsages as ::core::ops::Sub< ::bevy_asset::RenderAssetUsages, - >>::sub(_self.into_inner(), other.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -626,12 +597,11 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::symmetric_difference( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::symmetric_difference( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -648,11 +618,10 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_asset::RenderAssetUsages::toggle( - &mut _self, - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -668,12 +637,11 @@ pub(crate) fn register_render_asset_usages_functions(world: &mut World) { { let output: Val<::bevy_asset::RenderAssetUsages> = { { - let output: Val<::bevy_asset::RenderAssetUsages> = ::bevy_asset::RenderAssetUsages::union( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_asset::RenderAssetUsages = ::bevy_asset::RenderAssetUsages::union( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_color_bms_bindings/src/lib.rs b/crates/bindings/bevy_color_bms_bindings/src/lib.rs index 7d513da6ea..af91f7ca28 100644 --- a/crates/bindings/bevy_color_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_color_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_color_functions(world: &mut World) { |_self: Ref<::bevy_color::Color>| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = <::bevy_color::Color as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Color = <::bevy_color::Color as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -43,9 +42,8 @@ pub(crate) fn register_color_functions(world: &mut World) { { let output: bool = <::bevy_color::Color as ::core::cmp::PartialEq< ::bevy_color::Color, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -58,13 +56,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, saturation: f32, lightness: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hsl( - hue, - saturation, - lightness, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hsl( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -77,14 +74,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, saturation: f32, lightness: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hsla( - hue, - saturation, - lightness, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hsla( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(lightness), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -97,13 +93,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, saturation: f32, value: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hsv( - hue, - saturation, - value, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hsv( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -116,14 +111,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, saturation: f32, value: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hsva( - hue, - saturation, - value, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hsva( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(value), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -136,13 +130,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, whiteness: f32, blackness: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hwb( - hue, - whiteness, - blackness, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hwb( + safe_transmute(hue), + safe_transmute(whiteness), + safe_transmute(blackness), + ); + safe_transmute(output) } }; output @@ -155,14 +148,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |hue: f32, whiteness: f32, blackness: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::hwba( - hue, - whiteness, - blackness, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::hwba( + safe_transmute(hue), + safe_transmute(whiteness), + safe_transmute(blackness), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -175,13 +167,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, a: f32, b: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::lab( - lightness, - a, - b, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::lab( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -194,14 +185,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, a: f32, b: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::laba( - lightness, - a, - b, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::laba( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -214,13 +204,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::lch( - lightness, - chroma, - hue, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::lch( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + ); + safe_transmute(output) } }; output @@ -233,14 +222,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::lcha( - lightness, - chroma, - hue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::lcha( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -253,13 +241,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: f32, green: f32, blue: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::linear_rgb( - red, - green, - blue, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::linear_rgb( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -272,14 +259,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: f32, green: f32, blue: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::linear_rgba( - red, - green, - blue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::linear_rgba( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -292,13 +278,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, a: f32, b: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::oklab( - lightness, - a, - b, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::oklab( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -311,14 +296,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, a: f32, b: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::oklaba( - lightness, - a, - b, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::oklaba( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -331,13 +315,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::oklch( - lightness, - chroma, - hue, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::oklch( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + ); + safe_transmute(output) } }; output @@ -350,14 +333,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::oklcha( - lightness, - chroma, - hue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::oklcha( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -370,13 +352,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: f32, green: f32, blue: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::srgb( - red, - green, - blue, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::srgb( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -389,11 +370,10 @@ pub(crate) fn register_color_functions(world: &mut World) { |array: [f32; 3]| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::srgb_from_array( - array, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::srgb_from_array( + safe_transmute(array), + ); + safe_transmute(output) } }; output @@ -406,13 +386,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: u8, green: u8, blue: u8| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::srgb_u8( - red, - green, - blue, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::srgb_u8( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -425,14 +404,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: f32, green: f32, blue: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::srgba( - red, - green, - blue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::srgba( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -445,14 +423,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |red: u8, green: u8, blue: u8, alpha: u8| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::srgba_u8( - red, - green, - blue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::srgba_u8( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -465,11 +442,10 @@ pub(crate) fn register_color_functions(world: &mut World) { |_self: Ref<::bevy_color::Color>| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::Color::to_linear( - &_self, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::Color::to_linear( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -482,11 +458,10 @@ pub(crate) fn register_color_functions(world: &mut World) { |_self: Ref<::bevy_color::Color>| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Color::to_srgba( - &_self, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Color::to_srgba( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -499,13 +474,12 @@ pub(crate) fn register_color_functions(world: &mut World) { |x: f32, y: f32, z: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::xyz( - x, - y, - z, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::xyz( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + ); + safe_transmute(output) } }; output @@ -518,14 +492,13 @@ pub(crate) fn register_color_functions(world: &mut World) { |x: f32, y: f32, z: f32, alpha: f32| { let output: Val<::bevy_color::Color> = { { - let output: Val<::bevy_color::Color> = ::bevy_color::Color::xyza( - x, - y, - z, - alpha, - ) - .into(); - output + let output: ::bevy_color::Color = ::bevy_color::Color::xyza( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -550,11 +523,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, rhs: Val<::bevy_color::Srgba>| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::ops::Add< + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::ops::Add< ::bevy_color::Srgba, - >>::add(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::add(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -567,11 +539,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Ref<::bevy_color::Srgba>| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -584,11 +555,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, rhs: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::ops::Div< + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::ops::Div< f32, - >>::div(_self.into_inner(), rhs) - .into(); - output + >>::div(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -603,9 +573,8 @@ pub(crate) fn register_srgba_functions(world: &mut World) { { let output: bool = <::bevy_color::Srgba as ::core::cmp::PartialEq< ::bevy_color::Srgba, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -618,9 +587,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |value: f32| { let output: f32 = { { - let output: f32 = ::bevy_color::Srgba::gamma_function(value) - .into(); - output + let output: f32 = ::bevy_color::Srgba::gamma_function( + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -634,10 +604,9 @@ pub(crate) fn register_srgba_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_color::Srgba::gamma_function_inverse( - value, - ) - .into(); - output + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -650,11 +619,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, rhs: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::ops::Mul< + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -667,11 +635,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -684,14 +651,13 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |red: f32, green: f32, blue: f32, alpha: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::new( - red, - green, - blue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::new( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -704,13 +670,12 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |red: f32, green: f32, blue: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::rgb( - red, - green, - blue, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::rgb( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -723,13 +688,12 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |r: u8, g: u8, b: u8| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::rgb_u8( - r, - g, - b, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::rgb_u8( + safe_transmute(r), + safe_transmute(g), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -742,14 +706,13 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |r: u8, g: u8, b: u8, a: u8| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::rgba_u8( - r, - g, - b, - a, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::rgba_u8( + safe_transmute(r), + safe_transmute(g), + safe_transmute(b), + safe_transmute(a), + ); + safe_transmute(output) } }; output @@ -762,11 +725,10 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, rhs: Val<::bevy_color::Srgba>| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = <::bevy_color::Srgba as ::core::ops::Sub< + let output: ::bevy_color::Srgba = <::bevy_color::Srgba as ::core::ops::Sub< ::bevy_color::Srgba, - >>::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -780,10 +742,9 @@ pub(crate) fn register_srgba_functions(world: &mut World) { let output: ::std::string::String = { { let output: ::std::string::String = ::bevy_color::Srgba::to_hex( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -796,12 +757,11 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, blue: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::with_blue( - _self.into_inner(), - blue, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::with_blue( + safe_transmute(_self), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -814,12 +774,11 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, green: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::with_green( - _self.into_inner(), - green, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::with_green( + safe_transmute(_self), + safe_transmute(green), + ); + safe_transmute(output) } }; output @@ -832,12 +791,11 @@ pub(crate) fn register_srgba_functions(world: &mut World) { |_self: Val<::bevy_color::Srgba>, red: f32| { let output: Val<::bevy_color::Srgba> = { { - let output: Val<::bevy_color::Srgba> = ::bevy_color::Srgba::with_red( - _self.into_inner(), - red, - ) - .into(); - output + let output: ::bevy_color::Srgba = ::bevy_color::Srgba::with_red( + safe_transmute(_self), + safe_transmute(red), + ); + safe_transmute(output) } }; output @@ -862,11 +820,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, rhs: Val<::bevy_color::LinearRgba>| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::ops::Add< + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::ops::Add< ::bevy_color::LinearRgba, - >>::add(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::add(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -879,9 +836,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Ref<::bevy_color::LinearRgba>| { let output: u32 = { { - let output: u32 = ::bevy_color::LinearRgba::as_u32(&_self) - .into(); - output + let output: u32 = ::bevy_color::LinearRgba::as_u32( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -894,11 +852,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Ref<::bevy_color::LinearRgba>| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -911,11 +868,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, rhs: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::ops::Div< + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::ops::Div< f32, - >>::div(_self.into_inner(), rhs) - .into(); - output + >>::div(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -930,9 +886,8 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { { let output: bool = <::bevy_color::LinearRgba as ::core::cmp::PartialEq< ::bevy_color::LinearRgba, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -945,11 +900,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, rhs: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::ops::Mul< + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -962,11 +916,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -979,14 +932,13 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |red: f32, green: f32, blue: f32, alpha: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::LinearRgba::new( - red, - green, - blue, - alpha, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::LinearRgba::new( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -999,13 +951,12 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |red: f32, green: f32, blue: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::LinearRgba::rgb( - red, - green, - blue, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::LinearRgba::rgb( + safe_transmute(red), + safe_transmute(green), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -1018,11 +969,10 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, rhs: Val<::bevy_color::LinearRgba>| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = <::bevy_color::LinearRgba as ::core::ops::Sub< + let output: ::bevy_color::LinearRgba = <::bevy_color::LinearRgba as ::core::ops::Sub< ::bevy_color::LinearRgba, - >>::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1035,12 +985,11 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, blue: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::LinearRgba::with_blue( - _self.into_inner(), - blue, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::LinearRgba::with_blue( + safe_transmute(_self), + safe_transmute(blue), + ); + safe_transmute(output) } }; output @@ -1053,12 +1002,11 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, green: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::LinearRgba::with_green( - _self.into_inner(), - green, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::LinearRgba::with_green( + safe_transmute(_self), + safe_transmute(green), + ); + safe_transmute(output) } }; output @@ -1071,12 +1019,11 @@ pub(crate) fn register_linear_rgba_functions(world: &mut World) { |_self: Val<::bevy_color::LinearRgba>, red: f32| { let output: Val<::bevy_color::LinearRgba> = { { - let output: Val<::bevy_color::LinearRgba> = ::bevy_color::LinearRgba::with_red( - _self.into_inner(), - red, - ) - .into(); - output + let output: ::bevy_color::LinearRgba = ::bevy_color::LinearRgba::with_red( + safe_transmute(_self), + safe_transmute(red), + ); + safe_transmute(output) } }; output @@ -1101,11 +1048,10 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |_self: Ref<::bevy_color::Hsla>| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = <::bevy_color::Hsla as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Hsla = <::bevy_color::Hsla as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1120,9 +1066,8 @@ pub(crate) fn register_hsla_functions(world: &mut World) { { let output: bool = <::bevy_color::Hsla as ::core::cmp::PartialEq< ::bevy_color::Hsla, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1135,13 +1080,12 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |hue: f32, saturation: f32, lightness: f32| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = ::bevy_color::Hsla::hsl( - hue, - saturation, - lightness, - ) - .into(); - output + let output: ::bevy_color::Hsla = ::bevy_color::Hsla::hsl( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -1154,14 +1098,13 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |hue: f32, saturation: f32, lightness: f32, alpha: f32| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = ::bevy_color::Hsla::new( - hue, - saturation, - lightness, - alpha, - ) - .into(); - output + let output: ::bevy_color::Hsla = ::bevy_color::Hsla::new( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(lightness), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1174,11 +1117,10 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |index: u32| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = ::bevy_color::Hsla::sequential_dispersed( - index, - ) - .into(); - output + let output: ::bevy_color::Hsla = ::bevy_color::Hsla::sequential_dispersed( + safe_transmute(index), + ); + safe_transmute(output) } }; output @@ -1191,12 +1133,11 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |_self: Val<::bevy_color::Hsla>, lightness: f32| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = ::bevy_color::Hsla::with_lightness( - _self.into_inner(), - lightness, - ) - .into(); - output + let output: ::bevy_color::Hsla = ::bevy_color::Hsla::with_lightness( + safe_transmute(_self), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -1209,12 +1150,11 @@ pub(crate) fn register_hsla_functions(world: &mut World) { |_self: Val<::bevy_color::Hsla>, saturation: f32| { let output: Val<::bevy_color::Hsla> = { { - let output: Val<::bevy_color::Hsla> = ::bevy_color::Hsla::with_saturation( - _self.into_inner(), - saturation, - ) - .into(); - output + let output: ::bevy_color::Hsla = ::bevy_color::Hsla::with_saturation( + safe_transmute(_self), + safe_transmute(saturation), + ); + safe_transmute(output) } }; output @@ -1239,11 +1179,10 @@ pub(crate) fn register_hsva_functions(world: &mut World) { |_self: Ref<::bevy_color::Hsva>| { let output: Val<::bevy_color::Hsva> = { { - let output: Val<::bevy_color::Hsva> = <::bevy_color::Hsva as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Hsva = <::bevy_color::Hsva as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1258,9 +1197,8 @@ pub(crate) fn register_hsva_functions(world: &mut World) { { let output: bool = <::bevy_color::Hsva as ::core::cmp::PartialEq< ::bevy_color::Hsva, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1273,13 +1211,12 @@ pub(crate) fn register_hsva_functions(world: &mut World) { |hue: f32, saturation: f32, value: f32| { let output: Val<::bevy_color::Hsva> = { { - let output: Val<::bevy_color::Hsva> = ::bevy_color::Hsva::hsv( - hue, - saturation, - value, - ) - .into(); - output + let output: ::bevy_color::Hsva = ::bevy_color::Hsva::hsv( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -1292,14 +1229,13 @@ pub(crate) fn register_hsva_functions(world: &mut World) { |hue: f32, saturation: f32, value: f32, alpha: f32| { let output: Val<::bevy_color::Hsva> = { { - let output: Val<::bevy_color::Hsva> = ::bevy_color::Hsva::new( - hue, - saturation, - value, - alpha, - ) - .into(); - output + let output: ::bevy_color::Hsva = ::bevy_color::Hsva::new( + safe_transmute(hue), + safe_transmute(saturation), + safe_transmute(value), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1312,12 +1248,11 @@ pub(crate) fn register_hsva_functions(world: &mut World) { |_self: Val<::bevy_color::Hsva>, saturation: f32| { let output: Val<::bevy_color::Hsva> = { { - let output: Val<::bevy_color::Hsva> = ::bevy_color::Hsva::with_saturation( - _self.into_inner(), - saturation, - ) - .into(); - output + let output: ::bevy_color::Hsva = ::bevy_color::Hsva::with_saturation( + safe_transmute(_self), + safe_transmute(saturation), + ); + safe_transmute(output) } }; output @@ -1330,12 +1265,11 @@ pub(crate) fn register_hsva_functions(world: &mut World) { |_self: Val<::bevy_color::Hsva>, value: f32| { let output: Val<::bevy_color::Hsva> = { { - let output: Val<::bevy_color::Hsva> = ::bevy_color::Hsva::with_value( - _self.into_inner(), - value, - ) - .into(); - output + let output: ::bevy_color::Hsva = ::bevy_color::Hsva::with_value( + safe_transmute(_self), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -1360,11 +1294,10 @@ pub(crate) fn register_hwba_functions(world: &mut World) { |_self: Ref<::bevy_color::Hwba>| { let output: Val<::bevy_color::Hwba> = { { - let output: Val<::bevy_color::Hwba> = <::bevy_color::Hwba as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Hwba = <::bevy_color::Hwba as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1379,9 +1312,8 @@ pub(crate) fn register_hwba_functions(world: &mut World) { { let output: bool = <::bevy_color::Hwba as ::core::cmp::PartialEq< ::bevy_color::Hwba, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1394,13 +1326,12 @@ pub(crate) fn register_hwba_functions(world: &mut World) { |hue: f32, whiteness: f32, blackness: f32| { let output: Val<::bevy_color::Hwba> = { { - let output: Val<::bevy_color::Hwba> = ::bevy_color::Hwba::hwb( - hue, - whiteness, - blackness, - ) - .into(); - output + let output: ::bevy_color::Hwba = ::bevy_color::Hwba::hwb( + safe_transmute(hue), + safe_transmute(whiteness), + safe_transmute(blackness), + ); + safe_transmute(output) } }; output @@ -1413,14 +1344,13 @@ pub(crate) fn register_hwba_functions(world: &mut World) { |hue: f32, whiteness: f32, blackness: f32, alpha: f32| { let output: Val<::bevy_color::Hwba> = { { - let output: Val<::bevy_color::Hwba> = ::bevy_color::Hwba::new( - hue, - whiteness, - blackness, - alpha, - ) - .into(); - output + let output: ::bevy_color::Hwba = ::bevy_color::Hwba::new( + safe_transmute(hue), + safe_transmute(whiteness), + safe_transmute(blackness), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1433,12 +1363,11 @@ pub(crate) fn register_hwba_functions(world: &mut World) { |_self: Val<::bevy_color::Hwba>, blackness: f32| { let output: Val<::bevy_color::Hwba> = { { - let output: Val<::bevy_color::Hwba> = ::bevy_color::Hwba::with_blackness( - _self.into_inner(), - blackness, - ) - .into(); - output + let output: ::bevy_color::Hwba = ::bevy_color::Hwba::with_blackness( + safe_transmute(_self), + safe_transmute(blackness), + ); + safe_transmute(output) } }; output @@ -1451,12 +1380,11 @@ pub(crate) fn register_hwba_functions(world: &mut World) { |_self: Val<::bevy_color::Hwba>, whiteness: f32| { let output: Val<::bevy_color::Hwba> = { { - let output: Val<::bevy_color::Hwba> = ::bevy_color::Hwba::with_whiteness( - _self.into_inner(), - whiteness, - ) - .into(); - output + let output: ::bevy_color::Hwba = ::bevy_color::Hwba::with_whiteness( + safe_transmute(_self), + safe_transmute(whiteness), + ); + safe_transmute(output) } }; output @@ -1481,11 +1409,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>, rhs: Val<::bevy_color::Laba>| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::ops::Add< + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::ops::Add< ::bevy_color::Laba, - >>::add(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::add(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1498,11 +1425,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Ref<::bevy_color::Laba>| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1515,11 +1441,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>, rhs: f32| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::ops::Div< + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::ops::Div< f32, - >>::div(_self.into_inner(), rhs) - .into(); - output + >>::div(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1534,9 +1459,8 @@ pub(crate) fn register_laba_functions(world: &mut World) { { let output: bool = <::bevy_color::Laba as ::core::cmp::PartialEq< ::bevy_color::Laba, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1549,13 +1473,12 @@ pub(crate) fn register_laba_functions(world: &mut World) { |lightness: f32, a: f32, b: f32| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = ::bevy_color::Laba::lab( - lightness, - a, - b, - ) - .into(); - output + let output: ::bevy_color::Laba = ::bevy_color::Laba::lab( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -1568,11 +1491,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>, rhs: f32| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::ops::Mul< + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1585,11 +1507,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1602,14 +1523,13 @@ pub(crate) fn register_laba_functions(world: &mut World) { |lightness: f32, a: f32, b: f32, alpha: f32| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = ::bevy_color::Laba::new( - lightness, - a, - b, - alpha, - ) - .into(); - output + let output: ::bevy_color::Laba = ::bevy_color::Laba::new( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1622,11 +1542,10 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>, rhs: Val<::bevy_color::Laba>| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = <::bevy_color::Laba as ::core::ops::Sub< + let output: ::bevy_color::Laba = <::bevy_color::Laba as ::core::ops::Sub< ::bevy_color::Laba, - >>::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1639,12 +1558,11 @@ pub(crate) fn register_laba_functions(world: &mut World) { |_self: Val<::bevy_color::Laba>, lightness: f32| { let output: Val<::bevy_color::Laba> = { { - let output: Val<::bevy_color::Laba> = ::bevy_color::Laba::with_lightness( - _self.into_inner(), - lightness, - ) - .into(); - output + let output: ::bevy_color::Laba = ::bevy_color::Laba::with_lightness( + safe_transmute(_self), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -1669,11 +1587,10 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |_self: Ref<::bevy_color::Lcha>| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = <::bevy_color::Lcha as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Lcha = <::bevy_color::Lcha as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1688,9 +1605,8 @@ pub(crate) fn register_lcha_functions(world: &mut World) { { let output: bool = <::bevy_color::Lcha as ::core::cmp::PartialEq< ::bevy_color::Lcha, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1703,13 +1619,12 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = ::bevy_color::Lcha::lch( - lightness, - chroma, - hue, - ) - .into(); - output + let output: ::bevy_color::Lcha = ::bevy_color::Lcha::lch( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + ); + safe_transmute(output) } }; output @@ -1722,14 +1637,13 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32, alpha: f32| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = ::bevy_color::Lcha::new( - lightness, - chroma, - hue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Lcha = ::bevy_color::Lcha::new( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1742,11 +1656,10 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |index: u32| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = ::bevy_color::Lcha::sequential_dispersed( - index, - ) - .into(); - output + let output: ::bevy_color::Lcha = ::bevy_color::Lcha::sequential_dispersed( + safe_transmute(index), + ); + safe_transmute(output) } }; output @@ -1759,12 +1672,11 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |_self: Val<::bevy_color::Lcha>, chroma: f32| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = ::bevy_color::Lcha::with_chroma( - _self.into_inner(), - chroma, - ) - .into(); - output + let output: ::bevy_color::Lcha = ::bevy_color::Lcha::with_chroma( + safe_transmute(_self), + safe_transmute(chroma), + ); + safe_transmute(output) } }; output @@ -1777,12 +1689,11 @@ pub(crate) fn register_lcha_functions(world: &mut World) { |_self: Val<::bevy_color::Lcha>, lightness: f32| { let output: Val<::bevy_color::Lcha> = { { - let output: Val<::bevy_color::Lcha> = ::bevy_color::Lcha::with_lightness( - _self.into_inner(), - lightness, - ) - .into(); - output + let output: ::bevy_color::Lcha = ::bevy_color::Lcha::with_lightness( + safe_transmute(_self), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -1807,11 +1718,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, rhs: Val<::bevy_color::Oklaba>| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::ops::Add< + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::ops::Add< ::bevy_color::Oklaba, - >>::add(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::add(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1824,11 +1734,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Ref<::bevy_color::Oklaba>| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1841,11 +1750,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, rhs: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::ops::Div< + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::ops::Div< f32, - >>::div(_self.into_inner(), rhs) - .into(); - output + >>::div(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1860,9 +1768,8 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { { let output: bool = <::bevy_color::Oklaba as ::core::cmp::PartialEq< ::bevy_color::Oklaba, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1875,13 +1782,12 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |lightness: f32, a: f32, b: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = ::bevy_color::Oklaba::lab( - lightness, - a, - b, - ) - .into(); - output + let output: ::bevy_color::Oklaba = ::bevy_color::Oklaba::lab( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -1894,11 +1800,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, rhs: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::ops::Mul< + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1911,11 +1816,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1928,14 +1832,13 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |lightness: f32, a: f32, b: f32, alpha: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = ::bevy_color::Oklaba::new( - lightness, - a, - b, - alpha, - ) - .into(); - output + let output: ::bevy_color::Oklaba = ::bevy_color::Oklaba::new( + safe_transmute(lightness), + safe_transmute(a), + safe_transmute(b), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -1948,11 +1851,10 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, rhs: Val<::bevy_color::Oklaba>| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = <::bevy_color::Oklaba as ::core::ops::Sub< + let output: ::bevy_color::Oklaba = <::bevy_color::Oklaba as ::core::ops::Sub< ::bevy_color::Oklaba, - >>::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1965,12 +1867,11 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, a: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = ::bevy_color::Oklaba::with_a( - _self.into_inner(), - a, - ) - .into(); - output + let output: ::bevy_color::Oklaba = ::bevy_color::Oklaba::with_a( + safe_transmute(_self), + safe_transmute(a), + ); + safe_transmute(output) } }; output @@ -1983,12 +1884,11 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, b: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = ::bevy_color::Oklaba::with_b( - _self.into_inner(), - b, - ) - .into(); - output + let output: ::bevy_color::Oklaba = ::bevy_color::Oklaba::with_b( + safe_transmute(_self), + safe_transmute(b), + ); + safe_transmute(output) } }; output @@ -2001,12 +1901,11 @@ pub(crate) fn register_oklaba_functions(world: &mut World) { |_self: Val<::bevy_color::Oklaba>, lightness: f32| { let output: Val<::bevy_color::Oklaba> = { { - let output: Val<::bevy_color::Oklaba> = ::bevy_color::Oklaba::with_lightness( - _self.into_inner(), - lightness, - ) - .into(); - output + let output: ::bevy_color::Oklaba = ::bevy_color::Oklaba::with_lightness( + safe_transmute(_self), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -2031,11 +1930,10 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |_self: Ref<::bevy_color::Oklcha>| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = <::bevy_color::Oklcha as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Oklcha = <::bevy_color::Oklcha as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2050,9 +1948,8 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { { let output: bool = <::bevy_color::Oklcha as ::core::cmp::PartialEq< ::bevy_color::Oklcha, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -2065,13 +1962,12 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = ::bevy_color::Oklcha::lch( - lightness, - chroma, - hue, - ) - .into(); - output + let output: ::bevy_color::Oklcha = ::bevy_color::Oklcha::lch( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + ); + safe_transmute(output) } }; output @@ -2084,14 +1980,13 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |lightness: f32, chroma: f32, hue: f32, alpha: f32| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = ::bevy_color::Oklcha::new( - lightness, - chroma, - hue, - alpha, - ) - .into(); - output + let output: ::bevy_color::Oklcha = ::bevy_color::Oklcha::new( + safe_transmute(lightness), + safe_transmute(chroma), + safe_transmute(hue), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -2104,11 +1999,10 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |index: u32| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = ::bevy_color::Oklcha::sequential_dispersed( - index, - ) - .into(); - output + let output: ::bevy_color::Oklcha = ::bevy_color::Oklcha::sequential_dispersed( + safe_transmute(index), + ); + safe_transmute(output) } }; output @@ -2121,12 +2015,11 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |_self: Val<::bevy_color::Oklcha>, chroma: f32| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = ::bevy_color::Oklcha::with_chroma( - _self.into_inner(), - chroma, - ) - .into(); - output + let output: ::bevy_color::Oklcha = ::bevy_color::Oklcha::with_chroma( + safe_transmute(_self), + safe_transmute(chroma), + ); + safe_transmute(output) } }; output @@ -2139,12 +2032,11 @@ pub(crate) fn register_oklcha_functions(world: &mut World) { |_self: Val<::bevy_color::Oklcha>, lightness: f32| { let output: Val<::bevy_color::Oklcha> = { { - let output: Val<::bevy_color::Oklcha> = ::bevy_color::Oklcha::with_lightness( - _self.into_inner(), - lightness, - ) - .into(); - output + let output: ::bevy_color::Oklcha = ::bevy_color::Oklcha::with_lightness( + safe_transmute(_self), + safe_transmute(lightness), + ); + safe_transmute(output) } }; output @@ -2169,11 +2061,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, rhs: Val<::bevy_color::Xyza>| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::ops::Add< + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::ops::Add< ::bevy_color::Xyza, - >>::add(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::add(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -2186,11 +2077,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Ref<::bevy_color::Xyza>| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2203,11 +2093,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, rhs: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::ops::Div< + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::ops::Div< f32, - >>::div(_self.into_inner(), rhs) - .into(); - output + >>::div(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -2222,9 +2111,8 @@ pub(crate) fn register_xyza_functions(world: &mut World) { { let output: bool = <::bevy_color::Xyza as ::core::cmp::PartialEq< ::bevy_color::Xyza, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -2237,11 +2125,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, rhs: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::ops::Mul< + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -2254,11 +2141,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2271,14 +2157,13 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |x: f32, y: f32, z: f32, alpha: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = ::bevy_color::Xyza::new( - x, - y, - z, - alpha, - ) - .into(); - output + let output: ::bevy_color::Xyza = ::bevy_color::Xyza::new( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + safe_transmute(alpha), + ); + safe_transmute(output) } }; output @@ -2291,11 +2176,10 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, rhs: Val<::bevy_color::Xyza>| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = <::bevy_color::Xyza as ::core::ops::Sub< + let output: ::bevy_color::Xyza = <::bevy_color::Xyza as ::core::ops::Sub< ::bevy_color::Xyza, - >>::sub(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::sub(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -2308,12 +2192,11 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, x: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = ::bevy_color::Xyza::with_x( - _self.into_inner(), - x, - ) - .into(); - output + let output: ::bevy_color::Xyza = ::bevy_color::Xyza::with_x( + safe_transmute(_self), + safe_transmute(x), + ); + safe_transmute(output) } }; output @@ -2326,12 +2209,11 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, y: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = ::bevy_color::Xyza::with_y( - _self.into_inner(), - y, - ) - .into(); - output + let output: ::bevy_color::Xyza = ::bevy_color::Xyza::with_y( + safe_transmute(_self), + safe_transmute(y), + ); + safe_transmute(output) } }; output @@ -2344,12 +2226,11 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |_self: Val<::bevy_color::Xyza>, z: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = ::bevy_color::Xyza::with_z( - _self.into_inner(), - z, - ) - .into(); - output + let output: ::bevy_color::Xyza = ::bevy_color::Xyza::with_z( + safe_transmute(_self), + safe_transmute(z), + ); + safe_transmute(output) } }; output @@ -2362,13 +2243,12 @@ pub(crate) fn register_xyza_functions(world: &mut World) { |x: f32, y: f32, z: f32| { let output: Val<::bevy_color::Xyza> = { { - let output: Val<::bevy_color::Xyza> = ::bevy_color::Xyza::xyz( - x, - y, - z, - ) - .into(); - output + let output: ::bevy_color::Xyza = ::bevy_color::Xyza::xyz( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_core_pipeline_bms_bindings/src/lib.rs b/crates/bindings/bevy_core_pipeline_bms_bindings/src/lib.rs index b554da9d4d..a655d790b9 100644 --- a/crates/bindings/bevy_core_pipeline_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_core_pipeline_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_skybox_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::Skybox>| { let output: Val<::bevy_core_pipeline::Skybox> = { { - let output: Val<::bevy_core_pipeline::Skybox> = <::bevy_core_pipeline::Skybox as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::Skybox = <::bevy_core_pipeline::Skybox as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -54,10 +53,9 @@ pub(crate) fn register_tonemapping_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_core_pipeline::tonemapping::Tonemapping as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -70,13 +68,10 @@ pub(crate) fn register_tonemapping_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::tonemapping::Tonemapping>| { let output: Val<::bevy_core_pipeline::tonemapping::Tonemapping> = { { - let output: Val< - ::bevy_core_pipeline::tonemapping::Tonemapping, - > = <::bevy_core_pipeline::tonemapping::Tonemapping as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::tonemapping::Tonemapping = <::bevy_core_pipeline::tonemapping::Tonemapping as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -94,9 +89,8 @@ pub(crate) fn register_tonemapping_functions(world: &mut World) { { let output: bool = <::bevy_core_pipeline::tonemapping::Tonemapping as ::std::cmp::PartialEq< ::bevy_core_pipeline::tonemapping::Tonemapping, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -110,10 +104,9 @@ pub(crate) fn register_tonemapping_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_core_pipeline::tonemapping::Tonemapping::is_enabled( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -139,10 +132,9 @@ pub(crate) fn register_deband_dither_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_core_pipeline::tonemapping::DebandDither as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -155,13 +147,10 @@ pub(crate) fn register_deband_dither_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::tonemapping::DebandDither>| { let output: Val<::bevy_core_pipeline::tonemapping::DebandDither> = { { - let output: Val< - ::bevy_core_pipeline::tonemapping::DebandDither, - > = <::bevy_core_pipeline::tonemapping::DebandDither as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::tonemapping::DebandDither = <::bevy_core_pipeline::tonemapping::DebandDither as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -179,9 +168,8 @@ pub(crate) fn register_deband_dither_functions(world: &mut World) { { let output: bool = <::bevy_core_pipeline::tonemapping::DebandDither as ::std::cmp::PartialEq< ::bevy_core_pipeline::tonemapping::DebandDither, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -218,11 +206,10 @@ pub(crate) fn register_depth_prepass_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::prepass::DepthPrepass>| { let output: Val<::bevy_core_pipeline::prepass::DepthPrepass> = { { - let output: Val<::bevy_core_pipeline::prepass::DepthPrepass> = <::bevy_core_pipeline::prepass::DepthPrepass as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::prepass::DepthPrepass = <::bevy_core_pipeline::prepass::DepthPrepass as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -247,13 +234,10 @@ pub(crate) fn register_motion_vector_prepass_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::prepass::MotionVectorPrepass>| { let output: Val<::bevy_core_pipeline::prepass::MotionVectorPrepass> = { { - let output: Val< - ::bevy_core_pipeline::prepass::MotionVectorPrepass, - > = <::bevy_core_pipeline::prepass::MotionVectorPrepass as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::prepass::MotionVectorPrepass = <::bevy_core_pipeline::prepass::MotionVectorPrepass as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -278,11 +262,10 @@ pub(crate) fn register_normal_prepass_functions(world: &mut World) { |_self: Ref<::bevy_core_pipeline::prepass::NormalPrepass>| { let output: Val<::bevy_core_pipeline::prepass::NormalPrepass> = { { - let output: Val<::bevy_core_pipeline::prepass::NormalPrepass> = <::bevy_core_pipeline::prepass::NormalPrepass as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::prepass::NormalPrepass = <::bevy_core_pipeline::prepass::NormalPrepass as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -315,13 +298,10 @@ pub(crate) fn register_order_independent_transparency_settings_functions( ::bevy_core_pipeline::oit::OrderIndependentTransparencySettings, > = { { - let output: Val< - ::bevy_core_pipeline::oit::OrderIndependentTransparencySettings, - > = <::bevy_core_pipeline::oit::OrderIndependentTransparencySettings as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_core_pipeline::oit::OrderIndependentTransparencySettings = <::bevy_core_pipeline::oit::OrderIndependentTransparencySettings as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_ecs_bms_bindings/src/lib.rs b/crates/bindings/bevy_ecs_bms_bindings/src/lib.rs index 54b59c65d9..d0cde7975e 100644 --- a/crates/bindings/bevy_ecs_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_ecs_bms_bindings/src/lib.rs @@ -1,18 +1,16 @@ - #![allow(clippy::all)] #![allow(unused, deprecated, dead_code)] - - +use bevy_app::{App, Plugin}; +use bevy_ecs::prelude::*; use bevy_mod_scripting_bindings::{ ReflectReference, function::{ - from::{Ref, Mut, Val}, + from::{Mut, Ref, Val}, + glue::safe_transmute, namespace::NamespaceBuilder, }, }; -use bevy_ecs::prelude::*; -use bevy_app::{App, Plugin}; use bevy_mod_scripting_derive::script_bindings; pub struct BevyEcsScriptingPlugin; pub(crate) fn register_entity_functions(world: &mut World) { @@ -24,11 +22,10 @@ pub(crate) fn register_entity_functions(world: &mut World) { |_self: Ref<::bevy_ecs::entity::Entity>| { let output: Val<::bevy_ecs::entity::Entity> = { { - let output: Val<::bevy_ecs::entity::Entity> = <::bevy_ecs::entity::Entity as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::entity::Entity = <::bevy_ecs::entity::Entity as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -46,9 +43,8 @@ pub(crate) fn register_entity_functions(world: &mut World) { { let output: bool = <::bevy_ecs::entity::Entity as ::core::cmp::PartialEq< ::bevy_ecs::entity::Entity, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -61,11 +57,10 @@ pub(crate) fn register_entity_functions(world: &mut World) { |bits: u64| { let output: Val<::bevy_ecs::entity::Entity> = { { - let output: Val<::bevy_ecs::entity::Entity> = ::bevy_ecs::entity::Entity::from_bits( - bits, - ) - .into(); - output + let output: ::bevy_ecs::entity::Entity = ::bevy_ecs::entity::Entity::from_bits( + safe_transmute(bits), + ); + safe_transmute(output) } }; output @@ -78,11 +73,10 @@ pub(crate) fn register_entity_functions(world: &mut World) { |row: Val<::bevy_ecs::entity::EntityRow>| { let output: Val<::bevy_ecs::entity::Entity> = { { - let output: Val<::bevy_ecs::entity::Entity> = ::bevy_ecs::entity::Entity::from_row( - row.into_inner(), - ) - .into(); - output + let output: ::bevy_ecs::entity::Entity = ::bevy_ecs::entity::Entity::from_row( + safe_transmute(row), + ); + safe_transmute(output) } }; output @@ -98,12 +92,11 @@ pub(crate) fn register_entity_functions(world: &mut World) { { let output: Val<::bevy_ecs::entity::Entity> = { { - let output: Val<::bevy_ecs::entity::Entity> = ::bevy_ecs::entity::Entity::from_row_and_generation( - row.into_inner(), - generation.into_inner(), - ) - .into(); - output + let output: ::bevy_ecs::entity::Entity = ::bevy_ecs::entity::Entity::from_row_and_generation( + safe_transmute(row), + safe_transmute(generation), + ); + safe_transmute(output) } }; output @@ -116,11 +109,10 @@ pub(crate) fn register_entity_functions(world: &mut World) { |_self: Val<::bevy_ecs::entity::Entity>| { let output: Val<::bevy_ecs::entity::EntityGeneration> = { { - let output: Val<::bevy_ecs::entity::EntityGeneration> = ::bevy_ecs::entity::Entity::generation( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityGeneration = ::bevy_ecs::entity::Entity::generation( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -134,10 +126,9 @@ pub(crate) fn register_entity_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_ecs::entity::Entity::index( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -150,11 +141,10 @@ pub(crate) fn register_entity_functions(world: &mut World) { |_self: Val<::bevy_ecs::entity::Entity>| { let output: Val<::bevy_ecs::entity::EntityRow> = { { - let output: Val<::bevy_ecs::entity::EntityRow> = ::bevy_ecs::entity::Entity::row( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityRow = ::bevy_ecs::entity::Entity::row( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -168,10 +158,9 @@ pub(crate) fn register_entity_functions(world: &mut World) { let output: u64 = { { let output: u64 = ::bevy_ecs::entity::Entity::to_bits( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -197,10 +186,9 @@ pub(crate) fn register_child_of_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::hierarchy::ChildOf as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -213,11 +201,10 @@ pub(crate) fn register_child_of_functions(world: &mut World) { |_self: Ref<::bevy_ecs::hierarchy::ChildOf>| { let output: Val<::bevy_ecs::hierarchy::ChildOf> = { { - let output: Val<::bevy_ecs::hierarchy::ChildOf> = <::bevy_ecs::hierarchy::ChildOf as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::hierarchy::ChildOf = <::bevy_ecs::hierarchy::ChildOf as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -235,9 +222,8 @@ pub(crate) fn register_child_of_functions(world: &mut World) { { let output: bool = <::bevy_ecs::hierarchy::ChildOf as ::core::cmp::PartialEq< ::bevy_ecs::hierarchy::ChildOf, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -250,11 +236,10 @@ pub(crate) fn register_child_of_functions(world: &mut World) { |_self: Ref<::bevy_ecs::hierarchy::ChildOf>| { let output: Val<::bevy_ecs::entity::Entity> = { { - let output: Val<::bevy_ecs::entity::Entity> = ::bevy_ecs::hierarchy::ChildOf::parent( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::entity::Entity = ::bevy_ecs::hierarchy::ChildOf::parent( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -280,10 +265,9 @@ pub(crate) fn register_children_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::hierarchy::Children as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -301,9 +285,8 @@ pub(crate) fn register_children_functions(world: &mut World) { { let output: bool = <::bevy_ecs::hierarchy::Children as ::core::cmp::PartialEq< ::bevy_ecs::hierarchy::Children, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -321,12 +304,11 @@ pub(crate) fn register_children_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_ecs::hierarchy::Children::swap( - &mut _self, - a_index, - b_index, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(a_index), + safe_transmute(b_index), + ); + safe_transmute(output) } }; output @@ -351,11 +333,10 @@ pub(crate) fn register_add_functions(world: &mut World) { |_self: Ref<::bevy_ecs::lifecycle::Add>| { let output: Val<::bevy_ecs::lifecycle::Add> = { { - let output: Val<::bevy_ecs::lifecycle::Add> = <::bevy_ecs::lifecycle::Add as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::lifecycle::Add = <::bevy_ecs::lifecycle::Add as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -375,23 +356,23 @@ pub(crate) fn register_despawn_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::lifecycle::Despawn, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::lifecycle::Despawn>| { - let output: Val<::bevy_ecs::lifecycle::Despawn> = { - { - let output: Val<::bevy_ecs::lifecycle::Despawn> = <::bevy_ecs::lifecycle::Despawn as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::lifecycle::Despawn>| { + let output: Val<::bevy_ecs::lifecycle::Despawn> = { + { + let output: ::bevy_ecs::lifecycle::Despawn = + <::bevy_ecs::lifecycle::Despawn as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -404,23 +385,23 @@ pub(crate) fn register_insert_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::lifecycle::Insert, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::lifecycle::Insert>| { - let output: Val<::bevy_ecs::lifecycle::Insert> = { - { - let output: Val<::bevy_ecs::lifecycle::Insert> = <::bevy_ecs::lifecycle::Insert as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::lifecycle::Insert>| { + let output: Val<::bevy_ecs::lifecycle::Insert> = { + { + let output: ::bevy_ecs::lifecycle::Insert = + <::bevy_ecs::lifecycle::Insert as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -433,23 +414,23 @@ pub(crate) fn register_remove_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::lifecycle::Remove, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::lifecycle::Remove>| { - let output: Val<::bevy_ecs::lifecycle::Remove> = { - { - let output: Val<::bevy_ecs::lifecycle::Remove> = <::bevy_ecs::lifecycle::Remove as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::lifecycle::Remove>| { + let output: Val<::bevy_ecs::lifecycle::Remove> = { + { + let output: ::bevy_ecs::lifecycle::Remove = + <::bevy_ecs::lifecycle::Remove as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -462,23 +443,23 @@ pub(crate) fn register_replace_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::lifecycle::Replace, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::lifecycle::Replace>| { - let output: Val<::bevy_ecs::lifecycle::Replace> = { - { - let output: Val<::bevy_ecs::lifecycle::Replace> = <::bevy_ecs::lifecycle::Replace as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::lifecycle::Replace>| { + let output: Val<::bevy_ecs::lifecycle::Replace> = { + { + let output: ::bevy_ecs::lifecycle::Replace = + <::bevy_ecs::lifecycle::Replace as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -496,11 +477,10 @@ pub(crate) fn register_name_functions(world: &mut World) { |_self: Ref<::bevy_ecs::name::Name>| { let output: Val<::bevy_ecs::name::Name> = { { - let output: Val<::bevy_ecs::name::Name> = <::bevy_ecs::name::Name as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::name::Name = <::bevy_ecs::name::Name as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -515,9 +495,8 @@ pub(crate) fn register_name_functions(world: &mut World) { { let output: bool = <::bevy_ecs::name::Name as ::core::cmp::PartialEq< ::bevy_ecs::name::Name, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -528,10 +507,8 @@ pub(crate) fn register_name_functions(world: &mut World) { let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry - .register_type_data::< - ::bevy_ecs::name::Name, - bevy_mod_scripting_bindings::MarkAsGenerated, - >(); + .register_type_data::<::bevy_ecs::name::Name, bevy_mod_scripting_bindings::MarkAsGenerated>( + ); } pub(crate) fn register_default_query_filters_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< @@ -542,11 +519,8 @@ pub(crate) fn register_default_query_filters_functions(world: &mut World) { || { let output: Val<::bevy_ecs::entity_disabling::DefaultQueryFilters> = { { - let output: Val< - ::bevy_ecs::entity_disabling::DefaultQueryFilters, - > = ::bevy_ecs::entity_disabling::DefaultQueryFilters::empty() - .into(); - output + let output: ::bevy_ecs::entity_disabling::DefaultQueryFilters = ::bevy_ecs::entity_disabling::DefaultQueryFilters::empty(); + safe_transmute(output) } }; output @@ -563,11 +537,10 @@ pub(crate) fn register_default_query_filters_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_ecs::entity_disabling::DefaultQueryFilters::register_disabling_component( - &mut _self, - component_id.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(component_id), + ); + safe_transmute(output) } }; output @@ -593,10 +566,9 @@ pub(crate) fn register_component_id_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::component::ComponentId as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -609,11 +581,10 @@ pub(crate) fn register_component_id_functions(world: &mut World) { |_self: Ref<::bevy_ecs::component::ComponentId>| { let output: Val<::bevy_ecs::component::ComponentId> = { { - let output: Val<::bevy_ecs::component::ComponentId> = <::bevy_ecs::component::ComponentId as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::component::ComponentId = <::bevy_ecs::component::ComponentId as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -631,9 +602,8 @@ pub(crate) fn register_component_id_functions(world: &mut World) { { let output: bool = <::bevy_ecs::component::ComponentId as ::core::cmp::PartialEq< ::bevy_ecs::component::ComponentId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -647,10 +617,9 @@ pub(crate) fn register_component_id_functions(world: &mut World) { let output: usize = { { let output: usize = ::bevy_ecs::component::ComponentId::index( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -663,11 +632,10 @@ pub(crate) fn register_component_id_functions(world: &mut World) { |index: usize| { let output: Val<::bevy_ecs::component::ComponentId> = { { - let output: Val<::bevy_ecs::component::ComponentId> = ::bevy_ecs::component::ComponentId::new( - index, - ) - .into(); - output + let output: ::bevy_ecs::component::ComponentId = ::bevy_ecs::component::ComponentId::new( + safe_transmute(index), + ); + safe_transmute(output) } }; output @@ -693,10 +661,9 @@ pub(crate) fn register_tick_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::component::Tick as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -709,11 +676,10 @@ pub(crate) fn register_tick_functions(world: &mut World) { |_self: Ref<::bevy_ecs::component::Tick>| { let output: Val<::bevy_ecs::component::Tick> = { { - let output: Val<::bevy_ecs::component::Tick> = <::bevy_ecs::component::Tick as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::component::Tick = <::bevy_ecs::component::Tick as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -731,9 +697,8 @@ pub(crate) fn register_tick_functions(world: &mut World) { { let output: bool = <::bevy_ecs::component::Tick as ::core::cmp::PartialEq< ::bevy_ecs::component::Tick, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -747,10 +712,9 @@ pub(crate) fn register_tick_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_ecs::component::Tick::get( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -768,12 +732,11 @@ pub(crate) fn register_tick_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_ecs::component::Tick::is_newer_than( - _self.into_inner(), - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(last_run), + safe_transmute(this_run), + ); + safe_transmute(output) } }; output @@ -786,11 +749,10 @@ pub(crate) fn register_tick_functions(world: &mut World) { |tick: u32| { let output: Val<::bevy_ecs::component::Tick> = { { - let output: Val<::bevy_ecs::component::Tick> = ::bevy_ecs::component::Tick::new( - tick, - ) - .into(); - output + let output: ::bevy_ecs::component::Tick = ::bevy_ecs::component::Tick::new( + safe_transmute(tick), + ); + safe_transmute(output) } }; output @@ -804,11 +766,10 @@ pub(crate) fn register_tick_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_ecs::component::Tick::set( - &mut _self, - tick, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(tick), + ); + safe_transmute(output) } }; output @@ -833,11 +794,10 @@ pub(crate) fn register_component_ticks_functions(world: &mut World) { |_self: Ref<::bevy_ecs::component::ComponentTicks>| { let output: Val<::bevy_ecs::component::ComponentTicks> = { { - let output: Val<::bevy_ecs::component::ComponentTicks> = <::bevy_ecs::component::ComponentTicks as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::component::ComponentTicks = <::bevy_ecs::component::ComponentTicks as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -855,12 +815,11 @@ pub(crate) fn register_component_ticks_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_ecs::component::ComponentTicks::is_added( - &_self, - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(last_run), + safe_transmute(this_run), + ); + safe_transmute(output) } }; output @@ -878,12 +837,11 @@ pub(crate) fn register_component_ticks_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_ecs::component::ComponentTicks::is_changed( - &_self, - last_run.into_inner(), - this_run.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(last_run), + safe_transmute(this_run), + ); + safe_transmute(output) } }; output @@ -896,11 +854,10 @@ pub(crate) fn register_component_ticks_functions(world: &mut World) { |change_tick: Val<::bevy_ecs::component::Tick>| { let output: Val<::bevy_ecs::component::ComponentTicks> = { { - let output: Val<::bevy_ecs::component::ComponentTicks> = ::bevy_ecs::component::ComponentTicks::new( - change_tick.into_inner(), - ) - .into(); - output + let output: ::bevy_ecs::component::ComponentTicks = ::bevy_ecs::component::ComponentTicks::new( + safe_transmute(change_tick), + ); + safe_transmute(output) } }; output @@ -917,11 +874,10 @@ pub(crate) fn register_component_ticks_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_ecs::component::ComponentTicks::set_changed( - &mut _self, - change_tick.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(change_tick), + ); + safe_transmute(output) } }; output @@ -947,10 +903,9 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::entity::EntityHashSet as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -963,11 +918,10 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { |_self: Ref<::bevy_ecs::entity::EntityHashSet>| { let output: Val<::bevy_ecs::entity::EntityHashSet> = { { - let output: Val<::bevy_ecs::entity::EntityHashSet> = <::bevy_ecs::entity::EntityHashSet as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityHashSet = <::bevy_ecs::entity::EntityHashSet as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -985,9 +939,8 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { { let output: bool = <::bevy_ecs::entity::EntityHashSet as ::core::cmp::PartialEq< ::bevy_ecs::entity::EntityHashSet, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1001,10 +954,9 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_ecs::entity::EntityHashSet::is_empty( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1018,10 +970,9 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { let output: usize = { { let output: usize = ::bevy_ecs::entity::EntityHashSet::len( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1034,9 +985,8 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { || { let output: Val<::bevy_ecs::entity::EntityHashSet> = { { - let output: Val<::bevy_ecs::entity::EntityHashSet> = ::bevy_ecs::entity::EntityHashSet::new() - .into(); - output + let output: ::bevy_ecs::entity::EntityHashSet = ::bevy_ecs::entity::EntityHashSet::new(); + safe_transmute(output) } }; output @@ -1049,11 +999,10 @@ pub(crate) fn register_entity_hash_set_functions(world: &mut World) { |n: usize| { let output: Val<::bevy_ecs::entity::EntityHashSet> = { { - let output: Val<::bevy_ecs::entity::EntityHashSet> = ::bevy_ecs::entity::EntityHashSet::with_capacity( - n, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityHashSet = ::bevy_ecs::entity::EntityHashSet::with_capacity( + safe_transmute(n), + ); + safe_transmute(output) } }; output @@ -1079,10 +1028,9 @@ pub(crate) fn register_entity_row_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::entity::EntityRow as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1095,11 +1043,10 @@ pub(crate) fn register_entity_row_functions(world: &mut World) { |_self: Ref<::bevy_ecs::entity::EntityRow>| { let output: Val<::bevy_ecs::entity::EntityRow> = { { - let output: Val<::bevy_ecs::entity::EntityRow> = <::bevy_ecs::entity::EntityRow as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityRow = <::bevy_ecs::entity::EntityRow as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1117,9 +1064,8 @@ pub(crate) fn register_entity_row_functions(world: &mut World) { { let output: bool = <::bevy_ecs::entity::EntityRow as ::core::cmp::PartialEq< ::bevy_ecs::entity::EntityRow, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1133,10 +1079,9 @@ pub(crate) fn register_entity_row_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_ecs::entity::EntityRow::index( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1161,12 +1106,11 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { |_self: Val<::bevy_ecs::entity::EntityGeneration>, versions: u32| { let output: Val<::bevy_ecs::entity::EntityGeneration> = { { - let output: Val<::bevy_ecs::entity::EntityGeneration> = ::bevy_ecs::entity::EntityGeneration::after_versions( - _self.into_inner(), - versions, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityGeneration = ::bevy_ecs::entity::EntityGeneration::after_versions( + safe_transmute(_self), + safe_transmute(versions), + ); + safe_transmute(output) } }; output @@ -1180,10 +1124,9 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ecs::entity::EntityGeneration as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1196,11 +1139,10 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { |_self: Ref<::bevy_ecs::entity::EntityGeneration>| { let output: Val<::bevy_ecs::entity::EntityGeneration> = { { - let output: Val<::bevy_ecs::entity::EntityGeneration> = <::bevy_ecs::entity::EntityGeneration as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityGeneration = <::bevy_ecs::entity::EntityGeneration as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1218,9 +1160,8 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { { let output: bool = <::bevy_ecs::entity::EntityGeneration as ::core::cmp::PartialEq< ::bevy_ecs::entity::EntityGeneration, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1233,11 +1174,10 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { |bits: u32| { let output: Val<::bevy_ecs::entity::EntityGeneration> = { { - let output: Val<::bevy_ecs::entity::EntityGeneration> = ::bevy_ecs::entity::EntityGeneration::from_bits( - bits, - ) - .into(); - output + let output: ::bevy_ecs::entity::EntityGeneration = ::bevy_ecs::entity::EntityGeneration::from_bits( + safe_transmute(bits), + ); + safe_transmute(output) } }; output @@ -1251,10 +1191,9 @@ pub(crate) fn register_entity_generation_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_ecs::entity::EntityGeneration::to_bits( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1274,23 +1213,23 @@ pub(crate) fn register_entity_hash_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::entity::EntityHash, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::entity::EntityHash>| { - let output: Val<::bevy_ecs::entity::EntityHash> = { - { - let output: Val<::bevy_ecs::entity::EntityHash> = <::bevy_ecs::entity::EntityHash as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::entity::EntityHash>| { + let output: Val<::bevy_ecs::entity::EntityHash> = { + { + let output: ::bevy_ecs::entity::EntityHash = + <::bevy_ecs::entity::EntityHash as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -1303,23 +1242,23 @@ pub(crate) fn register_disabled_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::entity_disabling::Disabled, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::entity_disabling::Disabled>| { - let output: Val<::bevy_ecs::entity_disabling::Disabled> = { - { - let output: Val<::bevy_ecs::entity_disabling::Disabled> = <::bevy_ecs::entity_disabling::Disabled as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::entity_disabling::Disabled>| { + let output: Val<::bevy_ecs::entity_disabling::Disabled> = { + { + let output: ::bevy_ecs::entity_disabling::Disabled = + <::bevy_ecs::entity_disabling::Disabled as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -1332,23 +1271,23 @@ pub(crate) fn register_internal_functions(world: &mut World) { bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::< ::bevy_ecs::entity_disabling::Internal, >::new(world) - .register_documented( - "clone", - |_self: Ref<::bevy_ecs::entity_disabling::Internal>| { - let output: Val<::bevy_ecs::entity_disabling::Internal> = { - { - let output: Val<::bevy_ecs::entity_disabling::Internal> = <::bevy_ecs::entity_disabling::Internal as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output - } - }; - output - }, - "", - &["_self"], - ); + .register_documented( + "clone", + |_self: Ref<::bevy_ecs::entity_disabling::Internal>| { + let output: Val<::bevy_ecs::entity_disabling::Internal> = { + { + let output: ::bevy_ecs::entity_disabling::Internal = + <::bevy_ecs::entity_disabling::Internal as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) + } + }; + output + }, + "", + &["_self"], + ); let registry = world.get_resource_or_init::(); let mut registry = registry.write(); registry @@ -1366,11 +1305,10 @@ pub(crate) fn register_removed_component_entity_functions(world: &mut World) { |_self: Ref<::bevy_ecs::lifecycle::RemovedComponentEntity>| { let output: Val<::bevy_ecs::lifecycle::RemovedComponentEntity> = { { - let output: Val<::bevy_ecs::lifecycle::RemovedComponentEntity> = <::bevy_ecs::lifecycle::RemovedComponentEntity as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ecs::lifecycle::RemovedComponentEntity = <::bevy_ecs::lifecycle::RemovedComponentEntity as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_gizmos_bms_bindings/src/lib.rs b/crates/bindings/bevy_gizmos_bms_bindings/src/lib.rs index b56509a878..4798c42d44 100644 --- a/crates/bindings/bevy_gizmos_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_gizmos_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_aabb_gizmo_config_group_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::aabb::AabbGizmoConfigGroup>| { let output: Val<::bevy_gizmos::aabb::AabbGizmoConfigGroup> = { { - let output: Val<::bevy_gizmos::aabb::AabbGizmoConfigGroup> = <::bevy_gizmos::aabb::AabbGizmoConfigGroup as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::aabb::AabbGizmoConfigGroup = <::bevy_gizmos::aabb::AabbGizmoConfigGroup as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -77,11 +76,10 @@ pub(crate) fn register_gizmo_config_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::config::GizmoConfig>| { let output: Val<::bevy_gizmos::config::GizmoConfig> = { { - let output: Val<::bevy_gizmos::config::GizmoConfig> = <::bevy_gizmos::config::GizmoConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::config::GizmoConfig = <::bevy_gizmos::config::GizmoConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -118,11 +116,10 @@ pub(crate) fn register_gizmo_line_config_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::config::GizmoLineConfig>| { let output: Val<::bevy_gizmos::config::GizmoLineConfig> = { { - let output: Val<::bevy_gizmos::config::GizmoLineConfig> = <::bevy_gizmos::config::GizmoLineConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::config::GizmoLineConfig = <::bevy_gizmos::config::GizmoLineConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -148,10 +145,9 @@ pub(crate) fn register_gizmo_line_joint_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_gizmos::config::GizmoLineJoint as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -164,11 +160,10 @@ pub(crate) fn register_gizmo_line_joint_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::config::GizmoLineJoint>| { let output: Val<::bevy_gizmos::config::GizmoLineJoint> = { { - let output: Val<::bevy_gizmos::config::GizmoLineJoint> = <::bevy_gizmos::config::GizmoLineJoint as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::config::GizmoLineJoint = <::bevy_gizmos::config::GizmoLineJoint as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -186,9 +181,8 @@ pub(crate) fn register_gizmo_line_joint_functions(world: &mut World) { { let output: bool = <::bevy_gizmos::config::GizmoLineJoint as ::std::cmp::PartialEq< ::bevy_gizmos::config::GizmoLineJoint, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -213,11 +207,10 @@ pub(crate) fn register_gizmo_line_style_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::config::GizmoLineStyle>| { let output: Val<::bevy_gizmos::config::GizmoLineStyle> = { { - let output: Val<::bevy_gizmos::config::GizmoLineStyle> = <::bevy_gizmos::config::GizmoLineStyle as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::config::GizmoLineStyle = <::bevy_gizmos::config::GizmoLineStyle as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -235,9 +228,8 @@ pub(crate) fn register_gizmo_line_style_functions(world: &mut World) { { let output: bool = <::bevy_gizmos::config::GizmoLineStyle as ::std::cmp::PartialEq< ::bevy_gizmos::config::GizmoLineStyle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -262,11 +254,10 @@ pub(crate) fn register_gizmo_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::retained::Gizmo>| { let output: Val<::bevy_gizmos::retained::Gizmo> = { { - let output: Val<::bevy_gizmos::retained::Gizmo> = <::bevy_gizmos::retained::Gizmo as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::retained::Gizmo = <::bevy_gizmos::retained::Gizmo as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -291,11 +282,10 @@ pub(crate) fn register_light_gizmo_color_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::light::LightGizmoColor>| { let output: Val<::bevy_gizmos::light::LightGizmoColor> = { { - let output: Val<::bevy_gizmos::light::LightGizmoColor> = <::bevy_gizmos::light::LightGizmoColor as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::light::LightGizmoColor = <::bevy_gizmos::light::LightGizmoColor as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -320,11 +310,10 @@ pub(crate) fn register_light_gizmo_config_group_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::light::LightGizmoConfigGroup>| { let output: Val<::bevy_gizmos::light::LightGizmoConfigGroup> = { { - let output: Val<::bevy_gizmos::light::LightGizmoConfigGroup> = <::bevy_gizmos::light::LightGizmoConfigGroup as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::light::LightGizmoConfigGroup = <::bevy_gizmos::light::LightGizmoConfigGroup as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -361,11 +350,10 @@ pub(crate) fn register_erased_gizmo_config_group_functions(world: &mut World) { |_self: Ref<::bevy_gizmos::config::ErasedGizmoConfigGroup>| { let output: Val<::bevy_gizmos::config::ErasedGizmoConfigGroup> = { { - let output: Val<::bevy_gizmos::config::ErasedGizmoConfigGroup> = <::bevy_gizmos::config::ErasedGizmoConfigGroup as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gizmos::config::ErasedGizmoConfigGroup = <::bevy_gizmos::config::ErasedGizmoConfigGroup as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_gltf_bms_bindings/src/lib.rs b/crates/bindings/bevy_gltf_bms_bindings/src/lib.rs index 8fa50833ee..79a59b45fe 100644 --- a/crates/bindings/bevy_gltf_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_gltf_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_gltf_extras_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfExtras>| { let output: Val<::bevy_gltf::GltfExtras> = { { - let output: Val<::bevy_gltf::GltfExtras> = <::bevy_gltf::GltfExtras as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfExtras = <::bevy_gltf::GltfExtras as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -53,11 +52,10 @@ pub(crate) fn register_gltf_scene_extras_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfSceneExtras>| { let output: Val<::bevy_gltf::GltfSceneExtras> = { { - let output: Val<::bevy_gltf::GltfSceneExtras> = <::bevy_gltf::GltfSceneExtras as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfSceneExtras = <::bevy_gltf::GltfSceneExtras as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -82,11 +80,10 @@ pub(crate) fn register_gltf_mesh_extras_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfMeshExtras>| { let output: Val<::bevy_gltf::GltfMeshExtras> = { { - let output: Val<::bevy_gltf::GltfMeshExtras> = <::bevy_gltf::GltfMeshExtras as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfMeshExtras = <::bevy_gltf::GltfMeshExtras as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -111,11 +108,10 @@ pub(crate) fn register_gltf_mesh_name_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfMeshName>| { let output: Val<::bevy_gltf::GltfMeshName> = { { - let output: Val<::bevy_gltf::GltfMeshName> = <::bevy_gltf::GltfMeshName as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfMeshName = <::bevy_gltf::GltfMeshName as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -140,11 +136,10 @@ pub(crate) fn register_gltf_material_extras_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfMaterialExtras>| { let output: Val<::bevy_gltf::GltfMaterialExtras> = { { - let output: Val<::bevy_gltf::GltfMaterialExtras> = <::bevy_gltf::GltfMaterialExtras as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfMaterialExtras = <::bevy_gltf::GltfMaterialExtras as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -169,11 +164,10 @@ pub(crate) fn register_gltf_material_name_functions(world: &mut World) { |_self: Ref<::bevy_gltf::GltfMaterialName>| { let output: Val<::bevy_gltf::GltfMaterialName> = { { - let output: Val<::bevy_gltf::GltfMaterialName> = <::bevy_gltf::GltfMaterialName as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_gltf::GltfMaterialName = <::bevy_gltf::GltfMaterialName as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_input_focus_bms_bindings/src/lib.rs b/crates/bindings/bevy_input_focus_bms_bindings/src/lib.rs index ee21c555a6..8cea3b4168 100644 --- a/crates/bindings/bevy_input_focus_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_input_focus_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -25,10 +25,9 @@ pub(crate) fn register_input_focus_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::InputFocus::clear( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -41,11 +40,10 @@ pub(crate) fn register_input_focus_functions(world: &mut World) { |_self: Ref<::bevy_input_focus::InputFocus>| { let output: Val<::bevy_input_focus::InputFocus> = { { - let output: Val<::bevy_input_focus::InputFocus> = <::bevy_input_focus::InputFocus as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::InputFocus = <::bevy_input_focus::InputFocus as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -58,11 +56,10 @@ pub(crate) fn register_input_focus_functions(world: &mut World) { |entity: Val<::bevy_ecs::entity::Entity>| { let output: Val<::bevy_input_focus::InputFocus> = { { - let output: Val<::bevy_input_focus::InputFocus> = ::bevy_input_focus::InputFocus::from_entity( - entity.into_inner(), - ) - .into(); - output + let output: ::bevy_input_focus::InputFocus = ::bevy_input_focus::InputFocus::from_entity( + safe_transmute(entity), + ); + safe_transmute(output) } }; output @@ -79,11 +76,10 @@ pub(crate) fn register_input_focus_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::InputFocus::set( - &mut _self, - entity.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(entity), + ); + safe_transmute(output) } }; output @@ -108,11 +104,10 @@ pub(crate) fn register_input_focus_visible_functions(world: &mut World) { |_self: Ref<::bevy_input_focus::InputFocusVisible>| { let output: Val<::bevy_input_focus::InputFocusVisible> = { { - let output: Val<::bevy_input_focus::InputFocusVisible> = <::bevy_input_focus::InputFocusVisible as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::InputFocusVisible = <::bevy_input_focus::InputFocusVisible as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -137,11 +132,10 @@ pub(crate) fn register_auto_focus_functions(world: &mut World) { |_self: Ref<::bevy_input_focus::AutoFocus>| { let output: Val<::bevy_input_focus::AutoFocus> = { { - let output: Val<::bevy_input_focus::AutoFocus> = <::bevy_input_focus::AutoFocus as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::AutoFocus = <::bevy_input_focus::AutoFocus as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -174,13 +168,12 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::DirectionalNavigationMap::add_edge( - &mut _self, - a.into_inner(), - b.into_inner(), - direction.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(a), + safe_transmute(b), + safe_transmute(direction), + ); + safe_transmute(output) } }; output @@ -201,13 +194,12 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::DirectionalNavigationMap::add_symmetrical_edge( - &mut _self, - a.into_inner(), - b.into_inner(), - direction.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(a), + safe_transmute(b), + safe_transmute(direction), + ); + safe_transmute(output) } }; output @@ -225,10 +217,9 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::DirectionalNavigationMap::clear( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -247,13 +238,10 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { ::bevy_input_focus::directional_navigation::DirectionalNavigationMap, > = { { - let output: Val< - ::bevy_input_focus::directional_navigation::DirectionalNavigationMap, - > = <::bevy_input_focus::directional_navigation::DirectionalNavigationMap as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::directional_navigation::DirectionalNavigationMap = <::bevy_input_focus::directional_navigation::DirectionalNavigationMap as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -275,9 +263,8 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { { let output: bool = <::bevy_input_focus::directional_navigation::DirectionalNavigationMap as ::core::cmp::PartialEq< ::bevy_input_focus::directional_navigation::DirectionalNavigationMap, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -296,11 +283,10 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::DirectionalNavigationMap::remove( - &mut _self, - entity.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(entity), + ); + safe_transmute(output) } }; output @@ -319,11 +305,10 @@ pub(crate) fn register_directional_navigation_map_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::DirectionalNavigationMap::remove_multiple( - &mut _self, - entities.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(entities), + ); + safe_transmute(output) } }; output @@ -350,13 +335,10 @@ pub(crate) fn register_nav_neighbors_functions(world: &mut World) { ::bevy_input_focus::directional_navigation::NavNeighbors, > = { { - let output: Val< - ::bevy_input_focus::directional_navigation::NavNeighbors, - > = <::bevy_input_focus::directional_navigation::NavNeighbors as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::directional_navigation::NavNeighbors = <::bevy_input_focus::directional_navigation::NavNeighbors as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -374,9 +356,8 @@ pub(crate) fn register_nav_neighbors_functions(world: &mut World) { { let output: bool = <::bevy_input_focus::directional_navigation::NavNeighbors as ::core::cmp::PartialEq< ::bevy_input_focus::directional_navigation::NavNeighbors, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -394,12 +375,11 @@ pub(crate) fn register_nav_neighbors_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_input_focus::directional_navigation::NavNeighbors::set( - &mut _self, - octant.into_inner(), - entity.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(octant), + safe_transmute(entity), + ); + safe_transmute(output) } }; output @@ -425,10 +405,9 @@ pub(crate) fn register_tab_index_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_input_focus::tab_navigation::TabIndex as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -441,11 +420,10 @@ pub(crate) fn register_tab_index_functions(world: &mut World) { |_self: Ref<::bevy_input_focus::tab_navigation::TabIndex>| { let output: Val<::bevy_input_focus::tab_navigation::TabIndex> = { { - let output: Val<::bevy_input_focus::tab_navigation::TabIndex> = <::bevy_input_focus::tab_navigation::TabIndex as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::tab_navigation::TabIndex = <::bevy_input_focus::tab_navigation::TabIndex as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -463,9 +441,8 @@ pub(crate) fn register_tab_index_functions(world: &mut World) { { let output: bool = <::bevy_input_focus::tab_navigation::TabIndex as ::core::cmp::PartialEq< ::bevy_input_focus::tab_navigation::TabIndex, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -490,11 +467,10 @@ pub(crate) fn register_tab_group_functions(world: &mut World) { |_self: Ref<::bevy_input_focus::tab_navigation::TabGroup>| { let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = { { - let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = <::bevy_input_focus::tab_navigation::TabGroup as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_input_focus::tab_navigation::TabGroup = <::bevy_input_focus::tab_navigation::TabGroup as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -507,9 +483,8 @@ pub(crate) fn register_tab_group_functions(world: &mut World) { || { let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = { { - let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = ::bevy_input_focus::tab_navigation::TabGroup::modal() - .into(); - output + let output: ::bevy_input_focus::tab_navigation::TabGroup = ::bevy_input_focus::tab_navigation::TabGroup::modal(); + safe_transmute(output) } }; output @@ -522,11 +497,10 @@ pub(crate) fn register_tab_group_functions(world: &mut World) { |order: i32| { let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = { { - let output: Val<::bevy_input_focus::tab_navigation::TabGroup> = ::bevy_input_focus::tab_navigation::TabGroup::new( - order, - ) - .into(); - output + let output: ::bevy_input_focus::tab_navigation::TabGroup = ::bevy_input_focus::tab_navigation::TabGroup::new( + safe_transmute(order), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_light_bms_bindings/src/lib.rs b/crates/bindings/bevy_light_bms_bindings/src/lib.rs index 10efa9ee5f..f785278507 100644 --- a/crates/bindings/bevy_light_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_light_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_clustered_decal_functions(world: &mut World) { |_self: Ref<::bevy_light::ClusteredDecal>| { let output: Val<::bevy_light::ClusteredDecal> = { { - let output: Val<::bevy_light::ClusteredDecal> = <::bevy_light::ClusteredDecal as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::ClusteredDecal = <::bevy_light::ClusteredDecal as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -53,11 +52,10 @@ pub(crate) fn register_ambient_light_functions(world: &mut World) { |_self: Ref<::bevy_light::AmbientLight>| { let output: Val<::bevy_light::AmbientLight> = { { - let output: Val<::bevy_light::AmbientLight> = <::bevy_light::AmbientLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::AmbientLight = <::bevy_light::AmbientLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -82,11 +80,10 @@ pub(crate) fn register_environment_map_light_functions(world: &mut World) { |_self: Ref<::bevy_light::EnvironmentMapLight>| { let output: Val<::bevy_light::EnvironmentMapLight> = { { - let output: Val<::bevy_light::EnvironmentMapLight> = <::bevy_light::EnvironmentMapLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::EnvironmentMapLight = <::bevy_light::EnvironmentMapLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -111,11 +108,10 @@ pub(crate) fn register_generated_environment_map_light_functions(world: &mut Wor |_self: Ref<::bevy_light::GeneratedEnvironmentMapLight>| { let output: Val<::bevy_light::GeneratedEnvironmentMapLight> = { { - let output: Val<::bevy_light::GeneratedEnvironmentMapLight> = <::bevy_light::GeneratedEnvironmentMapLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::GeneratedEnvironmentMapLight = <::bevy_light::GeneratedEnvironmentMapLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -140,11 +136,10 @@ pub(crate) fn register_irradiance_volume_functions(world: &mut World) { |_self: Ref<::bevy_light::IrradianceVolume>| { let output: Val<::bevy_light::IrradianceVolume> = { { - let output: Val<::bevy_light::IrradianceVolume> = <::bevy_light::IrradianceVolume as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::IrradianceVolume = <::bevy_light::IrradianceVolume as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -169,11 +164,10 @@ pub(crate) fn register_light_probe_functions(world: &mut World) { |_self: Ref<::bevy_light::LightProbe>| { let output: Val<::bevy_light::LightProbe> = { { - let output: Val<::bevy_light::LightProbe> = <::bevy_light::LightProbe as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::LightProbe = <::bevy_light::LightProbe as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -186,9 +180,8 @@ pub(crate) fn register_light_probe_functions(world: &mut World) { || { let output: Val<::bevy_light::LightProbe> = { { - let output: Val<::bevy_light::LightProbe> = ::bevy_light::LightProbe::new() - .into(); - output + let output: ::bevy_light::LightProbe = ::bevy_light::LightProbe::new(); + safe_transmute(output) } }; output @@ -213,11 +206,10 @@ pub(crate) fn register_fog_volume_functions(world: &mut World) { |_self: Ref<::bevy_light::FogVolume>| { let output: Val<::bevy_light::FogVolume> = { { - let output: Val<::bevy_light::FogVolume> = <::bevy_light::FogVolume as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::FogVolume = <::bevy_light::FogVolume as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -242,11 +234,10 @@ pub(crate) fn register_volumetric_fog_functions(world: &mut World) { |_self: Ref<::bevy_light::VolumetricFog>| { let output: Val<::bevy_light::VolumetricFog> = { { - let output: Val<::bevy_light::VolumetricFog> = <::bevy_light::VolumetricFog as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::VolumetricFog = <::bevy_light::VolumetricFog as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -271,11 +262,10 @@ pub(crate) fn register_volumetric_light_functions(world: &mut World) { |_self: Ref<::bevy_light::VolumetricLight>| { let output: Val<::bevy_light::VolumetricLight> = { { - let output: Val<::bevy_light::VolumetricLight> = <::bevy_light::VolumetricLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::VolumetricLight = <::bevy_light::VolumetricLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -300,11 +290,10 @@ pub(crate) fn register_cascade_shadow_config_functions(world: &mut World) { |_self: Ref<::bevy_light::CascadeShadowConfig>| { let output: Val<::bevy_light::CascadeShadowConfig> = { { - let output: Val<::bevy_light::CascadeShadowConfig> = <::bevy_light::CascadeShadowConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::CascadeShadowConfig = <::bevy_light::CascadeShadowConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -329,11 +318,10 @@ pub(crate) fn register_cascades_functions(world: &mut World) { |_self: Ref<::bevy_light::Cascades>| { let output: Val<::bevy_light::Cascades> = { { - let output: Val<::bevy_light::Cascades> = <::bevy_light::Cascades as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::Cascades = <::bevy_light::Cascades as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -358,11 +346,10 @@ pub(crate) fn register_point_light_functions(world: &mut World) { |_self: Ref<::bevy_light::PointLight>| { let output: Val<::bevy_light::PointLight> = { { - let output: Val<::bevy_light::PointLight> = <::bevy_light::PointLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::PointLight = <::bevy_light::PointLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -387,11 +374,10 @@ pub(crate) fn register_point_light_shadow_map_functions(world: &mut World) { |_self: Ref<::bevy_light::PointLightShadowMap>| { let output: Val<::bevy_light::PointLightShadowMap> = { { - let output: Val<::bevy_light::PointLightShadowMap> = <::bevy_light::PointLightShadowMap as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::PointLightShadowMap = <::bevy_light::PointLightShadowMap as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -416,11 +402,10 @@ pub(crate) fn register_point_light_texture_functions(world: &mut World) { |_self: Ref<::bevy_light::PointLightTexture>| { let output: Val<::bevy_light::PointLightTexture> = { { - let output: Val<::bevy_light::PointLightTexture> = <::bevy_light::PointLightTexture as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::PointLightTexture = <::bevy_light::PointLightTexture as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -445,11 +430,10 @@ pub(crate) fn register_spot_light_functions(world: &mut World) { |_self: Ref<::bevy_light::SpotLight>| { let output: Val<::bevy_light::SpotLight> = { { - let output: Val<::bevy_light::SpotLight> = <::bevy_light::SpotLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::SpotLight = <::bevy_light::SpotLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -474,11 +458,10 @@ pub(crate) fn register_spot_light_texture_functions(world: &mut World) { |_self: Ref<::bevy_light::SpotLightTexture>| { let output: Val<::bevy_light::SpotLightTexture> = { { - let output: Val<::bevy_light::SpotLightTexture> = <::bevy_light::SpotLightTexture as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::SpotLightTexture = <::bevy_light::SpotLightTexture as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -503,11 +486,10 @@ pub(crate) fn register_directional_light_functions(world: &mut World) { |_self: Ref<::bevy_light::DirectionalLight>| { let output: Val<::bevy_light::DirectionalLight> = { { - let output: Val<::bevy_light::DirectionalLight> = <::bevy_light::DirectionalLight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::DirectionalLight = <::bevy_light::DirectionalLight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -532,11 +514,10 @@ pub(crate) fn register_directional_light_shadow_map_functions(world: &mut World) |_self: Ref<::bevy_light::DirectionalLightShadowMap>| { let output: Val<::bevy_light::DirectionalLightShadowMap> = { { - let output: Val<::bevy_light::DirectionalLightShadowMap> = <::bevy_light::DirectionalLightShadowMap as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::DirectionalLightShadowMap = <::bevy_light::DirectionalLightShadowMap as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -561,11 +542,10 @@ pub(crate) fn register_directional_light_texture_functions(world: &mut World) { |_self: Ref<::bevy_light::DirectionalLightTexture>| { let output: Val<::bevy_light::DirectionalLightTexture> = { { - let output: Val<::bevy_light::DirectionalLightTexture> = <::bevy_light::DirectionalLightTexture as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::DirectionalLightTexture = <::bevy_light::DirectionalLightTexture as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -590,11 +570,10 @@ pub(crate) fn register_not_shadow_caster_functions(world: &mut World) { |_self: Ref<::bevy_light::NotShadowCaster>| { let output: Val<::bevy_light::NotShadowCaster> = { { - let output: Val<::bevy_light::NotShadowCaster> = <::bevy_light::NotShadowCaster as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::NotShadowCaster = <::bevy_light::NotShadowCaster as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -612,9 +591,8 @@ pub(crate) fn register_not_shadow_caster_functions(world: &mut World) { { let output: bool = <::bevy_light::NotShadowCaster as ::std::cmp::PartialEq< ::bevy_light::NotShadowCaster, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -664,10 +642,9 @@ pub(crate) fn register_shadow_filtering_method_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_light::ShadowFilteringMethod as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -680,11 +657,10 @@ pub(crate) fn register_shadow_filtering_method_functions(world: &mut World) { |_self: Ref<::bevy_light::ShadowFilteringMethod>| { let output: Val<::bevy_light::ShadowFilteringMethod> = { { - let output: Val<::bevy_light::ShadowFilteringMethod> = <::bevy_light::ShadowFilteringMethod as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::ShadowFilteringMethod = <::bevy_light::ShadowFilteringMethod as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -702,9 +678,8 @@ pub(crate) fn register_shadow_filtering_method_functions(world: &mut World) { { let output: bool = <::bevy_light::ShadowFilteringMethod as ::std::cmp::PartialEq< ::bevy_light::ShadowFilteringMethod, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -729,11 +704,10 @@ pub(crate) fn register_cluster_far_z_mode_functions(world: &mut World) { |_self: Ref<::bevy_light::cluster::ClusterFarZMode>| { let output: Val<::bevy_light::cluster::ClusterFarZMode> = { { - let output: Val<::bevy_light::cluster::ClusterFarZMode> = <::bevy_light::cluster::ClusterFarZMode as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::cluster::ClusterFarZMode = <::bevy_light::cluster::ClusterFarZMode as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -758,11 +732,10 @@ pub(crate) fn register_cluster_z_config_functions(world: &mut World) { |_self: Ref<::bevy_light::cluster::ClusterZConfig>| { let output: Val<::bevy_light::cluster::ClusterZConfig> = { { - let output: Val<::bevy_light::cluster::ClusterZConfig> = <::bevy_light::cluster::ClusterZConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::cluster::ClusterZConfig = <::bevy_light::cluster::ClusterZConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -787,11 +760,10 @@ pub(crate) fn register_cluster_config_functions(world: &mut World) { |_self: Ref<::bevy_light::cluster::ClusterConfig>| { let output: Val<::bevy_light::cluster::ClusterConfig> = { { - let output: Val<::bevy_light::cluster::ClusterConfig> = <::bevy_light::cluster::ClusterConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::cluster::ClusterConfig = <::bevy_light::cluster::ClusterConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -816,11 +788,10 @@ pub(crate) fn register_cascade_functions(world: &mut World) { |_self: Ref<::bevy_light::cascade::Cascade>| { let output: Val<::bevy_light::cascade::Cascade> = { { - let output: Val<::bevy_light::cascade::Cascade> = <::bevy_light::cascade::Cascade as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_light::cascade::Cascade = <::bevy_light::cascade::Cascade as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_math_bms_bindings/src/lib.rs b/crates/bindings/bevy_math_bms_bindings/src/lib.rs index 223da5c7b9..52a7de2e7b 100644 --- a/crates/bindings/bevy_math_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_math_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: Val<::bevy_math::AspectRatio> = { { - let output: Val<::bevy_math::AspectRatio> = <::bevy_math::AspectRatio as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::AspectRatio = <::bevy_math::AspectRatio as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -43,9 +42,8 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { { let output: bool = <::bevy_math::AspectRatio as ::core::cmp::PartialEq< ::bevy_math::AspectRatio, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -58,11 +56,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: Val<::bevy_math::AspectRatio> = { { - let output: Val<::bevy_math::AspectRatio> = ::bevy_math::AspectRatio::inverse( - &_self, - ) - .into(); - output + let output: ::bevy_math::AspectRatio = ::bevy_math::AspectRatio::inverse( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -75,9 +72,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: bool = { { - let output: bool = ::bevy_math::AspectRatio::is_landscape(&_self) - .into(); - output + let output: bool = ::bevy_math::AspectRatio::is_landscape( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -90,9 +88,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: bool = { { - let output: bool = ::bevy_math::AspectRatio::is_portrait(&_self) - .into(); - output + let output: bool = ::bevy_math::AspectRatio::is_portrait( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -105,9 +104,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: bool = { { - let output: bool = ::bevy_math::AspectRatio::is_square(&_self) - .into(); - output + let output: bool = ::bevy_math::AspectRatio::is_square( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -120,8 +120,10 @@ pub(crate) fn register_aspect_ratio_functions(world: &mut World) { |_self: Ref<::bevy_math::AspectRatio>| { let output: f32 = { { - let output: f32 = ::bevy_math::AspectRatio::ratio(&_self).into(); - output + let output: f32 = ::bevy_math::AspectRatio::ratio( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -147,10 +149,9 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_math::CompassOctant as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -163,11 +164,10 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { |_self: Ref<::bevy_math::CompassOctant>| { let output: Val<::bevy_math::CompassOctant> = { { - let output: Val<::bevy_math::CompassOctant> = <::bevy_math::CompassOctant as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::CompassOctant = <::bevy_math::CompassOctant as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -185,9 +185,8 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { { let output: bool = <::bevy_math::CompassOctant as ::core::cmp::PartialEq< ::bevy_math::CompassOctant, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -200,11 +199,10 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { |_self: Val<::bevy_math::CompassOctant>| { let output: Val<::bevy_math::CompassOctant> = { { - let output: Val<::bevy_math::CompassOctant> = <::bevy_math::CompassOctant as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::CompassOctant = <::bevy_math::CompassOctant as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -217,11 +215,10 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { |_self: Ref<::bevy_math::CompassOctant>| { let output: Val<::bevy_math::CompassOctant> = { { - let output: Val<::bevy_math::CompassOctant> = ::bevy_math::CompassOctant::opposite( - &_self, - ) - .into(); - output + let output: ::bevy_math::CompassOctant = ::bevy_math::CompassOctant::opposite( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -235,10 +232,9 @@ pub(crate) fn register_compass_octant_functions(world: &mut World) { let output: usize = { { let output: usize = ::bevy_math::CompassOctant::to_index( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -264,10 +260,9 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_math::CompassQuadrant as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -280,11 +275,10 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { |_self: Ref<::bevy_math::CompassQuadrant>| { let output: Val<::bevy_math::CompassQuadrant> = { { - let output: Val<::bevy_math::CompassQuadrant> = <::bevy_math::CompassQuadrant as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::CompassQuadrant = <::bevy_math::CompassQuadrant as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -302,9 +296,8 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { { let output: bool = <::bevy_math::CompassQuadrant as ::core::cmp::PartialEq< ::bevy_math::CompassQuadrant, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -317,11 +310,10 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { |_self: Val<::bevy_math::CompassQuadrant>| { let output: Val<::bevy_math::CompassQuadrant> = { { - let output: Val<::bevy_math::CompassQuadrant> = <::bevy_math::CompassQuadrant as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::CompassQuadrant = <::bevy_math::CompassQuadrant as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -334,11 +326,10 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { |_self: Ref<::bevy_math::CompassQuadrant>| { let output: Val<::bevy_math::CompassQuadrant> = { { - let output: Val<::bevy_math::CompassQuadrant> = ::bevy_math::CompassQuadrant::opposite( - &_self, - ) - .into(); - output + let output: ::bevy_math::CompassQuadrant = ::bevy_math::CompassQuadrant::opposite( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -352,10 +343,9 @@ pub(crate) fn register_compass_quadrant_functions(world: &mut World) { let output: usize = { { let output: usize = ::bevy_math::CompassQuadrant::to_index( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -380,11 +370,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry2d>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = <::bevy_math::Isometry2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Isometry2d = <::bevy_math::Isometry2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -399,9 +388,8 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::Isometry2d as ::core::cmp::PartialEq< ::bevy_math::Isometry2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -414,11 +402,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |rotation: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::from_rotation( - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::from_rotation( + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -431,11 +418,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |translation: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::from_translation( - translation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::from_translation( + safe_transmute(translation), + ); + safe_transmute(output) } }; output @@ -448,12 +434,11 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |x: f32, y: f32| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::from_xy( - x, - y, - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::from_xy( + safe_transmute(x), + safe_transmute(y), + ); + safe_transmute(output) } }; output @@ -466,11 +451,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry2d>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::inverse( - &_self, - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::inverse( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -483,12 +467,11 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry2d>, rhs: Val<::bevy_math::Isometry2d>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::inverse_mul( - &_self, - rhs.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::inverse_mul( + safe_transmute(_self), + safe_transmute(rhs), + ); + safe_transmute(output) } }; output @@ -501,12 +484,11 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry2d>, point: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Isometry2d::inverse_transform_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Isometry2d::inverse_transform_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -519,11 +501,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry2d>, rhs: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = <::bevy_math::Isometry2d as ::core::ops::Mul< + let output: ::bevy_math::Dir2 = <::bevy_math::Isometry2d as ::core::ops::Mul< ::bevy_math::Dir2, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -536,11 +517,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry2d>, rhs: Val<::bevy_math::Isometry2d>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = <::bevy_math::Isometry2d as ::core::ops::Mul< + let output: ::bevy_math::Isometry2d = <::bevy_math::Isometry2d as ::core::ops::Mul< ::bevy_math::Isometry2d, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -553,11 +533,10 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry2d>, rhs: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = <::bevy_math::Isometry2d as ::core::ops::Mul< + let output: ::bevy_math::Vec2 = <::bevy_math::Isometry2d as ::core::ops::Mul< ::bevy_math::Vec2, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -570,12 +549,11 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |translation: Val<::bevy_math::Vec2>, rotation: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Isometry2d> = { { - let output: Val<::bevy_math::Isometry2d> = ::bevy_math::Isometry2d::new( - translation.into_inner(), - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry2d = ::bevy_math::Isometry2d::new( + safe_transmute(translation), + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -588,12 +566,11 @@ pub(crate) fn register_isometry_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry2d>, point: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Isometry2d::transform_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Isometry2d::transform_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -618,11 +595,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry3d>| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = <::bevy_math::Isometry3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Isometry3d = <::bevy_math::Isometry3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -637,9 +613,8 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::Isometry3d as ::core::cmp::PartialEq< ::bevy_math::Isometry3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -652,11 +627,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |rotation: Val<::bevy_math::Quat>| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::Isometry3d::from_rotation( - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::Isometry3d::from_rotation( + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -669,13 +643,12 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |x: f32, y: f32, z: f32| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::Isometry3d::from_xyz( - x, - y, - z, - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::Isometry3d::from_xyz( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + ); + safe_transmute(output) } }; output @@ -688,11 +661,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry3d>| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::Isometry3d::inverse( - &_self, - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::Isometry3d::inverse( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -705,12 +677,11 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Isometry3d>, rhs: Val<::bevy_math::Isometry3d>| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::Isometry3d::inverse_mul( - &_self, - rhs.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::Isometry3d::inverse_mul( + safe_transmute(_self), + safe_transmute(rhs), + ); + safe_transmute(output) } }; output @@ -723,11 +694,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry3d>, rhs: Val<::bevy_math::Dir3>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = <::bevy_math::Isometry3d as ::core::ops::Mul< + let output: ::bevy_math::Dir3 = <::bevy_math::Isometry3d as ::core::ops::Mul< ::bevy_math::Dir3, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -740,11 +710,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry3d>, rhs: Val<::bevy_math::Isometry3d>| { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = <::bevy_math::Isometry3d as ::core::ops::Mul< + let output: ::bevy_math::Isometry3d = <::bevy_math::Isometry3d as ::core::ops::Mul< ::bevy_math::Isometry3d, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -757,11 +726,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry3d>, rhs: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = <::bevy_math::Isometry3d as ::core::ops::Mul< + let output: ::bevy_math::Vec3 = <::bevy_math::Isometry3d as ::core::ops::Mul< ::bevy_math::Vec3, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -774,11 +742,10 @@ pub(crate) fn register_isometry_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::Isometry3d>, rhs: Val<::bevy_math::Vec3A>| { let output: Val<::bevy_math::Vec3A> = { { - let output: Val<::bevy_math::Vec3A> = <::bevy_math::Isometry3d as ::core::ops::Mul< + let output: ::bevy_math::Vec3A = <::bevy_math::Isometry3d as ::core::ops::Mul< ::bevy_math::Vec3A, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -803,11 +770,10 @@ pub(crate) fn register_ray_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Ray2d>| { let output: Val<::bevy_math::Ray2d> = { { - let output: Val<::bevy_math::Ray2d> = <::bevy_math::Ray2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Ray2d = <::bevy_math::Ray2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -822,9 +788,8 @@ pub(crate) fn register_ray_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::Ray2d as ::core::cmp::PartialEq< ::bevy_math::Ray2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -837,12 +802,11 @@ pub(crate) fn register_ray_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Ray2d>, distance: f32| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Ray2d::get_point( - &_self, - distance, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Ray2d::get_point( + safe_transmute(_self), + safe_transmute(distance), + ); + safe_transmute(output) } }; output @@ -860,12 +824,11 @@ pub(crate) fn register_ray_2_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::Ray2d::intersect_plane( - &_self, - plane_origin.into_inner(), - plane.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(plane_origin), + safe_transmute(plane), + ); + safe_transmute(output) } }; output @@ -878,12 +841,11 @@ pub(crate) fn register_ray_2_d_functions(world: &mut World) { |origin: Val<::bevy_math::Vec2>, direction: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Ray2d> = { { - let output: Val<::bevy_math::Ray2d> = ::bevy_math::Ray2d::new( - origin.into_inner(), - direction.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Ray2d = ::bevy_math::Ray2d::new( + safe_transmute(origin), + safe_transmute(direction), + ); + safe_transmute(output) } }; output @@ -908,11 +870,10 @@ pub(crate) fn register_ray_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Ray3d>| { let output: Val<::bevy_math::Ray3d> = { { - let output: Val<::bevy_math::Ray3d> = <::bevy_math::Ray3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Ray3d = <::bevy_math::Ray3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -927,9 +888,8 @@ pub(crate) fn register_ray_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::Ray3d as ::core::cmp::PartialEq< ::bevy_math::Ray3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -942,12 +902,11 @@ pub(crate) fn register_ray_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::Ray3d>, distance: f32| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::Ray3d::get_point( - &_self, - distance, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::Ray3d::get_point( + safe_transmute(_self), + safe_transmute(distance), + ); + safe_transmute(output) } }; output @@ -965,12 +924,11 @@ pub(crate) fn register_ray_3_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::Ray3d::intersect_plane( - &_self, - plane_origin.into_inner(), - plane.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(plane_origin), + safe_transmute(plane), + ); + safe_transmute(output) } }; output @@ -983,12 +941,11 @@ pub(crate) fn register_ray_3_d_functions(world: &mut World) { |origin: Val<::bevy_math::Vec3>, direction: Val<::bevy_math::Dir3>| { let output: Val<::bevy_math::Ray3d> = { { - let output: Val<::bevy_math::Ray3d> = ::bevy_math::Ray3d::new( - origin.into_inner(), - direction.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Ray3d = ::bevy_math::Ray3d::new( + safe_transmute(origin), + safe_transmute(direction), + ); + safe_transmute(output) } }; output @@ -1014,11 +971,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::angle_to( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -1032,10 +988,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::as_degrees( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1049,10 +1004,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::as_radians( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1066,10 +1020,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::as_turn_fraction( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1082,11 +1035,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Ref<::bevy_math::Rot2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = <::bevy_math::Rot2 as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Rot2 = <::bevy_math::Rot2 as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1099,11 +1051,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |degrees: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::degrees( - degrees, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::degrees( + safe_transmute(degrees), + ); + safe_transmute(output) } }; output @@ -1118,9 +1069,8 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { { let output: bool = <::bevy_math::Rot2 as ::core::cmp::PartialEq< ::bevy_math::Rot2, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1133,11 +1083,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::fast_renormalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::fast_renormalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1150,12 +1099,11 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |sin: f32, cos: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::from_sin_cos( - sin, - cos, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::from_sin_cos( + safe_transmute(sin), + safe_transmute(cos), + ); + safe_transmute(output) } }; output @@ -1168,11 +1116,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::inverse( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::inverse( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1186,10 +1133,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::Rot2::is_finite( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1202,9 +1148,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>| { let output: bool = { { - let output: bool = ::bevy_math::Rot2::is_nan(_self.into_inner()) - .into(); - output + let output: bool = ::bevy_math::Rot2::is_nan( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1218,10 +1165,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::Rot2::is_near_identity( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1235,10 +1181,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::Rot2::is_normalized( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1251,9 +1196,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>| { let output: f32 = { { - let output: f32 = ::bevy_math::Rot2::length(_self.into_inner()) - .into(); - output + let output: f32 = ::bevy_math::Rot2::length( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1267,10 +1213,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::length_recip( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1284,10 +1229,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::Rot2::length_squared( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1300,11 +1244,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>, direction: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = <::bevy_math::Rot2 as ::core::ops::Mul< + let output: ::bevy_math::Dir2 = <::bevy_math::Rot2 as ::core::ops::Mul< ::bevy_math::Dir2, - >>::mul(_self.into_inner(), direction.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(direction)); + safe_transmute(output) } }; output @@ -1317,11 +1260,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>, rhs: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = <::bevy_math::Rot2 as ::core::ops::Mul< + let output: ::bevy_math::Rot2 = <::bevy_math::Rot2 as ::core::ops::Mul< ::bevy_math::Rot2, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1334,11 +1276,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>, rhs: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = <::bevy_math::Rot2 as ::core::ops::Mul< + let output: ::bevy_math::Vec2 = <::bevy_math::Rot2 as ::core::ops::Mul< ::bevy_math::Vec2, - >>::mul(_self.into_inner(), rhs.into_inner()) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1351,13 +1292,12 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>, end: Val<::bevy_math::Rot2>, s: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::nlerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::nlerp( + safe_transmute(_self), + safe_transmute(end), + safe_transmute(s), + ); + safe_transmute(output) } }; output @@ -1370,11 +1310,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::normalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::normalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1387,11 +1326,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |radians: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::radians( - radians, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::radians( + safe_transmute(radians), + ); + safe_transmute(output) } }; output @@ -1405,10 +1343,9 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { let output: (f32, f32) = { { let output: (f32, f32) = ::bevy_math::Rot2::sin_cos( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1421,13 +1358,12 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |_self: Val<::bevy_math::Rot2>, end: Val<::bevy_math::Rot2>, s: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::slerp( - _self.into_inner(), - end.into_inner(), - s, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::slerp( + safe_transmute(_self), + safe_transmute(end), + safe_transmute(s), + ); + safe_transmute(output) } }; output @@ -1440,11 +1376,10 @@ pub(crate) fn register_rot_2_functions(world: &mut World) { |fraction: f32| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Rot2::turn_fraction( - fraction, - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Rot2::turn_fraction( + safe_transmute(fraction), + ); + safe_transmute(output) } }; output @@ -1469,11 +1404,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Dir2::as_vec2( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Dir2::as_vec2( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1486,11 +1420,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = <::bevy_math::Dir2 as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir2 = <::bevy_math::Dir2 as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1505,9 +1438,8 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { { let output: bool = <::bevy_math::Dir2 as ::core::cmp::PartialEq< ::bevy_math::Dir2, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1520,11 +1452,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::Dir2::fast_renormalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::Dir2::fast_renormalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1537,12 +1468,11 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |x: f32, y: f32| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::Dir2::from_xy_unchecked( - x, - y, - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::Dir2::from_xy_unchecked( + safe_transmute(x), + safe_transmute(y), + ); + safe_transmute(output) } }; output @@ -1555,11 +1485,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>, rhs: f32| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = <::bevy_math::Dir2 as ::core::ops::Mul< + let output: ::bevy_math::Vec2 = <::bevy_math::Dir2 as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1572,11 +1501,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = <::bevy_math::Dir2 as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir2 = <::bevy_math::Dir2 as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1589,11 +1517,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |value: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::Dir2::new_unchecked( - value.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::Dir2::new_unchecked( + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -1606,12 +1533,11 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>, other: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_from( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_from( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -1624,11 +1550,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_from_x( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_from_x( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1641,11 +1566,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_from_y( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_from_y( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1658,12 +1582,11 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>, other: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_to( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_to( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -1676,11 +1599,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_to_x( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_to_x( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1693,11 +1615,10 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>| { let output: Val<::bevy_math::Rot2> = { { - let output: Val<::bevy_math::Rot2> = ::bevy_math::Dir2::rotation_to_y( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rot2 = ::bevy_math::Dir2::rotation_to_y( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1710,13 +1631,12 @@ pub(crate) fn register_dir_2_functions(world: &mut World) { |_self: Val<::bevy_math::Dir2>, rhs: Val<::bevy_math::Dir2>, s: f32| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::Dir2::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::Dir2::slerp( + safe_transmute(_self), + safe_transmute(rhs), + safe_transmute(s), + ); + safe_transmute(output) } }; output @@ -1741,11 +1661,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir3>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::Dir3::as_vec3( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::Dir3::as_vec3( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1758,11 +1677,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir3>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = <::bevy_math::Dir3 as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir3 = <::bevy_math::Dir3 as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1777,9 +1695,8 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { { let output: bool = <::bevy_math::Dir3 as ::core::cmp::PartialEq< ::bevy_math::Dir3, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1792,11 +1709,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = ::bevy_math::Dir3::fast_renormalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3 = ::bevy_math::Dir3::fast_renormalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1809,13 +1725,12 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |x: f32, y: f32, z: f32| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = ::bevy_math::Dir3::from_xyz_unchecked( - x, - y, - z, - ) - .into(); - output + let output: ::bevy_math::Dir3 = ::bevy_math::Dir3::from_xyz_unchecked( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + ); + safe_transmute(output) } }; output @@ -1828,11 +1743,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3>, rhs: f32| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = <::bevy_math::Dir3 as ::core::ops::Mul< + let output: ::bevy_math::Vec3 = <::bevy_math::Dir3 as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -1845,11 +1759,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = <::bevy_math::Dir3 as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3 = <::bevy_math::Dir3 as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1862,11 +1775,10 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |value: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = ::bevy_math::Dir3::new_unchecked( - value.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3 = ::bevy_math::Dir3::new_unchecked( + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -1879,13 +1791,12 @@ pub(crate) fn register_dir_3_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3>, rhs: Val<::bevy_math::Dir3>, s: f32| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = ::bevy_math::Dir3::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output + let output: ::bevy_math::Dir3 = ::bevy_math::Dir3::slerp( + safe_transmute(_self), + safe_transmute(rhs), + safe_transmute(s), + ); + safe_transmute(output) } }; output @@ -1910,11 +1821,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir3A>| { let output: Val<::bevy_math::Vec3A> = { { - let output: Val<::bevy_math::Vec3A> = ::bevy_math::Dir3A::as_vec3a( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3A = ::bevy_math::Dir3A::as_vec3a( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1927,11 +1837,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir3A>| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = <::bevy_math::Dir3A as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir3A = <::bevy_math::Dir3A as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1946,9 +1855,8 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { { let output: bool = <::bevy_math::Dir3A as ::core::cmp::PartialEq< ::bevy_math::Dir3A, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1961,11 +1869,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3A>| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = ::bevy_math::Dir3A::fast_renormalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3A = ::bevy_math::Dir3A::fast_renormalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1978,13 +1885,12 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |x: f32, y: f32, z: f32| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = ::bevy_math::Dir3A::from_xyz_unchecked( - x, - y, - z, - ) - .into(); - output + let output: ::bevy_math::Dir3A = ::bevy_math::Dir3A::from_xyz_unchecked( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + ); + safe_transmute(output) } }; output @@ -1997,11 +1903,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3A>, rhs: f32| { let output: Val<::bevy_math::Vec3A> = { { - let output: Val<::bevy_math::Vec3A> = <::bevy_math::Dir3A as ::core::ops::Mul< + let output: ::bevy_math::Vec3A = <::bevy_math::Dir3A as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -2014,11 +1919,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3A>| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = <::bevy_math::Dir3A as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3A = <::bevy_math::Dir3A as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2031,11 +1935,10 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |value: Val<::bevy_math::Vec3A>| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = ::bevy_math::Dir3A::new_unchecked( - value.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir3A = ::bevy_math::Dir3A::new_unchecked( + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -2048,13 +1951,12 @@ pub(crate) fn register_dir_3_a_functions(world: &mut World) { |_self: Val<::bevy_math::Dir3A>, rhs: Val<::bevy_math::Dir3A>, s: f32| { let output: Val<::bevy_math::Dir3A> = { { - let output: Val<::bevy_math::Dir3A> = ::bevy_math::Dir3A::slerp( - _self.into_inner(), - rhs.into_inner(), - s, - ) - .into(); - output + let output: ::bevy_math::Dir3A = ::bevy_math::Dir3A::slerp( + safe_transmute(_self), + safe_transmute(rhs), + safe_transmute(s), + ); + safe_transmute(output) } }; output @@ -2079,11 +1981,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::IRect::as_rect( - &_self, - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::IRect::as_rect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2096,11 +1997,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::IRect::as_urect( - &_self, - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::IRect::as_urect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2114,10 +2014,9 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_math::IRect as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2130,11 +2029,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::IVec2> = { { - let output: Val<::bevy_math::IVec2> = ::bevy_math::IRect::center( - &_self, - ) - .into(); - output + let output: ::bevy_math::IVec2 = ::bevy_math::IRect::center( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2147,11 +2045,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = <::bevy_math::IRect as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::IRect = <::bevy_math::IRect as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2165,11 +2062,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::IRect::contains( - &_self, - point.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -2184,9 +2080,8 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { { let output: bool = <::bevy_math::IRect as ::core::cmp::PartialEq< ::bevy_math::IRect, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -2199,12 +2094,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |origin: Val<::bevy_math::IVec2>, half_size: Val<::bevy_math::IVec2>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::from_center_half_size( + safe_transmute(origin), + safe_transmute(half_size), + ); + safe_transmute(output) } }; output @@ -2217,12 +2111,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |origin: Val<::bevy_math::IVec2>, size: Val<::bevy_math::IVec2>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::from_center_size( + safe_transmute(origin), + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -2235,12 +2128,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |p0: Val<::bevy_math::IVec2>, p1: Val<::bevy_math::IVec2>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::from_corners( + safe_transmute(p0), + safe_transmute(p1), + ); + safe_transmute(output) } }; output @@ -2253,11 +2145,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::IVec2> = { { - let output: Val<::bevy_math::IVec2> = ::bevy_math::IRect::half_size( - &_self, - ) - .into(); - output + let output: ::bevy_math::IVec2 = ::bevy_math::IRect::half_size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2270,8 +2161,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: i32 = { { - let output: i32 = ::bevy_math::IRect::height(&_self).into(); - output + let output: i32 = ::bevy_math::IRect::height( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2284,12 +2177,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>, expansion: i32| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::inflate( - &_self, - expansion, - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::inflate( + safe_transmute(_self), + safe_transmute(expansion), + ); + safe_transmute(output) } }; output @@ -2302,12 +2194,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>, other: Val<::bevy_math::IRect>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::intersect( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2320,8 +2211,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: bool = { { - let output: bool = ::bevy_math::IRect::is_empty(&_self).into(); - output + let output: bool = ::bevy_math::IRect::is_empty( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2334,14 +2227,13 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |x0: i32, y0: i32, x1: i32, y1: i32| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::new( + safe_transmute(x0), + safe_transmute(y0), + safe_transmute(x1), + safe_transmute(y1), + ); + safe_transmute(output) } }; output @@ -2354,11 +2246,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: Val<::bevy_math::IVec2> = { { - let output: Val<::bevy_math::IVec2> = ::bevy_math::IRect::size( - &_self, - ) - .into(); - output + let output: ::bevy_math::IVec2 = ::bevy_math::IRect::size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2371,12 +2262,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>, other: Val<::bevy_math::IRect>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::union( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::union( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2389,12 +2279,11 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>, other: Val<::bevy_math::IVec2>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::IRect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::IRect::union_point( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2407,8 +2296,10 @@ pub(crate) fn register_i_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::IRect>| { let output: i32 = { { - let output: i32 = ::bevy_math::IRect::width(&_self).into(); - output + let output: i32 = ::bevy_math::IRect::width( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2433,11 +2324,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::Rect::as_irect( - &_self, - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::Rect::as_irect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2450,11 +2340,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::Rect::as_urect( - &_self, - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::Rect::as_urect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2467,11 +2356,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Rect::center( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Rect::center( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2484,11 +2372,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = <::bevy_math::Rect as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Rect = <::bevy_math::Rect as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2502,11 +2389,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::Rect::contains( - &_self, - point.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -2521,9 +2407,8 @@ pub(crate) fn register_rect_functions(world: &mut World) { { let output: bool = <::bevy_math::Rect as ::core::cmp::PartialEq< ::bevy_math::Rect, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -2536,12 +2421,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |origin: Val<::bevy_math::Vec2>, half_size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::from_center_half_size( + safe_transmute(origin), + safe_transmute(half_size), + ); + safe_transmute(output) } }; output @@ -2554,12 +2438,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |origin: Val<::bevy_math::Vec2>, size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::from_center_size( + safe_transmute(origin), + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -2572,12 +2455,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |p0: Val<::bevy_math::Vec2>, p1: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::from_corners( + safe_transmute(p0), + safe_transmute(p1), + ); + safe_transmute(output) } }; output @@ -2590,11 +2472,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Rect::half_size( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Rect::half_size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2607,8 +2488,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: f32 = { { - let output: f32 = ::bevy_math::Rect::height(&_self).into(); - output + let output: f32 = ::bevy_math::Rect::height( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2621,12 +2504,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>, expansion: f32| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::inflate( - &_self, - expansion, - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::inflate( + safe_transmute(_self), + safe_transmute(expansion), + ); + safe_transmute(output) } }; output @@ -2639,12 +2521,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>, other: Val<::bevy_math::Rect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::intersect( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2657,8 +2538,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: bool = { { - let output: bool = ::bevy_math::Rect::is_empty(&_self).into(); - output + let output: bool = ::bevy_math::Rect::is_empty( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2671,14 +2554,13 @@ pub(crate) fn register_rect_functions(world: &mut World) { |x0: f32, y0: f32, x1: f32, y1: f32| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::new( + safe_transmute(x0), + safe_transmute(y0), + safe_transmute(x1), + safe_transmute(y1), + ); + safe_transmute(output) } }; output @@ -2691,12 +2573,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>, other: Val<::bevy_math::Rect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::normalize( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::normalize( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2709,11 +2590,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::Rect::size( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::Rect::size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2726,12 +2606,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>, other: Val<::bevy_math::Rect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::union( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::union( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2744,12 +2623,11 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>, other: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::Rect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::Rect::union_point( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -2762,8 +2640,10 @@ pub(crate) fn register_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::Rect>| { let output: f32 = { { - let output: f32 = ::bevy_math::Rect::width(&_self).into(); - output + let output: f32 = ::bevy_math::Rect::width( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2788,11 +2668,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::IRect> = { { - let output: Val<::bevy_math::IRect> = ::bevy_math::URect::as_irect( - &_self, - ) - .into(); - output + let output: ::bevy_math::IRect = ::bevy_math::URect::as_irect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2805,11 +2684,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::Rect> = { { - let output: Val<::bevy_math::Rect> = ::bevy_math::URect::as_rect( - &_self, - ) - .into(); - output + let output: ::bevy_math::Rect = ::bevy_math::URect::as_rect( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2823,10 +2701,9 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_math::URect as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2839,11 +2716,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::UVec2> = { { - let output: Val<::bevy_math::UVec2> = ::bevy_math::URect::center( - &_self, - ) - .into(); - output + let output: ::bevy_math::UVec2 = ::bevy_math::URect::center( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2856,11 +2732,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = <::bevy_math::URect as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::URect = <::bevy_math::URect as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2874,11 +2749,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::URect::contains( - &_self, - point.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -2893,9 +2767,8 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { { let output: bool = <::bevy_math::URect as ::core::cmp::PartialEq< ::bevy_math::URect, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -2908,12 +2781,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |origin: Val<::bevy_math::UVec2>, half_size: Val<::bevy_math::UVec2>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::from_center_half_size( - origin.into_inner(), - half_size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::from_center_half_size( + safe_transmute(origin), + safe_transmute(half_size), + ); + safe_transmute(output) } }; output @@ -2926,12 +2798,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |origin: Val<::bevy_math::UVec2>, size: Val<::bevy_math::UVec2>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::from_center_size( - origin.into_inner(), - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::from_center_size( + safe_transmute(origin), + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -2944,12 +2815,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |p0: Val<::bevy_math::UVec2>, p1: Val<::bevy_math::UVec2>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::from_corners( - p0.into_inner(), - p1.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::from_corners( + safe_transmute(p0), + safe_transmute(p1), + ); + safe_transmute(output) } }; output @@ -2962,11 +2832,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::UVec2> = { { - let output: Val<::bevy_math::UVec2> = ::bevy_math::URect::half_size( - &_self, - ) - .into(); - output + let output: ::bevy_math::UVec2 = ::bevy_math::URect::half_size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2979,8 +2848,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: u32 = { { - let output: u32 = ::bevy_math::URect::height(&_self).into(); - output + let output: u32 = ::bevy_math::URect::height( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2993,12 +2864,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>, expansion: i32| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::inflate( - &_self, - expansion, - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::inflate( + safe_transmute(_self), + safe_transmute(expansion), + ); + safe_transmute(output) } }; output @@ -3011,12 +2881,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>, other: Val<::bevy_math::URect>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::intersect( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::intersect( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -3029,8 +2898,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: bool = { { - let output: bool = ::bevy_math::URect::is_empty(&_self).into(); - output + let output: bool = ::bevy_math::URect::is_empty( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3043,14 +2914,13 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |x0: u32, y0: u32, x1: u32, y1: u32| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::new( - x0, - y0, - x1, - y1, - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::new( + safe_transmute(x0), + safe_transmute(y0), + safe_transmute(x1), + safe_transmute(y1), + ); + safe_transmute(output) } }; output @@ -3063,11 +2933,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: Val<::bevy_math::UVec2> = { { - let output: Val<::bevy_math::UVec2> = ::bevy_math::URect::size( - &_self, - ) - .into(); - output + let output: ::bevy_math::UVec2 = ::bevy_math::URect::size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3080,12 +2949,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>, other: Val<::bevy_math::URect>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::union( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::union( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -3098,12 +2966,11 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>, other: Val<::bevy_math::UVec2>| { let output: Val<::bevy_math::URect> = { { - let output: Val<::bevy_math::URect> = ::bevy_math::URect::union_point( - &_self, - other.into_inner(), - ) - .into(); - output + let output: ::bevy_math::URect = ::bevy_math::URect::union_point( + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -3116,8 +2983,10 @@ pub(crate) fn register_u_rect_functions(world: &mut World) { |_self: Ref<::bevy_math::URect>| { let output: u32 = { { - let output: u32 = ::bevy_math::URect::width(&_self).into(); - output + let output: u32 = ::bevy_math::URect::width( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3154,11 +3023,10 @@ pub(crate) fn register_aabb_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::Aabb2d>| { let output: Val<::bevy_math::bounding::BoundingCircle> = { { - let output: Val<::bevy_math::bounding::BoundingCircle> = ::bevy_math::bounding::Aabb2d::bounding_circle( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircle = ::bevy_math::bounding::Aabb2d::bounding_circle( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3171,11 +3039,10 @@ pub(crate) fn register_aabb_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::Aabb2d>| { let output: Val<::bevy_math::bounding::Aabb2d> = { { - let output: Val<::bevy_math::bounding::Aabb2d> = <::bevy_math::bounding::Aabb2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::Aabb2d = <::bevy_math::bounding::Aabb2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3188,12 +3055,11 @@ pub(crate) fn register_aabb_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::Aabb2d>, point: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::bounding::Aabb2d::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::bounding::Aabb2d::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -3211,9 +3077,8 @@ pub(crate) fn register_aabb_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::bounding::Aabb2d as ::core::cmp::PartialEq< ::bevy_math::bounding::Aabb2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3226,12 +3091,11 @@ pub(crate) fn register_aabb_2_d_functions(world: &mut World) { |center: Val<::bevy_math::Vec2>, half_size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::bounding::Aabb2d> = { { - let output: Val<::bevy_math::bounding::Aabb2d> = ::bevy_math::bounding::Aabb2d::new( - center.into_inner(), - half_size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::bounding::Aabb2d = ::bevy_math::bounding::Aabb2d::new( + safe_transmute(center), + safe_transmute(half_size), + ); + safe_transmute(output) } }; output @@ -3256,11 +3120,10 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingCircle>| { let output: Val<::bevy_math::bounding::Aabb2d> = { { - let output: Val<::bevy_math::bounding::Aabb2d> = ::bevy_math::bounding::BoundingCircle::aabb_2d( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::Aabb2d = ::bevy_math::bounding::BoundingCircle::aabb_2d( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3273,11 +3136,10 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingCircle>| { let output: Val<::bevy_math::bounding::BoundingCircle> = { { - let output: Val<::bevy_math::bounding::BoundingCircle> = <::bevy_math::bounding::BoundingCircle as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircle = <::bevy_math::bounding::BoundingCircle as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3293,12 +3155,11 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::bounding::BoundingCircle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::bounding::BoundingCircle::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -3316,9 +3177,8 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { { let output: bool = <::bevy_math::bounding::BoundingCircle as ::core::cmp::PartialEq< ::bevy_math::bounding::BoundingCircle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3331,12 +3191,11 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { |center: Val<::bevy_math::Vec2>, radius: f32| { let output: Val<::bevy_math::bounding::BoundingCircle> = { { - let output: Val<::bevy_math::bounding::BoundingCircle> = ::bevy_math::bounding::BoundingCircle::new( - center.into_inner(), - radius, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircle = ::bevy_math::bounding::BoundingCircle::new( + safe_transmute(center), + safe_transmute(radius), + ); + safe_transmute(output) } }; output @@ -3350,10 +3209,9 @@ pub(crate) fn register_bounding_circle_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::bounding::BoundingCircle::radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3378,11 +3236,10 @@ pub(crate) fn register_circle_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Circle>| { let output: Val<::bevy_math::primitives::Circle> = { { - let output: Val<::bevy_math::primitives::Circle> = <::bevy_math::primitives::Circle as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Circle = <::bevy_math::primitives::Circle as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3395,12 +3252,11 @@ pub(crate) fn register_circle_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Circle>, point: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Circle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Circle::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -3414,10 +3270,9 @@ pub(crate) fn register_circle_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Circle::diameter( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3435,9 +3290,8 @@ pub(crate) fn register_circle_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Circle as ::core::cmp::PartialEq< ::bevy_math::primitives::Circle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3450,11 +3304,10 @@ pub(crate) fn register_circle_functions(world: &mut World) { |radius: f32| { let output: Val<::bevy_math::primitives::Circle> = { { - let output: Val<::bevy_math::primitives::Circle> = ::bevy_math::primitives::Circle::new( - radius, - ) - .into(); - output + let output: ::bevy_math::primitives::Circle = ::bevy_math::primitives::Circle::new( + safe_transmute(radius), + ); + safe_transmute(output) } }; output @@ -3479,11 +3332,10 @@ pub(crate) fn register_annulus_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Annulus>| { let output: Val<::bevy_math::primitives::Annulus> = { { - let output: Val<::bevy_math::primitives::Annulus> = <::bevy_math::primitives::Annulus as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Annulus = <::bevy_math::primitives::Annulus as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3499,12 +3351,11 @@ pub(crate) fn register_annulus_functions(world: &mut World) { { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Annulus::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Annulus::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -3518,10 +3369,9 @@ pub(crate) fn register_annulus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Annulus::diameter( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3539,9 +3389,8 @@ pub(crate) fn register_annulus_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Annulus as ::core::cmp::PartialEq< ::bevy_math::primitives::Annulus, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3554,12 +3403,11 @@ pub(crate) fn register_annulus_functions(world: &mut World) { |inner_radius: f32, outer_radius: f32| { let output: Val<::bevy_math::primitives::Annulus> = { { - let output: Val<::bevy_math::primitives::Annulus> = ::bevy_math::primitives::Annulus::new( - inner_radius, - outer_radius, - ) - .into(); - output + let output: ::bevy_math::primitives::Annulus = ::bevy_math::primitives::Annulus::new( + safe_transmute(inner_radius), + safe_transmute(outer_radius), + ); + safe_transmute(output) } }; output @@ -3573,10 +3421,9 @@ pub(crate) fn register_annulus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Annulus::thickness( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3601,9 +3448,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: f32 = { { - let output: f32 = ::bevy_math::primitives::Arc2d::angle(&_self) - .into(); - output + let output: f32 = ::bevy_math::primitives::Arc2d::angle( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3616,9 +3464,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: f32 = { { - let output: f32 = ::bevy_math::primitives::Arc2d::apothem(&_self) - .into(); - output + let output: f32 = ::bevy_math::primitives::Arc2d::apothem( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3632,10 +3481,9 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Arc2d::chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3648,11 +3496,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Arc2d::chord_midpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Arc2d::chord_midpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3665,11 +3512,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: Val<::bevy_math::primitives::Arc2d> = { { - let output: Val<::bevy_math::primitives::Arc2d> = <::bevy_math::primitives::Arc2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Arc2d = <::bevy_math::primitives::Arc2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3687,9 +3533,8 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Arc2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Arc2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3702,12 +3547,11 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::Arc2d> = { { - let output: Val<::bevy_math::primitives::Arc2d> = ::bevy_math::primitives::Arc2d::from_degrees( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::Arc2d = ::bevy_math::primitives::Arc2d::from_degrees( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -3720,12 +3564,11 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::Arc2d> = { { - let output: Val<::bevy_math::primitives::Arc2d> = ::bevy_math::primitives::Arc2d::from_radians( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::Arc2d = ::bevy_math::primitives::Arc2d::from_radians( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -3738,12 +3581,11 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |radius: f32, fraction: f32| { let output: Val<::bevy_math::primitives::Arc2d> = { { - let output: Val<::bevy_math::primitives::Arc2d> = ::bevy_math::primitives::Arc2d::from_turns( - radius, - fraction, - ) - .into(); - output + let output: ::bevy_math::primitives::Arc2d = ::bevy_math::primitives::Arc2d::from_turns( + safe_transmute(radius), + safe_transmute(fraction), + ); + safe_transmute(output) } }; output @@ -3757,10 +3599,9 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Arc2d::half_chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3774,10 +3615,9 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Arc2d::is_major( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3791,10 +3631,9 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Arc2d::is_minor( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3807,11 +3646,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Arc2d::left_endpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Arc2d::left_endpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3824,9 +3662,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: f32 = { { - let output: f32 = ::bevy_math::primitives::Arc2d::length(&_self) - .into(); - output + let output: f32 = ::bevy_math::primitives::Arc2d::length( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3839,11 +3678,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Arc2d::midpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Arc2d::midpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3856,12 +3694,11 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |radius: f32, half_angle: f32| { let output: Val<::bevy_math::primitives::Arc2d> = { { - let output: Val<::bevy_math::primitives::Arc2d> = ::bevy_math::primitives::Arc2d::new( - radius, - half_angle, - ) - .into(); - output + let output: ::bevy_math::primitives::Arc2d = ::bevy_math::primitives::Arc2d::new( + safe_transmute(radius), + safe_transmute(half_angle), + ); + safe_transmute(output) } }; output @@ -3874,11 +3711,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Arc2d::right_endpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Arc2d::right_endpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3891,9 +3727,10 @@ pub(crate) fn register_arc_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Arc2d>| { let output: f32 = { { - let output: f32 = ::bevy_math::primitives::Arc2d::sagitta(&_self) - .into(); - output + let output: f32 = ::bevy_math::primitives::Arc2d::sagitta( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3918,11 +3755,10 @@ pub(crate) fn register_capsule_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Capsule2d>| { let output: Val<::bevy_math::primitives::Capsule2d> = { { - let output: Val<::bevy_math::primitives::Capsule2d> = <::bevy_math::primitives::Capsule2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Capsule2d = <::bevy_math::primitives::Capsule2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -3940,9 +3776,8 @@ pub(crate) fn register_capsule_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Capsule2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Capsule2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -3955,12 +3790,11 @@ pub(crate) fn register_capsule_2_d_functions(world: &mut World) { |radius: f32, length: f32| { let output: Val<::bevy_math::primitives::Capsule2d> = { { - let output: Val<::bevy_math::primitives::Capsule2d> = ::bevy_math::primitives::Capsule2d::new( - radius, - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Capsule2d = ::bevy_math::primitives::Capsule2d::new( + safe_transmute(radius), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -3973,11 +3807,10 @@ pub(crate) fn register_capsule_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Capsule2d>| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = ::bevy_math::primitives::Capsule2d::to_inner_rectangle( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = ::bevy_math::primitives::Capsule2d::to_inner_rectangle( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4003,10 +3836,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::angle( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4020,10 +3852,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::apothem( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4037,10 +3868,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::arc_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4054,10 +3884,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4070,11 +3899,10 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::CircularSector>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::CircularSector::chord_midpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::CircularSector::chord_midpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4087,11 +3915,10 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::CircularSector>| { let output: Val<::bevy_math::primitives::CircularSector> = { { - let output: Val<::bevy_math::primitives::CircularSector> = <::bevy_math::primitives::CircularSector as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSector = <::bevy_math::primitives::CircularSector as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4109,9 +3936,8 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::CircularSector as ::core::cmp::PartialEq< ::bevy_math::primitives::CircularSector, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4124,12 +3950,11 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSector> = { { - let output: Val<::bevy_math::primitives::CircularSector> = ::bevy_math::primitives::CircularSector::from_degrees( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSector = ::bevy_math::primitives::CircularSector::from_degrees( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4142,12 +3967,11 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSector> = { { - let output: Val<::bevy_math::primitives::CircularSector> = ::bevy_math::primitives::CircularSector::from_radians( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSector = ::bevy_math::primitives::CircularSector::from_radians( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4160,12 +3984,11 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |radius: f32, fraction: f32| { let output: Val<::bevy_math::primitives::CircularSector> = { { - let output: Val<::bevy_math::primitives::CircularSector> = ::bevy_math::primitives::CircularSector::from_turns( - radius, - fraction, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSector = ::bevy_math::primitives::CircularSector::from_turns( + safe_transmute(radius), + safe_transmute(fraction), + ); + safe_transmute(output) } }; output @@ -4179,10 +4002,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::half_angle( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4196,10 +4018,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::half_chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4212,12 +4033,11 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSector> = { { - let output: Val<::bevy_math::primitives::CircularSector> = ::bevy_math::primitives::CircularSector::new( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSector = ::bevy_math::primitives::CircularSector::new( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4231,10 +4051,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4248,10 +4067,9 @@ pub(crate) fn register_circular_sector_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSector::sagitta( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4277,10 +4095,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::angle( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4294,10 +4111,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::apothem( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4311,10 +4127,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::arc_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4328,10 +4143,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4344,11 +4158,10 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::CircularSegment>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::CircularSegment::chord_midpoint( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::CircularSegment::chord_midpoint( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4361,11 +4174,10 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::CircularSegment>| { let output: Val<::bevy_math::primitives::CircularSegment> = { { - let output: Val<::bevy_math::primitives::CircularSegment> = <::bevy_math::primitives::CircularSegment as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSegment = <::bevy_math::primitives::CircularSegment as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4383,9 +4195,8 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::CircularSegment as ::core::cmp::PartialEq< ::bevy_math::primitives::CircularSegment, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4398,12 +4209,11 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSegment> = { { - let output: Val<::bevy_math::primitives::CircularSegment> = ::bevy_math::primitives::CircularSegment::from_degrees( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSegment = ::bevy_math::primitives::CircularSegment::from_degrees( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4416,12 +4226,11 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSegment> = { { - let output: Val<::bevy_math::primitives::CircularSegment> = ::bevy_math::primitives::CircularSegment::from_radians( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSegment = ::bevy_math::primitives::CircularSegment::from_radians( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4434,12 +4243,11 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |radius: f32, fraction: f32| { let output: Val<::bevy_math::primitives::CircularSegment> = { { - let output: Val<::bevy_math::primitives::CircularSegment> = ::bevy_math::primitives::CircularSegment::from_turns( - radius, - fraction, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSegment = ::bevy_math::primitives::CircularSegment::from_turns( + safe_transmute(radius), + safe_transmute(fraction), + ); + safe_transmute(output) } }; output @@ -4453,10 +4261,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::half_angle( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4470,10 +4277,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::half_chord_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4486,12 +4292,11 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { |radius: f32, angle: f32| { let output: Val<::bevy_math::primitives::CircularSegment> = { { - let output: Val<::bevy_math::primitives::CircularSegment> = ::bevy_math::primitives::CircularSegment::new( - radius, - angle, - ) - .into(); - output + let output: ::bevy_math::primitives::CircularSegment = ::bevy_math::primitives::CircularSegment::new( + safe_transmute(radius), + safe_transmute(angle), + ); + safe_transmute(output) } }; output @@ -4505,10 +4310,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4522,10 +4326,9 @@ pub(crate) fn register_circular_segment_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::CircularSegment::sagitta( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4550,11 +4353,10 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Ellipse>| { let output: Val<::bevy_math::primitives::Ellipse> = { { - let output: Val<::bevy_math::primitives::Ellipse> = <::bevy_math::primitives::Ellipse as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Ellipse = <::bevy_math::primitives::Ellipse as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4568,10 +4370,9 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Ellipse::eccentricity( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4589,9 +4390,8 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Ellipse as ::core::cmp::PartialEq< ::bevy_math::primitives::Ellipse, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4605,10 +4405,9 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Ellipse::focal_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4621,11 +4420,10 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { |size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Ellipse> = { { - let output: Val<::bevy_math::primitives::Ellipse> = ::bevy_math::primitives::Ellipse::from_size( - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Ellipse = ::bevy_math::primitives::Ellipse::from_size( + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -4638,12 +4436,11 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { |half_width: f32, half_height: f32| { let output: Val<::bevy_math::primitives::Ellipse> = { { - let output: Val<::bevy_math::primitives::Ellipse> = ::bevy_math::primitives::Ellipse::new( - half_width, - half_height, - ) - .into(); - output + let output: ::bevy_math::primitives::Ellipse = ::bevy_math::primitives::Ellipse::new( + safe_transmute(half_width), + safe_transmute(half_height), + ); + safe_transmute(output) } }; output @@ -4657,10 +4454,9 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Ellipse::semi_major( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4674,10 +4470,9 @@ pub(crate) fn register_ellipse_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Ellipse::semi_minor( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4702,11 +4497,10 @@ pub(crate) fn register_line_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Line2d>| { let output: Val<::bevy_math::primitives::Line2d> = { { - let output: Val<::bevy_math::primitives::Line2d> = <::bevy_math::primitives::Line2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Line2d = <::bevy_math::primitives::Line2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4724,9 +4518,8 @@ pub(crate) fn register_line_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Line2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Line2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4751,11 +4544,10 @@ pub(crate) fn register_plane_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Plane2d>| { let output: Val<::bevy_math::primitives::Plane2d> = { { - let output: Val<::bevy_math::primitives::Plane2d> = <::bevy_math::primitives::Plane2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Plane2d = <::bevy_math::primitives::Plane2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4773,9 +4565,8 @@ pub(crate) fn register_plane_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Plane2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Plane2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4788,11 +4579,10 @@ pub(crate) fn register_plane_2_d_functions(world: &mut World) { |normal: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Plane2d> = { { - let output: Val<::bevy_math::primitives::Plane2d> = ::bevy_math::primitives::Plane2d::new( - normal.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Plane2d = ::bevy_math::primitives::Plane2d::new( + safe_transmute(normal), + ); + safe_transmute(output) } }; output @@ -4817,11 +4607,10 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Rectangle>| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = <::bevy_math::primitives::Rectangle as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = <::bevy_math::primitives::Rectangle as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4837,12 +4626,11 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Rectangle::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Rectangle::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -4860,9 +4648,8 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Rectangle as ::core::cmp::PartialEq< ::bevy_math::primitives::Rectangle, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -4875,12 +4662,11 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |point1: Val<::bevy_math::Vec2>, point2: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = ::bevy_math::primitives::Rectangle::from_corners( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = ::bevy_math::primitives::Rectangle::from_corners( + safe_transmute(point1), + safe_transmute(point2), + ); + safe_transmute(output) } }; output @@ -4893,11 +4679,10 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |length: f32| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = ::bevy_math::primitives::Rectangle::from_length( - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = ::bevy_math::primitives::Rectangle::from_length( + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -4910,11 +4695,10 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = ::bevy_math::primitives::Rectangle::from_size( - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = ::bevy_math::primitives::Rectangle::from_size( + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -4927,12 +4711,11 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |width: f32, height: f32| { let output: Val<::bevy_math::primitives::Rectangle> = { { - let output: Val<::bevy_math::primitives::Rectangle> = ::bevy_math::primitives::Rectangle::new( - width, - height, - ) - .into(); - output + let output: ::bevy_math::primitives::Rectangle = ::bevy_math::primitives::Rectangle::new( + safe_transmute(width), + safe_transmute(height), + ); + safe_transmute(output) } }; output @@ -4945,11 +4728,10 @@ pub(crate) fn register_rectangle_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Rectangle>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Rectangle::size( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Rectangle::size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4975,10 +4757,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::circumradius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -4991,11 +4772,10 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::RegularPolygon>| { let output: Val<::bevy_math::primitives::RegularPolygon> = { { - let output: Val<::bevy_math::primitives::RegularPolygon> = <::bevy_math::primitives::RegularPolygon as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::RegularPolygon = <::bevy_math::primitives::RegularPolygon as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5013,9 +4793,8 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::RegularPolygon as ::core::cmp::PartialEq< ::bevy_math::primitives::RegularPolygon, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -5029,10 +4808,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::external_angle_degrees( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5046,10 +4824,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::external_angle_radians( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5063,10 +4840,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::inradius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5080,10 +4856,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::internal_angle_degrees( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5097,10 +4872,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::internal_angle_radians( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5113,12 +4887,11 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { |circumradius: f32, sides: u32| { let output: Val<::bevy_math::primitives::RegularPolygon> = { { - let output: Val<::bevy_math::primitives::RegularPolygon> = ::bevy_math::primitives::RegularPolygon::new( - circumradius, - sides, - ) - .into(); - output + let output: ::bevy_math::primitives::RegularPolygon = ::bevy_math::primitives::RegularPolygon::new( + safe_transmute(circumradius), + safe_transmute(sides), + ); + safe_transmute(output) } }; output @@ -5132,10 +4905,9 @@ pub(crate) fn register_regular_polygon_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::RegularPolygon::side_length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5161,10 +4933,9 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Rhombus::circumradius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5177,11 +4948,10 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Rhombus>| { let output: Val<::bevy_math::primitives::Rhombus> = { { - let output: Val<::bevy_math::primitives::Rhombus> = <::bevy_math::primitives::Rhombus as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Rhombus = <::bevy_math::primitives::Rhombus as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5197,12 +4967,11 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Rhombus::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Rhombus::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -5220,9 +4989,8 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Rhombus as ::core::cmp::PartialEq< ::bevy_math::primitives::Rhombus, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -5235,11 +5003,10 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { |inradius: f32| { let output: Val<::bevy_math::primitives::Rhombus> = { { - let output: Val<::bevy_math::primitives::Rhombus> = ::bevy_math::primitives::Rhombus::from_inradius( - inradius, - ) - .into(); - output + let output: ::bevy_math::primitives::Rhombus = ::bevy_math::primitives::Rhombus::from_inradius( + safe_transmute(inradius), + ); + safe_transmute(output) } }; output @@ -5252,11 +5019,10 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { |side: f32| { let output: Val<::bevy_math::primitives::Rhombus> = { { - let output: Val<::bevy_math::primitives::Rhombus> = ::bevy_math::primitives::Rhombus::from_side( - side, - ) - .into(); - output + let output: ::bevy_math::primitives::Rhombus = ::bevy_math::primitives::Rhombus::from_side( + safe_transmute(side), + ); + safe_transmute(output) } }; output @@ -5270,10 +5036,9 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Rhombus::inradius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5286,12 +5051,11 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { |horizontal_diagonal: f32, vertical_diagonal: f32| { let output: Val<::bevy_math::primitives::Rhombus> = { { - let output: Val<::bevy_math::primitives::Rhombus> = ::bevy_math::primitives::Rhombus::new( - horizontal_diagonal, - vertical_diagonal, - ) - .into(); - output + let output: ::bevy_math::primitives::Rhombus = ::bevy_math::primitives::Rhombus::new( + safe_transmute(horizontal_diagonal), + safe_transmute(vertical_diagonal), + ); + safe_transmute(output) } }; output @@ -5304,9 +5068,10 @@ pub(crate) fn register_rhombus_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Rhombus>| { let output: f32 = { { - let output: f32 = ::bevy_math::primitives::Rhombus::side(&_self) - .into(); - output + let output: f32 = ::bevy_math::primitives::Rhombus::side( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5331,11 +5096,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::center( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::center( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5348,11 +5112,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::centered( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::centered( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5365,11 +5128,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = <::bevy_math::primitives::Segment2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = <::bevy_math::primitives::Segment2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5385,12 +5147,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -5403,11 +5164,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::primitives::Segment2d::direction( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::primitives::Segment2d::direction( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5425,9 +5185,8 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Segment2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Segment2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -5440,12 +5199,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |direction: Val<::bevy_math::Dir2>, length: f32| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::from_direction_and_length( - direction.into_inner(), - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::from_direction_and_length( + safe_transmute(direction), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -5458,12 +5216,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |ray: Val<::bevy_math::Ray2d>, length: f32| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::from_ray_and_length( - ray.into_inner(), - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::from_ray_and_length( + safe_transmute(ray), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -5476,11 +5233,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |scaled_direction: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::from_scaled_direction( - scaled_direction.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::from_scaled_direction( + safe_transmute(scaled_direction), + ); + safe_transmute(output) } }; output @@ -5493,11 +5249,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::primitives::Segment2d::left_normal( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::primitives::Segment2d::left_normal( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5511,10 +5266,9 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Segment2d::length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5528,10 +5282,9 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Segment2d::length_squared( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5544,12 +5297,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |point1: Val<::bevy_math::Vec2>, point2: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::new( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::new( + safe_transmute(point1), + safe_transmute(point2), + ); + safe_transmute(output) } }; output @@ -5562,11 +5314,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::point1( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::point1( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5579,11 +5330,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::point2( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::point2( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5596,12 +5346,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>, length: f32| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::resized( - &_self, - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::resized( + safe_transmute(_self), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -5615,10 +5364,9 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_math::primitives::Segment2d::reverse( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5631,11 +5379,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Val<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::reversed( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::reversed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5648,11 +5395,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Dir2> = { { - let output: Val<::bevy_math::Dir2> = ::bevy_math::primitives::Segment2d::right_normal( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir2 = ::bevy_math::primitives::Segment2d::right_normal( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5668,12 +5414,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::rotated( - &_self, - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::rotated( + safe_transmute(_self), + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -5690,13 +5435,12 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::rotated_around( - &_self, - rotation.into_inner(), - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::rotated_around( + safe_transmute(_self), + safe_transmute(rotation), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -5712,12 +5456,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::rotated_around_center( - &_self, - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::rotated_around_center( + safe_transmute(_self), + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -5730,11 +5473,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::scaled_direction( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::scaled_direction( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5747,11 +5489,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::scaled_left_normal( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::scaled_left_normal( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5764,11 +5505,10 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::primitives::Segment2d::scaled_right_normal( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::primitives::Segment2d::scaled_right_normal( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5784,12 +5524,11 @@ pub(crate) fn register_segment_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment2d> = { { - let output: Val<::bevy_math::primitives::Segment2d> = ::bevy_math::primitives::Segment2d::translated( - &_self, - translation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment2d = ::bevy_math::primitives::Segment2d::translated( + safe_transmute(_self), + safe_transmute(translation), + ); + safe_transmute(output) } }; output @@ -5814,11 +5553,10 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Triangle2d>| { let output: Val<::bevy_math::primitives::Triangle2d> = { { - let output: Val<::bevy_math::primitives::Triangle2d> = <::bevy_math::primitives::Triangle2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle2d = <::bevy_math::primitives::Triangle2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5836,9 +5574,8 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Triangle2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Triangle2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -5852,10 +5589,9 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle2d::is_acute( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5869,10 +5605,9 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle2d::is_degenerate( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5886,10 +5621,9 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle2d::is_obtuse( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5906,13 +5640,12 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Triangle2d> = { { - let output: Val<::bevy_math::primitives::Triangle2d> = ::bevy_math::primitives::Triangle2d::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle2d = ::bevy_math::primitives::Triangle2d::new( + safe_transmute(a), + safe_transmute(b), + safe_transmute(c), + ); + safe_transmute(output) } }; output @@ -5926,10 +5659,9 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_math::primitives::Triangle2d::reverse( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5942,11 +5674,10 @@ pub(crate) fn register_triangle_2_d_functions(world: &mut World) { |_self: Val<::bevy_math::primitives::Triangle2d>| { let output: Val<::bevy_math::primitives::Triangle2d> = { { - let output: Val<::bevy_math::primitives::Triangle2d> = ::bevy_math::primitives::Triangle2d::reversed( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle2d = ::bevy_math::primitives::Triangle2d::reversed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5971,11 +5702,10 @@ pub(crate) fn register_convex_polygon_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::ConvexPolygon>| { let output: Val<::bevy_math::primitives::ConvexPolygon> = { { - let output: Val<::bevy_math::primitives::ConvexPolygon> = <::bevy_math::primitives::ConvexPolygon as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::ConvexPolygon = <::bevy_math::primitives::ConvexPolygon as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -5993,9 +5723,8 @@ pub(crate) fn register_convex_polygon_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::ConvexPolygon as ::core::cmp::PartialEq< ::bevy_math::primitives::ConvexPolygon, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6020,11 +5749,10 @@ pub(crate) fn register_polygon_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Polygon>| { let output: Val<::bevy_math::primitives::Polygon> = { { - let output: Val<::bevy_math::primitives::Polygon> = <::bevy_math::primitives::Polygon as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Polygon = <::bevy_math::primitives::Polygon as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6042,9 +5770,8 @@ pub(crate) fn register_polygon_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Polygon as ::core::cmp::PartialEq< ::bevy_math::primitives::Polygon, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6058,10 +5785,9 @@ pub(crate) fn register_polygon_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Polygon::is_simple( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6086,11 +5812,10 @@ pub(crate) fn register_polyline_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Polyline2d>| { let output: Val<::bevy_math::primitives::Polyline2d> = { { - let output: Val<::bevy_math::primitives::Polyline2d> = <::bevy_math::primitives::Polyline2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Polyline2d = <::bevy_math::primitives::Polyline2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6108,9 +5833,8 @@ pub(crate) fn register_polyline_2_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Polyline2d as ::core::cmp::PartialEq< ::bevy_math::primitives::Polyline2d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6127,13 +5851,12 @@ pub(crate) fn register_polyline_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Polyline2d> = { { - let output: Val<::bevy_math::primitives::Polyline2d> = ::bevy_math::primitives::Polyline2d::with_subdivisions( - start.into_inner(), - end.into_inner(), - subdivisions, - ) - .into(); - output + let output: ::bevy_math::primitives::Polyline2d = ::bevy_math::primitives::Polyline2d::with_subdivisions( + safe_transmute(start), + safe_transmute(end), + safe_transmute(subdivisions), + ); + safe_transmute(output) } }; output @@ -6158,11 +5881,10 @@ pub(crate) fn register_aabb_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::Aabb3d>| { let output: Val<::bevy_math::bounding::BoundingSphere> = { { - let output: Val<::bevy_math::bounding::BoundingSphere> = ::bevy_math::bounding::Aabb3d::bounding_sphere( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingSphere = ::bevy_math::bounding::Aabb3d::bounding_sphere( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6175,11 +5897,10 @@ pub(crate) fn register_aabb_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::Aabb3d>| { let output: Val<::bevy_math::bounding::Aabb3d> = { { - let output: Val<::bevy_math::bounding::Aabb3d> = <::bevy_math::bounding::Aabb3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::Aabb3d = <::bevy_math::bounding::Aabb3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6197,9 +5918,8 @@ pub(crate) fn register_aabb_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::bounding::Aabb3d as ::core::cmp::PartialEq< ::bevy_math::bounding::Aabb3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6224,11 +5944,10 @@ pub(crate) fn register_bounding_sphere_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingSphere>| { let output: Val<::bevy_math::bounding::Aabb3d> = { { - let output: Val<::bevy_math::bounding::Aabb3d> = ::bevy_math::bounding::BoundingSphere::aabb_3d( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::Aabb3d = ::bevy_math::bounding::BoundingSphere::aabb_3d( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6241,11 +5960,10 @@ pub(crate) fn register_bounding_sphere_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingSphere>| { let output: Val<::bevy_math::bounding::BoundingSphere> = { { - let output: Val<::bevy_math::bounding::BoundingSphere> = <::bevy_math::bounding::BoundingSphere as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingSphere = <::bevy_math::bounding::BoundingSphere as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6263,9 +5981,8 @@ pub(crate) fn register_bounding_sphere_functions(world: &mut World) { { let output: bool = <::bevy_math::bounding::BoundingSphere as ::core::cmp::PartialEq< ::bevy_math::bounding::BoundingSphere, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6279,10 +5996,9 @@ pub(crate) fn register_bounding_sphere_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::bounding::BoundingSphere::radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6307,11 +6023,10 @@ pub(crate) fn register_sphere_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Sphere>| { let output: Val<::bevy_math::primitives::Sphere> = { { - let output: Val<::bevy_math::primitives::Sphere> = <::bevy_math::primitives::Sphere as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Sphere = <::bevy_math::primitives::Sphere as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6324,12 +6039,11 @@ pub(crate) fn register_sphere_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Sphere>, point: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Sphere::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Sphere::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -6343,10 +6057,9 @@ pub(crate) fn register_sphere_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Sphere::diameter( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6364,9 +6077,8 @@ pub(crate) fn register_sphere_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Sphere as ::core::cmp::PartialEq< ::bevy_math::primitives::Sphere, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6379,11 +6091,10 @@ pub(crate) fn register_sphere_functions(world: &mut World) { |radius: f32| { let output: Val<::bevy_math::primitives::Sphere> = { { - let output: Val<::bevy_math::primitives::Sphere> = ::bevy_math::primitives::Sphere::new( - radius, - ) - .into(); - output + let output: ::bevy_math::primitives::Sphere = ::bevy_math::primitives::Sphere::new( + safe_transmute(radius), + ); + safe_transmute(output) } }; output @@ -6408,11 +6119,10 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cuboid>| { let output: Val<::bevy_math::primitives::Cuboid> = { { - let output: Val<::bevy_math::primitives::Cuboid> = <::bevy_math::primitives::Cuboid as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Cuboid = <::bevy_math::primitives::Cuboid as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6425,12 +6135,11 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cuboid>, point: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Cuboid::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Cuboid::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -6448,9 +6157,8 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Cuboid as ::core::cmp::PartialEq< ::bevy_math::primitives::Cuboid, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6463,12 +6171,11 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |point1: Val<::bevy_math::Vec3>, point2: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::primitives::Cuboid> = { { - let output: Val<::bevy_math::primitives::Cuboid> = ::bevy_math::primitives::Cuboid::from_corners( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Cuboid = ::bevy_math::primitives::Cuboid::from_corners( + safe_transmute(point1), + safe_transmute(point2), + ); + safe_transmute(output) } }; output @@ -6481,11 +6188,10 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |length: f32| { let output: Val<::bevy_math::primitives::Cuboid> = { { - let output: Val<::bevy_math::primitives::Cuboid> = ::bevy_math::primitives::Cuboid::from_length( - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Cuboid = ::bevy_math::primitives::Cuboid::from_length( + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -6498,11 +6204,10 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |size: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::primitives::Cuboid> = { { - let output: Val<::bevy_math::primitives::Cuboid> = ::bevy_math::primitives::Cuboid::from_size( - size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Cuboid = ::bevy_math::primitives::Cuboid::from_size( + safe_transmute(size), + ); + safe_transmute(output) } }; output @@ -6515,13 +6220,12 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |x_length: f32, y_length: f32, z_length: f32| { let output: Val<::bevy_math::primitives::Cuboid> = { { - let output: Val<::bevy_math::primitives::Cuboid> = ::bevy_math::primitives::Cuboid::new( - x_length, - y_length, - z_length, - ) - .into(); - output + let output: ::bevy_math::primitives::Cuboid = ::bevy_math::primitives::Cuboid::new( + safe_transmute(x_length), + safe_transmute(y_length), + safe_transmute(z_length), + ); + safe_transmute(output) } }; output @@ -6534,11 +6238,10 @@ pub(crate) fn register_cuboid_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cuboid>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Cuboid::size( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Cuboid::size( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6563,11 +6266,10 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cylinder>| { let output: Val<::bevy_math::primitives::Circle> = { { - let output: Val<::bevy_math::primitives::Circle> = ::bevy_math::primitives::Cylinder::base( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Circle = ::bevy_math::primitives::Cylinder::base( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6581,10 +6283,9 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Cylinder::base_area( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6597,11 +6298,10 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cylinder>| { let output: Val<::bevy_math::primitives::Cylinder> = { { - let output: Val<::bevy_math::primitives::Cylinder> = <::bevy_math::primitives::Cylinder as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Cylinder = <::bevy_math::primitives::Cylinder as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6619,9 +6319,8 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Cylinder as ::core::cmp::PartialEq< ::bevy_math::primitives::Cylinder, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6635,10 +6334,9 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Cylinder::lateral_area( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6651,12 +6349,11 @@ pub(crate) fn register_cylinder_functions(world: &mut World) { |radius: f32, height: f32| { let output: Val<::bevy_math::primitives::Cylinder> = { { - let output: Val<::bevy_math::primitives::Cylinder> = ::bevy_math::primitives::Cylinder::new( - radius, - height, - ) - .into(); - output + let output: ::bevy_math::primitives::Cylinder = ::bevy_math::primitives::Cylinder::new( + safe_transmute(radius), + safe_transmute(height), + ); + safe_transmute(output) } }; output @@ -6681,11 +6378,10 @@ pub(crate) fn register_capsule_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Capsule3d>| { let output: Val<::bevy_math::primitives::Capsule3d> = { { - let output: Val<::bevy_math::primitives::Capsule3d> = <::bevy_math::primitives::Capsule3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Capsule3d = <::bevy_math::primitives::Capsule3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6703,9 +6399,8 @@ pub(crate) fn register_capsule_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Capsule3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Capsule3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6718,12 +6413,11 @@ pub(crate) fn register_capsule_3_d_functions(world: &mut World) { |radius: f32, length: f32| { let output: Val<::bevy_math::primitives::Capsule3d> = { { - let output: Val<::bevy_math::primitives::Capsule3d> = ::bevy_math::primitives::Capsule3d::new( - radius, - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Capsule3d = ::bevy_math::primitives::Capsule3d::new( + safe_transmute(radius), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -6736,11 +6430,10 @@ pub(crate) fn register_capsule_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Capsule3d>| { let output: Val<::bevy_math::primitives::Cylinder> = { { - let output: Val<::bevy_math::primitives::Cylinder> = ::bevy_math::primitives::Capsule3d::to_cylinder( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Cylinder = ::bevy_math::primitives::Capsule3d::to_cylinder( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6765,11 +6458,10 @@ pub(crate) fn register_cone_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cone>| { let output: Val<::bevy_math::primitives::Circle> = { { - let output: Val<::bevy_math::primitives::Circle> = ::bevy_math::primitives::Cone::base( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Circle = ::bevy_math::primitives::Cone::base( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6783,10 +6475,9 @@ pub(crate) fn register_cone_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Cone::base_area( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6799,11 +6490,10 @@ pub(crate) fn register_cone_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Cone>| { let output: Val<::bevy_math::primitives::Cone> = { { - let output: Val<::bevy_math::primitives::Cone> = <::bevy_math::primitives::Cone as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Cone = <::bevy_math::primitives::Cone as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6821,9 +6511,8 @@ pub(crate) fn register_cone_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Cone as ::core::cmp::PartialEq< ::bevy_math::primitives::Cone, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6837,10 +6526,9 @@ pub(crate) fn register_cone_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Cone::lateral_area( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6853,12 +6541,11 @@ pub(crate) fn register_cone_functions(world: &mut World) { |radius: f32, height: f32| { let output: Val<::bevy_math::primitives::Cone> = { { - let output: Val<::bevy_math::primitives::Cone> = ::bevy_math::primitives::Cone::new( - radius, - height, - ) - .into(); - output + let output: ::bevy_math::primitives::Cone = ::bevy_math::primitives::Cone::new( + safe_transmute(radius), + safe_transmute(height), + ); + safe_transmute(output) } }; output @@ -6872,10 +6559,9 @@ pub(crate) fn register_cone_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Cone::slant_height( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6900,11 +6586,10 @@ pub(crate) fn register_conical_frustum_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::ConicalFrustum>| { let output: Val<::bevy_math::primitives::ConicalFrustum> = { { - let output: Val<::bevy_math::primitives::ConicalFrustum> = <::bevy_math::primitives::ConicalFrustum as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::ConicalFrustum = <::bevy_math::primitives::ConicalFrustum as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6922,9 +6607,8 @@ pub(crate) fn register_conical_frustum_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::ConicalFrustum as ::core::cmp::PartialEq< ::bevy_math::primitives::ConicalFrustum, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6949,11 +6633,10 @@ pub(crate) fn register_infinite_plane_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::InfinitePlane3d>| { let output: Val<::bevy_math::primitives::InfinitePlane3d> = { { - let output: Val<::bevy_math::primitives::InfinitePlane3d> = <::bevy_math::primitives::InfinitePlane3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::InfinitePlane3d = <::bevy_math::primitives::InfinitePlane3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -6971,9 +6654,8 @@ pub(crate) fn register_infinite_plane_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::InfinitePlane3d as ::core::cmp::PartialEq< ::bevy_math::primitives::InfinitePlane3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -6989,12 +6671,11 @@ pub(crate) fn register_infinite_plane_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::primitives::InfinitePlane3d::isometry_from_xy( - &_self, - origin.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::primitives::InfinitePlane3d::isometry_from_xy( + safe_transmute(_self), + safe_transmute(origin), + ); + safe_transmute(output) } }; output @@ -7010,12 +6691,11 @@ pub(crate) fn register_infinite_plane_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::Isometry3d> = { { - let output: Val<::bevy_math::Isometry3d> = ::bevy_math::primitives::InfinitePlane3d::isometry_into_xy( - &_self, - origin.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Isometry3d = ::bevy_math::primitives::InfinitePlane3d::isometry_into_xy( + safe_transmute(_self), + safe_transmute(origin), + ); + safe_transmute(output) } }; output @@ -7040,11 +6720,10 @@ pub(crate) fn register_line_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Line3d>| { let output: Val<::bevy_math::primitives::Line3d> = { { - let output: Val<::bevy_math::primitives::Line3d> = <::bevy_math::primitives::Line3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Line3d = <::bevy_math::primitives::Line3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7062,9 +6741,8 @@ pub(crate) fn register_line_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Line3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Line3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -7089,11 +6767,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Segment3d::center( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Segment3d::center( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7106,11 +6783,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::centered( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::centered( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7123,11 +6799,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = <::bevy_math::primitives::Segment3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = <::bevy_math::primitives::Segment3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7143,12 +6818,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Segment3d::closest_point( - &_self, - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Segment3d::closest_point( + safe_transmute(_self), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -7161,11 +6835,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::Dir3> = { { - let output: Val<::bevy_math::Dir3> = ::bevy_math::primitives::Segment3d::direction( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir3 = ::bevy_math::primitives::Segment3d::direction( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7183,9 +6856,8 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Segment3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Segment3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -7198,12 +6870,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |direction: Val<::bevy_math::Dir3>, length: f32| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::from_direction_and_length( - direction.into_inner(), - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::from_direction_and_length( + safe_transmute(direction), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -7216,12 +6887,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |ray: Val<::bevy_math::Ray3d>, length: f32| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::from_ray_and_length( - ray.into_inner(), - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::from_ray_and_length( + safe_transmute(ray), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -7234,11 +6904,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |scaled_direction: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::from_scaled_direction( - scaled_direction.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::from_scaled_direction( + safe_transmute(scaled_direction), + ); + safe_transmute(output) } }; output @@ -7252,10 +6921,9 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Segment3d::length( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7269,10 +6937,9 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Segment3d::length_squared( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7285,12 +6952,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |point1: Val<::bevy_math::Vec3>, point2: Val<::bevy_math::Vec3>| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::new( - point1.into_inner(), - point2.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::new( + safe_transmute(point1), + safe_transmute(point2), + ); + safe_transmute(output) } }; output @@ -7303,11 +6969,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Segment3d::point1( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Segment3d::point1( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7320,11 +6985,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Segment3d::point2( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Segment3d::point2( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7337,12 +7001,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>, length: f32| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::resized( - &_self, - length, - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::resized( + safe_transmute(_self), + safe_transmute(length), + ); + safe_transmute(output) } }; output @@ -7356,10 +7019,9 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_math::primitives::Segment3d::reverse( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7372,11 +7034,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::reversed( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::reversed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7392,12 +7053,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::rotated( - &_self, - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::rotated( + safe_transmute(_self), + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -7414,13 +7074,12 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::rotated_around( - &_self, - rotation.into_inner(), - point.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::rotated_around( + safe_transmute(_self), + safe_transmute(rotation), + safe_transmute(point), + ); + safe_transmute(output) } }; output @@ -7436,12 +7095,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::rotated_around_center( - &_self, - rotation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::rotated_around_center( + safe_transmute(_self), + safe_transmute(rotation), + ); + safe_transmute(output) } }; output @@ -7454,11 +7112,10 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Segment3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Segment3d::scaled_direction( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Segment3d::scaled_direction( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7474,12 +7131,11 @@ pub(crate) fn register_segment_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Segment3d> = { { - let output: Val<::bevy_math::primitives::Segment3d> = ::bevy_math::primitives::Segment3d::translated( - &_self, - translation.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Segment3d = ::bevy_math::primitives::Segment3d::translated( + safe_transmute(_self), + safe_transmute(translation), + ); + safe_transmute(output) } }; output @@ -7504,11 +7160,10 @@ pub(crate) fn register_torus_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Torus>| { let output: Val<::bevy_math::primitives::Torus> = { { - let output: Val<::bevy_math::primitives::Torus> = <::bevy_math::primitives::Torus as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Torus = <::bevy_math::primitives::Torus as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7526,9 +7181,8 @@ pub(crate) fn register_torus_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Torus as ::core::cmp::PartialEq< ::bevy_math::primitives::Torus, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -7542,10 +7196,9 @@ pub(crate) fn register_torus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Torus::inner_radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7558,12 +7211,11 @@ pub(crate) fn register_torus_functions(world: &mut World) { |inner_radius: f32, outer_radius: f32| { let output: Val<::bevy_math::primitives::Torus> = { { - let output: Val<::bevy_math::primitives::Torus> = ::bevy_math::primitives::Torus::new( - inner_radius, - outer_radius, - ) - .into(); - output + let output: ::bevy_math::primitives::Torus = ::bevy_math::primitives::Torus::new( + safe_transmute(inner_radius), + safe_transmute(outer_radius), + ); + safe_transmute(output) } }; output @@ -7577,10 +7229,9 @@ pub(crate) fn register_torus_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Torus::outer_radius( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7605,11 +7256,10 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Triangle3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Triangle3d::centroid( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Triangle3d::centroid( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7622,11 +7272,10 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Triangle3d>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Triangle3d::circumcenter( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Triangle3d::circumcenter( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7639,11 +7288,10 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Triangle3d>| { let output: Val<::bevy_math::primitives::Triangle3d> = { { - let output: Val<::bevy_math::primitives::Triangle3d> = <::bevy_math::primitives::Triangle3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle3d = <::bevy_math::primitives::Triangle3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7661,9 +7309,8 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Triangle3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Triangle3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -7677,10 +7324,9 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle3d::is_acute( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7694,10 +7340,9 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle3d::is_degenerate( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7711,10 +7356,9 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::primitives::Triangle3d::is_obtuse( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7731,13 +7375,12 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Triangle3d> = { { - let output: Val<::bevy_math::primitives::Triangle3d> = ::bevy_math::primitives::Triangle3d::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle3d = ::bevy_math::primitives::Triangle3d::new( + safe_transmute(a), + safe_transmute(b), + safe_transmute(c), + ); + safe_transmute(output) } }; output @@ -7751,10 +7394,9 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_math::primitives::Triangle3d::reverse( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7767,11 +7409,10 @@ pub(crate) fn register_triangle_3_d_functions(world: &mut World) { |_self: Val<::bevy_math::primitives::Triangle3d>| { let output: Val<::bevy_math::primitives::Triangle3d> = { { - let output: Val<::bevy_math::primitives::Triangle3d> = ::bevy_math::primitives::Triangle3d::reversed( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Triangle3d = ::bevy_math::primitives::Triangle3d::reversed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7796,11 +7437,10 @@ pub(crate) fn register_polyline_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Polyline3d>| { let output: Val<::bevy_math::primitives::Polyline3d> = { { - let output: Val<::bevy_math::primitives::Polyline3d> = <::bevy_math::primitives::Polyline3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Polyline3d = <::bevy_math::primitives::Polyline3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7818,9 +7458,8 @@ pub(crate) fn register_polyline_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Polyline3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Polyline3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -7837,13 +7476,12 @@ pub(crate) fn register_polyline_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Polyline3d> = { { - let output: Val<::bevy_math::primitives::Polyline3d> = ::bevy_math::primitives::Polyline3d::with_subdivisions( - start.into_inner(), - end.into_inner(), - subdivisions, - ) - .into(); - output + let output: ::bevy_math::primitives::Polyline3d = ::bevy_math::primitives::Polyline3d::with_subdivisions( + safe_transmute(start), + safe_transmute(end), + safe_transmute(subdivisions), + ); + safe_transmute(output) } }; output @@ -7872,11 +7510,10 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::RayCast2d::aabb_intersection_at( - &_self, - &aabb, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(aabb), + ); + safe_transmute(output) } }; output @@ -7893,11 +7530,10 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::RayCast2d::circle_intersection_at( - &_self, - &circle, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(circle), + ); + safe_transmute(output) } }; output @@ -7910,11 +7546,10 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::RayCast2d>| { let output: Val<::bevy_math::bounding::RayCast2d> = { { - let output: Val<::bevy_math::bounding::RayCast2d> = <::bevy_math::bounding::RayCast2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::RayCast2d = <::bevy_math::bounding::RayCast2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7927,11 +7562,10 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::RayCast2d>| { let output: Val<::bevy_math::Vec2> = { { - let output: Val<::bevy_math::Vec2> = ::bevy_math::bounding::RayCast2d::direction_recip( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec2 = ::bevy_math::bounding::RayCast2d::direction_recip( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -7944,12 +7578,11 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { |ray: Val<::bevy_math::Ray2d>, max: f32| { let output: Val<::bevy_math::bounding::RayCast2d> = { { - let output: Val<::bevy_math::bounding::RayCast2d> = ::bevy_math::bounding::RayCast2d::from_ray( - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::RayCast2d = ::bevy_math::bounding::RayCast2d::from_ray( + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -7966,13 +7599,12 @@ pub(crate) fn register_ray_cast_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::RayCast2d> = { { - let output: Val<::bevy_math::bounding::RayCast2d> = ::bevy_math::bounding::RayCast2d::new( - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::RayCast2d = ::bevy_math::bounding::RayCast2d::new( + safe_transmute(origin), + safe_transmute(direction), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8001,11 +7633,10 @@ pub(crate) fn register_aabb_cast_2_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::AabbCast2d::aabb_collision_at( - &_self, - aabb.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(aabb), + ); + safe_transmute(output) } }; output @@ -8018,11 +7649,10 @@ pub(crate) fn register_aabb_cast_2_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::AabbCast2d>| { let output: Val<::bevy_math::bounding::AabbCast2d> = { { - let output: Val<::bevy_math::bounding::AabbCast2d> = <::bevy_math::bounding::AabbCast2d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::AabbCast2d = <::bevy_math::bounding::AabbCast2d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8039,13 +7669,12 @@ pub(crate) fn register_aabb_cast_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::AabbCast2d> = { { - let output: Val<::bevy_math::bounding::AabbCast2d> = ::bevy_math::bounding::AabbCast2d::from_ray( - aabb.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::AabbCast2d = ::bevy_math::bounding::AabbCast2d::from_ray( + safe_transmute(aabb), + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8063,14 +7692,13 @@ pub(crate) fn register_aabb_cast_2_d_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::AabbCast2d> = { { - let output: Val<::bevy_math::bounding::AabbCast2d> = ::bevy_math::bounding::AabbCast2d::new( - aabb.into_inner(), - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::AabbCast2d = ::bevy_math::bounding::AabbCast2d::new( + safe_transmute(aabb), + safe_transmute(origin), + safe_transmute(direction), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8099,11 +7727,10 @@ pub(crate) fn register_bounding_circle_cast_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::BoundingCircleCast::circle_collision_at( - &_self, - circle.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(circle), + ); + safe_transmute(output) } }; output @@ -8116,11 +7743,10 @@ pub(crate) fn register_bounding_circle_cast_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingCircleCast>| { let output: Val<::bevy_math::bounding::BoundingCircleCast> = { { - let output: Val<::bevy_math::bounding::BoundingCircleCast> = <::bevy_math::bounding::BoundingCircleCast as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircleCast = <::bevy_math::bounding::BoundingCircleCast as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8137,13 +7763,12 @@ pub(crate) fn register_bounding_circle_cast_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::BoundingCircleCast> = { { - let output: Val<::bevy_math::bounding::BoundingCircleCast> = ::bevy_math::bounding::BoundingCircleCast::from_ray( - circle.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircleCast = ::bevy_math::bounding::BoundingCircleCast::from_ray( + safe_transmute(circle), + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8161,14 +7786,13 @@ pub(crate) fn register_bounding_circle_cast_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::BoundingCircleCast> = { { - let output: Val<::bevy_math::bounding::BoundingCircleCast> = ::bevy_math::bounding::BoundingCircleCast::new( - circle.into_inner(), - origin.into_inner(), - direction.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingCircleCast = ::bevy_math::bounding::BoundingCircleCast::new( + safe_transmute(circle), + safe_transmute(origin), + safe_transmute(direction), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8197,11 +7821,10 @@ pub(crate) fn register_ray_cast_3_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::RayCast3d::aabb_intersection_at( - &_self, - &aabb, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(aabb), + ); + safe_transmute(output) } }; output @@ -8214,11 +7837,10 @@ pub(crate) fn register_ray_cast_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::RayCast3d>| { let output: Val<::bevy_math::bounding::RayCast3d> = { { - let output: Val<::bevy_math::bounding::RayCast3d> = <::bevy_math::bounding::RayCast3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::RayCast3d = <::bevy_math::bounding::RayCast3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8231,11 +7853,10 @@ pub(crate) fn register_ray_cast_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::RayCast3d>| { let output: Val<::bevy_math::Vec3A> = { { - let output: Val<::bevy_math::Vec3A> = ::bevy_math::bounding::RayCast3d::direction_recip( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3A = ::bevy_math::bounding::RayCast3d::direction_recip( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8248,12 +7869,11 @@ pub(crate) fn register_ray_cast_3_d_functions(world: &mut World) { |ray: Val<::bevy_math::Ray3d>, max: f32| { let output: Val<::bevy_math::bounding::RayCast3d> = { { - let output: Val<::bevy_math::bounding::RayCast3d> = ::bevy_math::bounding::RayCast3d::from_ray( - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::RayCast3d = ::bevy_math::bounding::RayCast3d::from_ray( + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8270,11 +7890,10 @@ pub(crate) fn register_ray_cast_3_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::RayCast3d::sphere_intersection_at( - &_self, - &sphere, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(sphere), + ); + safe_transmute(output) } }; output @@ -8303,11 +7922,10 @@ pub(crate) fn register_aabb_cast_3_d_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::AabbCast3d::aabb_collision_at( - &_self, - aabb.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(aabb), + ); + safe_transmute(output) } }; output @@ -8320,11 +7938,10 @@ pub(crate) fn register_aabb_cast_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::AabbCast3d>| { let output: Val<::bevy_math::bounding::AabbCast3d> = { { - let output: Val<::bevy_math::bounding::AabbCast3d> = <::bevy_math::bounding::AabbCast3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::AabbCast3d = <::bevy_math::bounding::AabbCast3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8341,13 +7958,12 @@ pub(crate) fn register_aabb_cast_3_d_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::AabbCast3d> = { { - let output: Val<::bevy_math::bounding::AabbCast3d> = ::bevy_math::bounding::AabbCast3d::from_ray( - aabb.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::AabbCast3d = ::bevy_math::bounding::AabbCast3d::from_ray( + safe_transmute(aabb), + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8372,11 +7988,10 @@ pub(crate) fn register_bounding_sphere_cast_functions(world: &mut World) { |_self: Ref<::bevy_math::bounding::BoundingSphereCast>| { let output: Val<::bevy_math::bounding::BoundingSphereCast> = { { - let output: Val<::bevy_math::bounding::BoundingSphereCast> = <::bevy_math::bounding::BoundingSphereCast as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingSphereCast = <::bevy_math::bounding::BoundingSphereCast as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8393,13 +8008,12 @@ pub(crate) fn register_bounding_sphere_cast_functions(world: &mut World) { { let output: Val<::bevy_math::bounding::BoundingSphereCast> = { { - let output: Val<::bevy_math::bounding::BoundingSphereCast> = ::bevy_math::bounding::BoundingSphereCast::from_ray( - sphere.into_inner(), - ray.into_inner(), - max, - ) - .into(); - output + let output: ::bevy_math::bounding::BoundingSphereCast = ::bevy_math::bounding::BoundingSphereCast::from_ray( + safe_transmute(sphere), + safe_transmute(ray), + safe_transmute(max), + ); + safe_transmute(output) } }; output @@ -8416,11 +8030,10 @@ pub(crate) fn register_bounding_sphere_cast_functions(world: &mut World) { let output: ::core::option::Option = { { let output: ::core::option::Option = ::bevy_math::bounding::BoundingSphereCast::sphere_collision_at( - &_self, - sphere.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(sphere), + ); + safe_transmute(output) } }; output @@ -8446,11 +8059,10 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::curve::Interval::clamp( - _self.into_inner(), - value, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -8463,11 +8075,10 @@ pub(crate) fn register_interval_functions(world: &mut World) { |_self: Ref<::bevy_math::curve::Interval>| { let output: Val<::bevy_math::curve::Interval> = { { - let output: Val<::bevy_math::curve::Interval> = <::bevy_math::curve::Interval as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::curve::Interval = <::bevy_math::curve::Interval as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8481,11 +8092,10 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::curve::Interval::contains( - _self.into_inner(), - item, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(item), + ); + safe_transmute(output) } }; output @@ -8502,11 +8112,10 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::curve::Interval::contains_interval( - _self.into_inner(), - other.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(other), + ); + safe_transmute(output) } }; output @@ -8520,10 +8129,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::curve::Interval::end( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8541,9 +8149,8 @@ pub(crate) fn register_interval_functions(world: &mut World) { { let output: bool = <::bevy_math::curve::Interval as ::core::cmp::PartialEq< ::bevy_math::curve::Interval, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8557,10 +8164,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::curve::Interval::has_finite_end( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8574,10 +8180,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::curve::Interval::has_finite_start( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8591,10 +8196,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_math::curve::Interval::is_bounded( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8608,10 +8212,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::curve::Interval::length( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8625,10 +8228,9 @@ pub(crate) fn register_interval_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::curve::Interval::start( - _self.into_inner(), - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8653,11 +8255,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir4>| { let output: Val<::bevy_math::Vec4> = { { - let output: Val<::bevy_math::Vec4> = ::bevy_math::Dir4::as_vec4( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec4 = ::bevy_math::Dir4::as_vec4( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8670,11 +8271,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |_self: Ref<::bevy_math::Dir4>| { let output: Val<::bevy_math::Dir4> = { { - let output: Val<::bevy_math::Dir4> = <::bevy_math::Dir4 as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::Dir4 = <::bevy_math::Dir4 as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8689,9 +8289,8 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { { let output: bool = <::bevy_math::Dir4 as ::core::cmp::PartialEq< ::bevy_math::Dir4, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8704,11 +8303,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |_self: Val<::bevy_math::Dir4>| { let output: Val<::bevy_math::Dir4> = { { - let output: Val<::bevy_math::Dir4> = ::bevy_math::Dir4::fast_renormalize( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir4 = ::bevy_math::Dir4::fast_renormalize( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8721,14 +8319,13 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |x: f32, y: f32, z: f32, w: f32| { let output: Val<::bevy_math::Dir4> = { { - let output: Val<::bevy_math::Dir4> = ::bevy_math::Dir4::from_xyzw_unchecked( - x, - y, - z, - w, - ) - .into(); - output + let output: ::bevy_math::Dir4 = ::bevy_math::Dir4::from_xyzw_unchecked( + safe_transmute(x), + safe_transmute(y), + safe_transmute(z), + safe_transmute(w), + ); + safe_transmute(output) } }; output @@ -8741,11 +8338,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |_self: Val<::bevy_math::Dir4>, rhs: f32| { let output: Val<::bevy_math::Vec4> = { { - let output: Val<::bevy_math::Vec4> = <::bevy_math::Dir4 as ::core::ops::Mul< + let output: ::bevy_math::Vec4 = <::bevy_math::Dir4 as ::core::ops::Mul< f32, - >>::mul(_self.into_inner(), rhs) - .into(); - output + >>::mul(safe_transmute(_self), safe_transmute(rhs)); + safe_transmute(output) } }; output @@ -8758,11 +8354,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |_self: Val<::bevy_math::Dir4>| { let output: Val<::bevy_math::Dir4> = { { - let output: Val<::bevy_math::Dir4> = <::bevy_math::Dir4 as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir4 = <::bevy_math::Dir4 as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8775,11 +8370,10 @@ pub(crate) fn register_dir_4_functions(world: &mut World) { |value: Val<::bevy_math::Vec4>| { let output: Val<::bevy_math::Dir4> = { { - let output: Val<::bevy_math::Dir4> = ::bevy_math::Dir4::new_unchecked( - value.into_inner(), - ) - .into(); - output + let output: ::bevy_math::Dir4 = ::bevy_math::Dir4::new_unchecked( + safe_transmute(value), + ); + safe_transmute(output) } }; output @@ -8804,11 +8398,10 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { |_self: Ref<::bevy_math::FloatOrd>| { let output: Val<::bevy_math::FloatOrd> = { { - let output: Val<::bevy_math::FloatOrd> = <::bevy_math::FloatOrd as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::FloatOrd = <::bevy_math::FloatOrd as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8823,9 +8416,8 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { { let output: bool = <::bevy_math::FloatOrd as ::core::cmp::PartialEq< ::bevy_math::FloatOrd, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8840,9 +8432,8 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { { let output: bool = <::bevy_math::FloatOrd as ::core::cmp::PartialOrd< ::bevy_math::FloatOrd, - >>::ge(&_self, &other) - .into(); - output + >>::ge(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8857,9 +8448,8 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { { let output: bool = <::bevy_math::FloatOrd as ::core::cmp::PartialOrd< ::bevy_math::FloatOrd, - >>::gt(&_self, &other) - .into(); - output + >>::gt(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8874,9 +8464,8 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { { let output: bool = <::bevy_math::FloatOrd as ::core::cmp::PartialOrd< ::bevy_math::FloatOrd, - >>::le(&_self, &other) - .into(); - output + >>::le(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8891,9 +8480,8 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { { let output: bool = <::bevy_math::FloatOrd as ::core::cmp::PartialOrd< ::bevy_math::FloatOrd, - >>::lt(&_self, &other) - .into(); - output + >>::lt(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8906,11 +8494,10 @@ pub(crate) fn register_float_ord_functions(world: &mut World) { |_self: Val<::bevy_math::FloatOrd>| { let output: Val<::bevy_math::FloatOrd> = { { - let output: Val<::bevy_math::FloatOrd> = <::bevy_math::FloatOrd as ::core::ops::Neg>::neg( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_math::FloatOrd = <::bevy_math::FloatOrd as ::core::ops::Neg>::neg( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8935,11 +8522,10 @@ pub(crate) fn register_plane_3_d_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Plane3d>| { let output: Val<::bevy_math::primitives::Plane3d> = { { - let output: Val<::bevy_math::primitives::Plane3d> = <::bevy_math::primitives::Plane3d as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Plane3d = <::bevy_math::primitives::Plane3d as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -8957,9 +8543,8 @@ pub(crate) fn register_plane_3_d_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Plane3d as ::core::cmp::PartialEq< ::bevy_math::primitives::Plane3d, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -8972,12 +8557,11 @@ pub(crate) fn register_plane_3_d_functions(world: &mut World) { |normal: Val<::bevy_math::Vec3>, half_size: Val<::bevy_math::Vec2>| { let output: Val<::bevy_math::primitives::Plane3d> = { { - let output: Val<::bevy_math::primitives::Plane3d> = ::bevy_math::primitives::Plane3d::new( - normal.into_inner(), - half_size.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Plane3d = ::bevy_math::primitives::Plane3d::new( + safe_transmute(normal), + safe_transmute(half_size), + ); + safe_transmute(output) } }; output @@ -9002,11 +8586,10 @@ pub(crate) fn register_tetrahedron_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Tetrahedron>| { let output: Val<::bevy_math::Vec3> = { { - let output: Val<::bevy_math::Vec3> = ::bevy_math::primitives::Tetrahedron::centroid( - &_self, - ) - .into(); - output + let output: ::bevy_math::Vec3 = ::bevy_math::primitives::Tetrahedron::centroid( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9019,11 +8602,10 @@ pub(crate) fn register_tetrahedron_functions(world: &mut World) { |_self: Ref<::bevy_math::primitives::Tetrahedron>| { let output: Val<::bevy_math::primitives::Tetrahedron> = { { - let output: Val<::bevy_math::primitives::Tetrahedron> = <::bevy_math::primitives::Tetrahedron as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::primitives::Tetrahedron = <::bevy_math::primitives::Tetrahedron as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9041,9 +8623,8 @@ pub(crate) fn register_tetrahedron_functions(world: &mut World) { { let output: bool = <::bevy_math::primitives::Tetrahedron as ::core::cmp::PartialEq< ::bevy_math::primitives::Tetrahedron, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -9061,14 +8642,13 @@ pub(crate) fn register_tetrahedron_functions(world: &mut World) { { let output: Val<::bevy_math::primitives::Tetrahedron> = { { - let output: Val<::bevy_math::primitives::Tetrahedron> = ::bevy_math::primitives::Tetrahedron::new( - a.into_inner(), - b.into_inner(), - c.into_inner(), - d.into_inner(), - ) - .into(); - output + let output: ::bevy_math::primitives::Tetrahedron = ::bevy_math::primitives::Tetrahedron::new( + safe_transmute(a), + safe_transmute(b), + safe_transmute(c), + safe_transmute(d), + ); + safe_transmute(output) } }; output @@ -9082,10 +8662,9 @@ pub(crate) fn register_tetrahedron_functions(world: &mut World) { let output: f32 = { { let output: f32 = ::bevy_math::primitives::Tetrahedron::signed_volume( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9110,11 +8689,10 @@ pub(crate) fn register_ease_function_functions(world: &mut World) { |_self: Ref<::bevy_math::curve::EaseFunction>| { let output: Val<::bevy_math::curve::EaseFunction> = { { - let output: Val<::bevy_math::curve::EaseFunction> = <::bevy_math::curve::EaseFunction as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::curve::EaseFunction = <::bevy_math::curve::EaseFunction as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9132,9 +8710,8 @@ pub(crate) fn register_ease_function_functions(world: &mut World) { { let output: bool = <::bevy_math::curve::EaseFunction as ::core::cmp::PartialEq< ::bevy_math::curve::EaseFunction, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -9160,10 +8737,9 @@ pub(crate) fn register_jump_at_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_math::curve::JumpAt as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9176,11 +8752,10 @@ pub(crate) fn register_jump_at_functions(world: &mut World) { |_self: Ref<::bevy_math::curve::JumpAt>| { let output: Val<::bevy_math::curve::JumpAt> = { { - let output: Val<::bevy_math::curve::JumpAt> = <::bevy_math::curve::JumpAt as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_math::curve::JumpAt = <::bevy_math::curve::JumpAt as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -9198,9 +8773,8 @@ pub(crate) fn register_jump_at_functions(world: &mut World) { { let output: bool = <::bevy_math::curve::JumpAt as ::core::cmp::PartialEq< ::bevy_math::curve::JumpAt, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_pbr_bms_bindings/src/lib.rs b/crates/bindings/bevy_pbr_bms_bindings/src/lib.rs index fd19d4469a..5ad2de8d76 100644 --- a/crates/bindings/bevy_pbr_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_pbr_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_distance_fog_functions(world: &mut World) { |_self: Ref<::bevy_pbr::DistanceFog>| { let output: Val<::bevy_pbr::DistanceFog> = { { - let output: Val<::bevy_pbr::DistanceFog> = <::bevy_pbr::DistanceFog as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::DistanceFog = <::bevy_pbr::DistanceFog as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -53,11 +52,10 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |_self: Ref<::bevy_pbr::FogFalloff>| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = <::bevy_pbr::FogFalloff as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = <::bevy_pbr::FogFalloff as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -70,11 +68,10 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |visibility: f32| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility( - visibility, - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility( + safe_transmute(visibility), + ); + safe_transmute(output) } }; output @@ -87,12 +84,11 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |visibility: f32, extinction_inscattering_color: Val<::bevy_color::Color>| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_color( - visibility, - extinction_inscattering_color.into_inner(), - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_color( + safe_transmute(visibility), + safe_transmute(extinction_inscattering_color), + ); + safe_transmute(output) } }; output @@ -109,13 +105,12 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_colors( - visibility, - extinction_color.into_inner(), - inscattering_color.into_inner(), - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_colors( + safe_transmute(visibility), + safe_transmute(extinction_color), + safe_transmute(inscattering_color), + ); + safe_transmute(output) } }; output @@ -128,12 +123,11 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |visibility: f32, contrast_threshold: f32| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_contrast( - visibility, - contrast_threshold, - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_contrast( + safe_transmute(visibility), + safe_transmute(contrast_threshold), + ); + safe_transmute(output) } }; output @@ -150,13 +144,12 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_contrast_color( - visibility, - contrast_threshold, - extinction_inscattering_color.into_inner(), - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_contrast_color( + safe_transmute(visibility), + safe_transmute(contrast_threshold), + safe_transmute(extinction_inscattering_color), + ); + safe_transmute(output) } }; output @@ -174,14 +167,13 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_contrast_colors( - visibility, - contrast_threshold, - extinction_color.into_inner(), - inscattering_color.into_inner(), - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_contrast_colors( + safe_transmute(visibility), + safe_transmute(contrast_threshold), + safe_transmute(extinction_color), + safe_transmute(inscattering_color), + ); + safe_transmute(output) } }; output @@ -199,12 +191,11 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |visibility: f32, contrast_threshold: f32| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_contrast_squared( - visibility, - contrast_threshold, - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_contrast_squared( + safe_transmute(visibility), + safe_transmute(contrast_threshold), + ); + safe_transmute(output) } }; output @@ -217,11 +208,10 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |visibility: f32| { let output: Val<::bevy_pbr::FogFalloff> = { { - let output: Val<::bevy_pbr::FogFalloff> = ::bevy_pbr::FogFalloff::from_visibility_squared( - visibility, - ) - .into(); - output + let output: ::bevy_pbr::FogFalloff = ::bevy_pbr::FogFalloff::from_visibility_squared( + safe_transmute(visibility), + ); + safe_transmute(output) } }; output @@ -234,9 +224,11 @@ pub(crate) fn register_fog_falloff_functions(world: &mut World) { |v: f32, c_t: f32| { let output: f32 = { { - let output: f32 = ::bevy_pbr::FogFalloff::koschmieder(v, c_t) - .into(); - output + let output: f32 = ::bevy_pbr::FogFalloff::koschmieder( + safe_transmute(v), + safe_transmute(c_t), + ); + safe_transmute(output) } }; output @@ -262,10 +254,9 @@ pub(crate) fn register_parallax_mapping_method_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::ParallaxMappingMethod as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -278,11 +269,10 @@ pub(crate) fn register_parallax_mapping_method_functions(world: &mut World) { |_self: Ref<::bevy_pbr::ParallaxMappingMethod>| { let output: Val<::bevy_pbr::ParallaxMappingMethod> = { { - let output: Val<::bevy_pbr::ParallaxMappingMethod> = <::bevy_pbr::ParallaxMappingMethod as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::ParallaxMappingMethod = <::bevy_pbr::ParallaxMappingMethod as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -300,9 +290,8 @@ pub(crate) fn register_parallax_mapping_method_functions(world: &mut World) { { let output: bool = <::bevy_pbr::ParallaxMappingMethod as ::std::cmp::PartialEq< ::bevy_pbr::ParallaxMappingMethod, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -327,11 +316,10 @@ pub(crate) fn register_standard_material_functions(world: &mut World) { |_self: Ref<::bevy_pbr::StandardMaterial>| { let output: Val<::bevy_pbr::StandardMaterial> = { { - let output: Val<::bevy_pbr::StandardMaterial> = <::bevy_pbr::StandardMaterial as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::StandardMaterial = <::bevy_pbr::StandardMaterial as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -349,12 +337,11 @@ pub(crate) fn register_standard_material_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_pbr::StandardMaterial::flip( - &mut _self, - horizontal, - vertical, - ) - .into(); - output + safe_transmute(_self), + safe_transmute(horizontal), + safe_transmute(vertical), + ); + safe_transmute(output) } }; output @@ -367,13 +354,12 @@ pub(crate) fn register_standard_material_functions(world: &mut World) { |_self: Val<::bevy_pbr::StandardMaterial>, horizontal: bool, vertical: bool| { let output: Val<::bevy_pbr::StandardMaterial> = { { - let output: Val<::bevy_pbr::StandardMaterial> = ::bevy_pbr::StandardMaterial::flipped( - _self.into_inner(), - horizontal, - vertical, - ) - .into(); - output + let output: ::bevy_pbr::StandardMaterial = ::bevy_pbr::StandardMaterial::flipped( + safe_transmute(_self), + safe_transmute(horizontal), + safe_transmute(vertical), + ); + safe_transmute(output) } }; output @@ -398,11 +384,10 @@ pub(crate) fn register_screen_space_ambient_occlusion_functions(world: &mut Worl |_self: Ref<::bevy_pbr::ScreenSpaceAmbientOcclusion>| { let output: Val<::bevy_pbr::ScreenSpaceAmbientOcclusion> = { { - let output: Val<::bevy_pbr::ScreenSpaceAmbientOcclusion> = <::bevy_pbr::ScreenSpaceAmbientOcclusion as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::ScreenSpaceAmbientOcclusion = <::bevy_pbr::ScreenSpaceAmbientOcclusion as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -420,9 +405,8 @@ pub(crate) fn register_screen_space_ambient_occlusion_functions(world: &mut Worl { let output: bool = <::bevy_pbr::ScreenSpaceAmbientOcclusion as ::std::cmp::PartialEq< ::bevy_pbr::ScreenSpaceAmbientOcclusion, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -447,11 +431,10 @@ pub(crate) fn register_screen_space_reflections_functions(world: &mut World) { |_self: Ref<::bevy_pbr::ScreenSpaceReflections>| { let output: Val<::bevy_pbr::ScreenSpaceReflections> = { { - let output: Val<::bevy_pbr::ScreenSpaceReflections> = <::bevy_pbr::ScreenSpaceReflections as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::ScreenSpaceReflections = <::bevy_pbr::ScreenSpaceReflections as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -476,11 +459,10 @@ pub(crate) fn register_default_opaque_renderer_method_functions(world: &mut Worl |_self: Ref<::bevy_pbr::DefaultOpaqueRendererMethod>| { let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = { { - let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = <::bevy_pbr::DefaultOpaqueRendererMethod as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::DefaultOpaqueRendererMethod = <::bevy_pbr::DefaultOpaqueRendererMethod as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -493,9 +475,8 @@ pub(crate) fn register_default_opaque_renderer_method_functions(world: &mut Worl || { let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = { { - let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = ::bevy_pbr::DefaultOpaqueRendererMethod::deferred() - .into(); - output + let output: ::bevy_pbr::DefaultOpaqueRendererMethod = ::bevy_pbr::DefaultOpaqueRendererMethod::deferred(); + safe_transmute(output) } }; output @@ -508,9 +489,8 @@ pub(crate) fn register_default_opaque_renderer_method_functions(world: &mut Worl || { let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = { { - let output: Val<::bevy_pbr::DefaultOpaqueRendererMethod> = ::bevy_pbr::DefaultOpaqueRendererMethod::forward() - .into(); - output + let output: ::bevy_pbr::DefaultOpaqueRendererMethod = ::bevy_pbr::DefaultOpaqueRendererMethod::forward(); + safe_transmute(output) } }; output @@ -524,10 +504,9 @@ pub(crate) fn register_default_opaque_renderer_method_functions(world: &mut Worl let output: () = { { let output: () = ::bevy_pbr::DefaultOpaqueRendererMethod::set_to_deferred( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -541,10 +520,9 @@ pub(crate) fn register_default_opaque_renderer_method_functions(world: &mut Worl let output: () = { { let output: () = ::bevy_pbr::DefaultOpaqueRendererMethod::set_to_forward( - &mut _self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -569,11 +547,10 @@ pub(crate) fn register_wireframe_material_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::WireframeMaterial>| { let output: Val<::bevy_pbr::wireframe::WireframeMaterial> = { { - let output: Val<::bevy_pbr::wireframe::WireframeMaterial> = <::bevy_pbr::wireframe::WireframeMaterial as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::WireframeMaterial = <::bevy_pbr::wireframe::WireframeMaterial as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -598,11 +575,10 @@ pub(crate) fn register_wireframe_config_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::WireframeConfig>| { let output: Val<::bevy_pbr::wireframe::WireframeConfig> = { { - let output: Val<::bevy_pbr::wireframe::WireframeConfig> = <::bevy_pbr::wireframe::WireframeConfig as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::WireframeConfig = <::bevy_pbr::wireframe::WireframeConfig as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -628,10 +604,9 @@ pub(crate) fn register_wireframe_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::wireframe::Wireframe as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -644,11 +619,10 @@ pub(crate) fn register_wireframe_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::Wireframe>| { let output: Val<::bevy_pbr::wireframe::Wireframe> = { { - let output: Val<::bevy_pbr::wireframe::Wireframe> = <::bevy_pbr::wireframe::Wireframe as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::Wireframe = <::bevy_pbr::wireframe::Wireframe as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -666,9 +640,8 @@ pub(crate) fn register_wireframe_functions(world: &mut World) { { let output: bool = <::bevy_pbr::wireframe::Wireframe as ::std::cmp::PartialEq< ::bevy_pbr::wireframe::Wireframe, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -693,11 +666,10 @@ pub(crate) fn register_wireframe_color_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::WireframeColor>| { let output: Val<::bevy_pbr::wireframe::WireframeColor> = { { - let output: Val<::bevy_pbr::wireframe::WireframeColor> = <::bevy_pbr::wireframe::WireframeColor as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::WireframeColor = <::bevy_pbr::wireframe::WireframeColor as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -723,10 +695,9 @@ pub(crate) fn register_no_wireframe_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::wireframe::NoWireframe as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -739,11 +710,10 @@ pub(crate) fn register_no_wireframe_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::NoWireframe>| { let output: Val<::bevy_pbr::wireframe::NoWireframe> = { { - let output: Val<::bevy_pbr::wireframe::NoWireframe> = <::bevy_pbr::wireframe::NoWireframe as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::NoWireframe = <::bevy_pbr::wireframe::NoWireframe as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -761,9 +731,8 @@ pub(crate) fn register_no_wireframe_functions(world: &mut World) { { let output: bool = <::bevy_pbr::wireframe::NoWireframe as ::std::cmp::PartialEq< ::bevy_pbr::wireframe::NoWireframe, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -789,10 +758,9 @@ pub(crate) fn register_mesh_3_d_wireframe_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::wireframe::Mesh3dWireframe as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -805,11 +773,10 @@ pub(crate) fn register_mesh_3_d_wireframe_functions(world: &mut World) { |_self: Ref<::bevy_pbr::wireframe::Mesh3dWireframe>| { let output: Val<::bevy_pbr::wireframe::Mesh3dWireframe> = { { - let output: Val<::bevy_pbr::wireframe::Mesh3dWireframe> = <::bevy_pbr::wireframe::Mesh3dWireframe as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::wireframe::Mesh3dWireframe = <::bevy_pbr::wireframe::Mesh3dWireframe as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -827,9 +794,8 @@ pub(crate) fn register_mesh_3_d_wireframe_functions(world: &mut World) { { let output: bool = <::bevy_pbr::wireframe::Mesh3dWireframe as ::std::cmp::PartialEq< ::bevy_pbr::wireframe::Mesh3dWireframe, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -854,11 +820,10 @@ pub(crate) fn register_atmosphere_functions(world: &mut World) { |_self: Ref<::bevy_pbr::Atmosphere>| { let output: Val<::bevy_pbr::Atmosphere> = { { - let output: Val<::bevy_pbr::Atmosphere> = <::bevy_pbr::Atmosphere as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::Atmosphere = <::bevy_pbr::Atmosphere as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -871,12 +836,11 @@ pub(crate) fn register_atmosphere_functions(world: &mut World) { |_self: Val<::bevy_pbr::Atmosphere>, mult: f32| { let output: Val<::bevy_pbr::Atmosphere> = { { - let output: Val<::bevy_pbr::Atmosphere> = ::bevy_pbr::Atmosphere::with_density_multiplier( - _self.into_inner(), - mult, - ) - .into(); - output + let output: ::bevy_pbr::Atmosphere = ::bevy_pbr::Atmosphere::with_density_multiplier( + safe_transmute(_self), + safe_transmute(mult), + ); + safe_transmute(output) } }; output @@ -901,11 +865,10 @@ pub(crate) fn register_gpu_atmosphere_settings_functions(world: &mut World) { |_self: Ref<::bevy_pbr::GpuAtmosphereSettings>| { let output: Val<::bevy_pbr::GpuAtmosphereSettings> = { { - let output: Val<::bevy_pbr::GpuAtmosphereSettings> = <::bevy_pbr::GpuAtmosphereSettings as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::GpuAtmosphereSettings = <::bevy_pbr::GpuAtmosphereSettings as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -930,11 +893,10 @@ pub(crate) fn register_atmosphere_settings_functions(world: &mut World) { |_self: Ref<::bevy_pbr::AtmosphereSettings>| { let output: Val<::bevy_pbr::AtmosphereSettings> = { { - let output: Val<::bevy_pbr::AtmosphereSettings> = <::bevy_pbr::AtmosphereSettings as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::AtmosphereSettings = <::bevy_pbr::AtmosphereSettings as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -959,11 +921,10 @@ pub(crate) fn register_atmosphere_mode_functions(world: &mut World) { |_self: Ref<::bevy_pbr::AtmosphereMode>| { let output: Val<::bevy_pbr::AtmosphereMode> = { { - let output: Val<::bevy_pbr::AtmosphereMode> = <::bevy_pbr::AtmosphereMode as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::AtmosphereMode = <::bevy_pbr::AtmosphereMode as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -988,11 +949,10 @@ pub(crate) fn register_render_visible_mesh_entities_functions(world: &mut World) |_self: Ref<::bevy_pbr::RenderVisibleMeshEntities>| { let output: Val<::bevy_pbr::RenderVisibleMeshEntities> = { { - let output: Val<::bevy_pbr::RenderVisibleMeshEntities> = <::bevy_pbr::RenderVisibleMeshEntities as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::RenderVisibleMeshEntities = <::bevy_pbr::RenderVisibleMeshEntities as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1017,11 +977,10 @@ pub(crate) fn register_render_cubemap_visible_entities_functions(world: &mut Wor |_self: Ref<::bevy_pbr::RenderCubemapVisibleEntities>| { let output: Val<::bevy_pbr::RenderCubemapVisibleEntities> = { { - let output: Val<::bevy_pbr::RenderCubemapVisibleEntities> = <::bevy_pbr::RenderCubemapVisibleEntities as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::RenderCubemapVisibleEntities = <::bevy_pbr::RenderCubemapVisibleEntities as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1046,11 +1005,10 @@ pub(crate) fn register_render_cascades_visible_entities_functions(world: &mut Wo |_self: Ref<::bevy_pbr::RenderCascadesVisibleEntities>| { let output: Val<::bevy_pbr::RenderCascadesVisibleEntities> = { { - let output: Val<::bevy_pbr::RenderCascadesVisibleEntities> = <::bevy_pbr::RenderCascadesVisibleEntities as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::RenderCascadesVisibleEntities = <::bevy_pbr::RenderCascadesVisibleEntities as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1087,11 +1045,10 @@ pub(crate) fn register_opaque_renderer_method_functions(world: &mut World) { |_self: Ref<::bevy_pbr::OpaqueRendererMethod>| { let output: Val<::bevy_pbr::OpaqueRendererMethod> = { { - let output: Val<::bevy_pbr::OpaqueRendererMethod> = <::bevy_pbr::OpaqueRendererMethod as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::OpaqueRendererMethod = <::bevy_pbr::OpaqueRendererMethod as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1109,9 +1066,8 @@ pub(crate) fn register_opaque_renderer_method_functions(world: &mut World) { { let output: bool = <::bevy_pbr::OpaqueRendererMethod as ::std::cmp::PartialEq< ::bevy_pbr::OpaqueRendererMethod, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1136,11 +1092,10 @@ pub(crate) fn register_lightmap_functions(world: &mut World) { |_self: Ref<::bevy_pbr::Lightmap>| { let output: Val<::bevy_pbr::Lightmap> = { { - let output: Val<::bevy_pbr::Lightmap> = <::bevy_pbr::Lightmap as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::Lightmap = <::bevy_pbr::Lightmap as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1165,11 +1120,10 @@ pub(crate) fn register_material_binding_id_functions(world: &mut World) { |_self: Ref<::bevy_pbr::MaterialBindingId>| { let output: Val<::bevy_pbr::MaterialBindingId> = { { - let output: Val<::bevy_pbr::MaterialBindingId> = <::bevy_pbr::MaterialBindingId as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::MaterialBindingId = <::bevy_pbr::MaterialBindingId as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1194,11 +1148,10 @@ pub(crate) fn register_material_bind_group_slot_functions(world: &mut World) { |_self: Ref<::bevy_pbr::MaterialBindGroupSlot>| { let output: Val<::bevy_pbr::MaterialBindGroupSlot> = { { - let output: Val<::bevy_pbr::MaterialBindGroupSlot> = <::bevy_pbr::MaterialBindGroupSlot as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::MaterialBindGroupSlot = <::bevy_pbr::MaterialBindGroupSlot as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1216,9 +1169,8 @@ pub(crate) fn register_material_bind_group_slot_functions(world: &mut World) { { let output: bool = <::bevy_pbr::MaterialBindGroupSlot as ::std::cmp::PartialEq< ::bevy_pbr::MaterialBindGroupSlot, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1244,10 +1196,9 @@ pub(crate) fn register_material_bind_group_index_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::MaterialBindGroupIndex as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1260,11 +1211,10 @@ pub(crate) fn register_material_bind_group_index_functions(world: &mut World) { |_self: Ref<::bevy_pbr::MaterialBindGroupIndex>| { let output: Val<::bevy_pbr::MaterialBindGroupIndex> = { { - let output: Val<::bevy_pbr::MaterialBindGroupIndex> = <::bevy_pbr::MaterialBindGroupIndex as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::MaterialBindGroupIndex = <::bevy_pbr::MaterialBindGroupIndex as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1282,9 +1232,8 @@ pub(crate) fn register_material_bind_group_index_functions(world: &mut World) { { let output: bool = <::bevy_pbr::MaterialBindGroupIndex as ::std::cmp::PartialEq< ::bevy_pbr::MaterialBindGroupIndex, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1310,10 +1259,9 @@ pub(crate) fn register_uv_channel_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_pbr::UvChannel as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1326,11 +1274,10 @@ pub(crate) fn register_uv_channel_functions(world: &mut World) { |_self: Ref<::bevy_pbr::UvChannel>| { let output: Val<::bevy_pbr::UvChannel> = { { - let output: Val<::bevy_pbr::UvChannel> = <::bevy_pbr::UvChannel as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::UvChannel = <::bevy_pbr::UvChannel as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1345,9 +1292,8 @@ pub(crate) fn register_uv_channel_functions(world: &mut World) { { let output: bool = <::bevy_pbr::UvChannel as ::std::cmp::PartialEq< ::bevy_pbr::UvChannel, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1375,10 +1321,9 @@ pub(crate) fn register_screen_space_ambient_occlusion_quality_level_functions( let output: () = { { let output: () = <::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1391,13 +1336,10 @@ pub(crate) fn register_screen_space_ambient_occlusion_quality_level_functions( |_self: Ref<::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel>| { let output: Val<::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel> = { { - let output: Val< - ::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel, - > = <::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel = <::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1415,9 +1357,8 @@ pub(crate) fn register_screen_space_ambient_occlusion_quality_level_functions( { let output: bool = <::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel as ::std::cmp::PartialEq< ::bevy_pbr::ScreenSpaceAmbientOcclusionQualityLevel, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_picking_bms_bindings/src/lib.rs b/crates/bindings/bevy_picking_bms_bindings/src/lib.rs index 8cbcbc17b1..e072870e9a 100644 --- a/crates/bindings/bevy_picking_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_picking_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_release_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Release>| { let output: Val<::bevy_picking::events::Release> = { { - let output: Val<::bevy_picking::events::Release> = <::bevy_picking::events::Release as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Release = <::bevy_picking::events::Release as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -46,9 +45,8 @@ pub(crate) fn register_release_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Release as ::std::cmp::PartialEq< ::bevy_picking::events::Release, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -73,11 +71,10 @@ pub(crate) fn register_ray_cast_backfaces_functions(world: &mut World) { |_self: Ref<::bevy_picking::prelude::RayCastBackfaces>| { let output: Val<::bevy_picking::prelude::RayCastBackfaces> = { { - let output: Val<::bevy_picking::prelude::RayCastBackfaces> = <::bevy_picking::prelude::RayCastBackfaces as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::prelude::RayCastBackfaces = <::bevy_picking::prelude::RayCastBackfaces as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -102,11 +99,10 @@ pub(crate) fn register_ray_cast_visibility_functions(world: &mut World) { |_self: Ref<::bevy_picking::prelude::RayCastVisibility>| { let output: Val<::bevy_picking::prelude::RayCastVisibility> = { { - let output: Val<::bevy_picking::prelude::RayCastVisibility> = <::bevy_picking::prelude::RayCastVisibility as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::prelude::RayCastVisibility = <::bevy_picking::prelude::RayCastVisibility as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -131,13 +127,10 @@ pub(crate) fn register_mesh_picking_camera_functions(world: &mut World) { |_self: Ref<::bevy_picking::mesh_picking::MeshPickingCamera>| { let output: Val<::bevy_picking::mesh_picking::MeshPickingCamera> = { { - let output: Val< - ::bevy_picking::mesh_picking::MeshPickingCamera, - > = <::bevy_picking::mesh_picking::MeshPickingCamera as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::mesh_picking::MeshPickingCamera = <::bevy_picking::mesh_picking::MeshPickingCamera as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -175,10 +168,9 @@ pub(crate) fn register_pointer_button_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::pointer::PointerButton as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -191,11 +183,10 @@ pub(crate) fn register_pointer_button_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerButton>| { let output: Val<::bevy_picking::pointer::PointerButton> = { { - let output: Val<::bevy_picking::pointer::PointerButton> = <::bevy_picking::pointer::PointerButton as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerButton = <::bevy_picking::pointer::PointerButton as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -213,9 +204,8 @@ pub(crate) fn register_pointer_button_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::PointerButton as ::std::cmp::PartialEq< ::bevy_picking::pointer::PointerButton, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -241,10 +231,9 @@ pub(crate) fn register_pickable_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::Pickable as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -257,11 +246,10 @@ pub(crate) fn register_pickable_functions(world: &mut World) { |_self: Ref<::bevy_picking::Pickable>| { let output: Val<::bevy_picking::Pickable> = { { - let output: Val<::bevy_picking::Pickable> = <::bevy_picking::Pickable as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::Pickable = <::bevy_picking::Pickable as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -276,9 +264,8 @@ pub(crate) fn register_pickable_functions(world: &mut World) { { let output: bool = <::bevy_picking::Pickable as ::std::cmp::PartialEq< ::bevy_picking::Pickable, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -303,11 +290,10 @@ pub(crate) fn register_picking_settings_functions(world: &mut World) { |_self: Ref<::bevy_picking::PickingSettings>| { let output: Val<::bevy_picking::PickingSettings> = { { - let output: Val<::bevy_picking::PickingSettings> = <::bevy_picking::PickingSettings as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::PickingSettings = <::bevy_picking::PickingSettings as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -336,11 +322,10 @@ pub(crate) fn register_pointer_input_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerInput::button_just_pressed( - &_self, - target_button.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(target_button), + ); + safe_transmute(output) } }; output @@ -357,11 +342,10 @@ pub(crate) fn register_pointer_input_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerInput::button_just_released( - &_self, - target_button.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(target_button), + ); + safe_transmute(output) } }; output @@ -374,11 +358,10 @@ pub(crate) fn register_pointer_input_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerInput>| { let output: Val<::bevy_picking::pointer::PointerInput> = { { - let output: Val<::bevy_picking::pointer::PointerInput> = <::bevy_picking::pointer::PointerInput as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerInput = <::bevy_picking::pointer::PointerInput as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -395,13 +378,12 @@ pub(crate) fn register_pointer_input_functions(world: &mut World) { { let output: Val<::bevy_picking::pointer::PointerInput> = { { - let output: Val<::bevy_picking::pointer::PointerInput> = ::bevy_picking::pointer::PointerInput::new( - pointer_id.into_inner(), - location.into_inner(), - action.into_inner(), - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerInput = ::bevy_picking::pointer::PointerInput::new( + safe_transmute(pointer_id), + safe_transmute(location), + safe_transmute(action), + ); + safe_transmute(output) } }; output @@ -426,11 +408,10 @@ pub(crate) fn register_pointer_hits_functions(world: &mut World) { |_self: Ref<::bevy_picking::backend::PointerHits>| { let output: Val<::bevy_picking::backend::PointerHits> = { { - let output: Val<::bevy_picking::backend::PointerHits> = <::bevy_picking::backend::PointerHits as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::backend::PointerHits = <::bevy_picking::backend::PointerHits as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -455,11 +436,10 @@ pub(crate) fn register_cancel_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Cancel>| { let output: Val<::bevy_picking::events::Cancel> = { { - let output: Val<::bevy_picking::events::Cancel> = <::bevy_picking::events::Cancel as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Cancel = <::bevy_picking::events::Cancel as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -477,9 +457,8 @@ pub(crate) fn register_cancel_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Cancel as ::std::cmp::PartialEq< ::bevy_picking::events::Cancel, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -504,11 +483,10 @@ pub(crate) fn register_click_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Click>| { let output: Val<::bevy_picking::events::Click> = { { - let output: Val<::bevy_picking::events::Click> = <::bevy_picking::events::Click as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Click = <::bevy_picking::events::Click as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -526,9 +504,8 @@ pub(crate) fn register_click_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Click as ::std::cmp::PartialEq< ::bevy_picking::events::Click, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -553,11 +530,10 @@ pub(crate) fn register_press_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Press>| { let output: Val<::bevy_picking::events::Press> = { { - let output: Val<::bevy_picking::events::Press> = <::bevy_picking::events::Press as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Press = <::bevy_picking::events::Press as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -575,9 +551,8 @@ pub(crate) fn register_press_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Press as ::std::cmp::PartialEq< ::bevy_picking::events::Press, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -602,11 +577,10 @@ pub(crate) fn register_drag_drop_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragDrop>| { let output: Val<::bevy_picking::events::DragDrop> = { { - let output: Val<::bevy_picking::events::DragDrop> = <::bevy_picking::events::DragDrop as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragDrop = <::bevy_picking::events::DragDrop as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -624,9 +598,8 @@ pub(crate) fn register_drag_drop_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragDrop as ::std::cmp::PartialEq< ::bevy_picking::events::DragDrop, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -651,11 +624,10 @@ pub(crate) fn register_drag_end_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragEnd>| { let output: Val<::bevy_picking::events::DragEnd> = { { - let output: Val<::bevy_picking::events::DragEnd> = <::bevy_picking::events::DragEnd as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragEnd = <::bevy_picking::events::DragEnd as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -673,9 +645,8 @@ pub(crate) fn register_drag_end_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragEnd as ::std::cmp::PartialEq< ::bevy_picking::events::DragEnd, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -700,11 +671,10 @@ pub(crate) fn register_drag_enter_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragEnter>| { let output: Val<::bevy_picking::events::DragEnter> = { { - let output: Val<::bevy_picking::events::DragEnter> = <::bevy_picking::events::DragEnter as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragEnter = <::bevy_picking::events::DragEnter as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -722,9 +692,8 @@ pub(crate) fn register_drag_enter_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragEnter as ::std::cmp::PartialEq< ::bevy_picking::events::DragEnter, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -749,11 +718,10 @@ pub(crate) fn register_drag_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Drag>| { let output: Val<::bevy_picking::events::Drag> = { { - let output: Val<::bevy_picking::events::Drag> = <::bevy_picking::events::Drag as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Drag = <::bevy_picking::events::Drag as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -771,9 +739,8 @@ pub(crate) fn register_drag_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Drag as ::std::cmp::PartialEq< ::bevy_picking::events::Drag, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -798,11 +765,10 @@ pub(crate) fn register_drag_leave_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragLeave>| { let output: Val<::bevy_picking::events::DragLeave> = { { - let output: Val<::bevy_picking::events::DragLeave> = <::bevy_picking::events::DragLeave as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragLeave = <::bevy_picking::events::DragLeave as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -820,9 +786,8 @@ pub(crate) fn register_drag_leave_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragLeave as ::std::cmp::PartialEq< ::bevy_picking::events::DragLeave, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -847,11 +812,10 @@ pub(crate) fn register_drag_over_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragOver>| { let output: Val<::bevy_picking::events::DragOver> = { { - let output: Val<::bevy_picking::events::DragOver> = <::bevy_picking::events::DragOver as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragOver = <::bevy_picking::events::DragOver as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -869,9 +833,8 @@ pub(crate) fn register_drag_over_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragOver as ::std::cmp::PartialEq< ::bevy_picking::events::DragOver, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -896,11 +859,10 @@ pub(crate) fn register_drag_start_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragStart>| { let output: Val<::bevy_picking::events::DragStart> = { { - let output: Val<::bevy_picking::events::DragStart> = <::bevy_picking::events::DragStart as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragStart = <::bevy_picking::events::DragStart as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -918,9 +880,8 @@ pub(crate) fn register_drag_start_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragStart as ::std::cmp::PartialEq< ::bevy_picking::events::DragStart, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -945,11 +906,10 @@ pub(crate) fn register_move_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Move>| { let output: Val<::bevy_picking::events::Move> = { { - let output: Val<::bevy_picking::events::Move> = <::bevy_picking::events::Move as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Move = <::bevy_picking::events::Move as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -967,9 +927,8 @@ pub(crate) fn register_move_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Move as ::std::cmp::PartialEq< ::bevy_picking::events::Move, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -994,11 +953,10 @@ pub(crate) fn register_out_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Out>| { let output: Val<::bevy_picking::events::Out> = { { - let output: Val<::bevy_picking::events::Out> = <::bevy_picking::events::Out as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Out = <::bevy_picking::events::Out as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1016,9 +974,8 @@ pub(crate) fn register_out_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Out as ::std::cmp::PartialEq< ::bevy_picking::events::Out, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1043,11 +1000,10 @@ pub(crate) fn register_over_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Over>| { let output: Val<::bevy_picking::events::Over> = { { - let output: Val<::bevy_picking::events::Over> = <::bevy_picking::events::Over as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Over = <::bevy_picking::events::Over as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1065,9 +1021,8 @@ pub(crate) fn register_over_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Over as ::std::cmp::PartialEq< ::bevy_picking::events::Over, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1092,11 +1047,10 @@ pub(crate) fn register_scroll_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::Scroll>| { let output: Val<::bevy_picking::events::Scroll> = { { - let output: Val<::bevy_picking::events::Scroll> = <::bevy_picking::events::Scroll as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::Scroll = <::bevy_picking::events::Scroll as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1114,9 +1068,8 @@ pub(crate) fn register_scroll_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::Scroll as ::std::cmp::PartialEq< ::bevy_picking::events::Scroll, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1141,11 +1094,10 @@ pub(crate) fn register_hit_data_functions(world: &mut World) { |_self: Ref<::bevy_picking::backend::HitData>| { let output: Val<::bevy_picking::backend::HitData> = { { - let output: Val<::bevy_picking::backend::HitData> = <::bevy_picking::backend::HitData as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::backend::HitData = <::bevy_picking::backend::HitData as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1163,9 +1115,8 @@ pub(crate) fn register_hit_data_functions(world: &mut World) { { let output: bool = <::bevy_picking::backend::HitData as ::std::cmp::PartialEq< ::bevy_picking::backend::HitData, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1191,10 +1142,9 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::pointer::PointerId as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1207,11 +1157,10 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerId>| { let output: Val<::bevy_picking::pointer::PointerId> = { { - let output: Val<::bevy_picking::pointer::PointerId> = <::bevy_picking::pointer::PointerId as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerId = <::bevy_picking::pointer::PointerId as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1229,9 +1178,8 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::PointerId as ::std::cmp::PartialEq< ::bevy_picking::pointer::PointerId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1245,10 +1193,9 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { let output: ::std::option::Option = { { let output: ::std::option::Option = ::bevy_picking::pointer::PointerId::get_touch_id( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1262,10 +1209,9 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerId::is_custom( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1279,10 +1225,9 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerId::is_mouse( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1296,10 +1241,9 @@ pub(crate) fn register_pointer_id_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerId::is_touch( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1324,11 +1268,10 @@ pub(crate) fn register_pointer_location_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerLocation>| { let output: Val<::bevy_picking::pointer::PointerLocation> = { { - let output: Val<::bevy_picking::pointer::PointerLocation> = <::bevy_picking::pointer::PointerLocation as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerLocation = <::bevy_picking::pointer::PointerLocation as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1346,9 +1289,8 @@ pub(crate) fn register_pointer_location_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::PointerLocation as ::std::cmp::PartialEq< ::bevy_picking::pointer::PointerLocation, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1361,11 +1303,10 @@ pub(crate) fn register_pointer_location_functions(world: &mut World) { |location: Val<::bevy_picking::pointer::Location>| { let output: Val<::bevy_picking::pointer::PointerLocation> = { { - let output: Val<::bevy_picking::pointer::PointerLocation> = ::bevy_picking::pointer::PointerLocation::new( - location.into_inner(), - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerLocation = ::bevy_picking::pointer::PointerLocation::new( + safe_transmute(location), + ); + safe_transmute(output) } }; output @@ -1391,10 +1332,9 @@ pub(crate) fn register_ray_id_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::backend::ray::RayId as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1407,11 +1347,10 @@ pub(crate) fn register_ray_id_functions(world: &mut World) { |_self: Ref<::bevy_picking::backend::ray::RayId>| { let output: Val<::bevy_picking::backend::ray::RayId> = { { - let output: Val<::bevy_picking::backend::ray::RayId> = <::bevy_picking::backend::ray::RayId as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::backend::ray::RayId = <::bevy_picking::backend::ray::RayId as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1429,9 +1368,8 @@ pub(crate) fn register_ray_id_functions(world: &mut World) { { let output: bool = <::bevy_picking::backend::ray::RayId as ::std::cmp::PartialEq< ::bevy_picking::backend::ray::RayId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1447,12 +1385,11 @@ pub(crate) fn register_ray_id_functions(world: &mut World) { { let output: Val<::bevy_picking::backend::ray::RayId> = { { - let output: Val<::bevy_picking::backend::ray::RayId> = ::bevy_picking::backend::ray::RayId::new( - camera.into_inner(), - pointer.into_inner(), - ) - .into(); - output + let output: ::bevy_picking::backend::ray::RayId = ::bevy_picking::backend::ray::RayId::new( + safe_transmute(camera), + safe_transmute(pointer), + ); + safe_transmute(output) } }; output @@ -1477,11 +1414,10 @@ pub(crate) fn register_location_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::Location>| { let output: Val<::bevy_picking::pointer::Location> = { { - let output: Val<::bevy_picking::pointer::Location> = <::bevy_picking::pointer::Location as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::Location = <::bevy_picking::pointer::Location as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1499,9 +1435,8 @@ pub(crate) fn register_location_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::Location as ::std::cmp::PartialEq< ::bevy_picking::pointer::Location, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1526,11 +1461,10 @@ pub(crate) fn register_pointer_action_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerAction>| { let output: Val<::bevy_picking::pointer::PointerAction> = { { - let output: Val<::bevy_picking::pointer::PointerAction> = <::bevy_picking::pointer::PointerAction as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerAction = <::bevy_picking::pointer::PointerAction as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1555,11 +1489,10 @@ pub(crate) fn register_drag_entry_functions(world: &mut World) { |_self: Ref<::bevy_picking::events::DragEntry>| { let output: Val<::bevy_picking::events::DragEntry> = { { - let output: Val<::bevy_picking::events::DragEntry> = <::bevy_picking::events::DragEntry as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::events::DragEntry = <::bevy_picking::events::DragEntry as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1577,9 +1510,8 @@ pub(crate) fn register_drag_entry_functions(world: &mut World) { { let output: bool = <::bevy_picking::events::DragEntry as ::std::cmp::PartialEq< ::bevy_picking::events::DragEntry, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1604,11 +1536,10 @@ pub(crate) fn register_pointer_interaction_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerInteraction>| { let output: Val<::bevy_picking::pointer::PointerInteraction> = { { - let output: Val<::bevy_picking::pointer::PointerInteraction> = <::bevy_picking::pointer::PointerInteraction as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerInteraction = <::bevy_picking::pointer::PointerInteraction as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1634,10 +1565,9 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::pointer::PointerPress as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1650,11 +1580,10 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PointerPress>| { let output: Val<::bevy_picking::pointer::PointerPress> = { { - let output: Val<::bevy_picking::pointer::PointerPress> = <::bevy_picking::pointer::PointerPress as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PointerPress = <::bevy_picking::pointer::PointerPress as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1672,9 +1601,8 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::PointerPress as ::std::cmp::PartialEq< ::bevy_picking::pointer::PointerPress, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1688,10 +1616,9 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerPress::is_any_pressed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1705,10 +1632,9 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerPress::is_middle_pressed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1722,10 +1648,9 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerPress::is_primary_pressed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1739,10 +1664,9 @@ pub(crate) fn register_pointer_press_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::pointer::PointerPress::is_secondary_pressed( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1768,10 +1692,9 @@ pub(crate) fn register_picking_interaction_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::hover::PickingInteraction as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1784,11 +1707,10 @@ pub(crate) fn register_picking_interaction_functions(world: &mut World) { |_self: Ref<::bevy_picking::hover::PickingInteraction>| { let output: Val<::bevy_picking::hover::PickingInteraction> = { { - let output: Val<::bevy_picking::hover::PickingInteraction> = <::bevy_picking::hover::PickingInteraction as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::hover::PickingInteraction = <::bevy_picking::hover::PickingInteraction as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1806,9 +1728,8 @@ pub(crate) fn register_picking_interaction_functions(world: &mut World) { { let output: bool = <::bevy_picking::hover::PickingInteraction as ::std::cmp::PartialEq< ::bevy_picking::hover::PickingInteraction, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1834,10 +1755,9 @@ pub(crate) fn register_hovered_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::hover::Hovered as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1850,11 +1770,10 @@ pub(crate) fn register_hovered_functions(world: &mut World) { |_self: Ref<::bevy_picking::hover::Hovered>| { let output: Val<::bevy_picking::hover::Hovered> = { { - let output: Val<::bevy_picking::hover::Hovered> = <::bevy_picking::hover::Hovered as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::hover::Hovered = <::bevy_picking::hover::Hovered as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1872,9 +1791,8 @@ pub(crate) fn register_hovered_functions(world: &mut World) { { let output: bool = <::bevy_picking::hover::Hovered as ::std::cmp::PartialEq< ::bevy_picking::hover::Hovered, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1887,9 +1805,10 @@ pub(crate) fn register_hovered_functions(world: &mut World) { |_self: Ref<::bevy_picking::hover::Hovered>| { let output: bool = { { - let output: bool = ::bevy_picking::hover::Hovered::get(&_self) - .into(); - output + let output: bool = ::bevy_picking::hover::Hovered::get( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1915,10 +1834,9 @@ pub(crate) fn register_directly_hovered_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::hover::DirectlyHovered as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1931,11 +1849,10 @@ pub(crate) fn register_directly_hovered_functions(world: &mut World) { |_self: Ref<::bevy_picking::hover::DirectlyHovered>| { let output: Val<::bevy_picking::hover::DirectlyHovered> = { { - let output: Val<::bevy_picking::hover::DirectlyHovered> = <::bevy_picking::hover::DirectlyHovered as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::hover::DirectlyHovered = <::bevy_picking::hover::DirectlyHovered as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1953,9 +1870,8 @@ pub(crate) fn register_directly_hovered_functions(world: &mut World) { { let output: bool = <::bevy_picking::hover::DirectlyHovered as ::std::cmp::PartialEq< ::bevy_picking::hover::DirectlyHovered, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -1969,10 +1885,9 @@ pub(crate) fn register_directly_hovered_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_picking::hover::DirectlyHovered::get( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -1997,11 +1912,10 @@ pub(crate) fn register_pointer_input_settings_functions(world: &mut World) { |_self: Ref<::bevy_picking::input::PointerInputSettings>| { let output: Val<::bevy_picking::input::PointerInputSettings> = { { - let output: Val<::bevy_picking::input::PointerInputSettings> = <::bevy_picking::input::PointerInputSettings as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::input::PointerInputSettings = <::bevy_picking::input::PointerInputSettings as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2026,13 +1940,10 @@ pub(crate) fn register_ray_mesh_hit_functions(world: &mut World) { |_self: Ref<::bevy_picking::mesh_picking::ray_cast::RayMeshHit>| { let output: Val<::bevy_picking::mesh_picking::ray_cast::RayMeshHit> = { { - let output: Val< - ::bevy_picking::mesh_picking::ray_cast::RayMeshHit, - > = <::bevy_picking::mesh_picking::ray_cast::RayMeshHit as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::mesh_picking::ray_cast::RayMeshHit = <::bevy_picking::mesh_picking::ray_cast::RayMeshHit as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2057,13 +1968,10 @@ pub(crate) fn register_backfaces_functions(world: &mut World) { |_self: Ref<::bevy_picking::mesh_picking::ray_cast::Backfaces>| { let output: Val<::bevy_picking::mesh_picking::ray_cast::Backfaces> = { { - let output: Val< - ::bevy_picking::mesh_picking::ray_cast::Backfaces, - > = <::bevy_picking::mesh_picking::ray_cast::Backfaces as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::mesh_picking::ray_cast::Backfaces = <::bevy_picking::mesh_picking::ray_cast::Backfaces as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2090,13 +1998,10 @@ pub(crate) fn register_simplified_mesh_functions(world: &mut World) { ::bevy_picking::mesh_picking::ray_cast::SimplifiedMesh, > = { { - let output: Val< - ::bevy_picking::mesh_picking::ray_cast::SimplifiedMesh, - > = <::bevy_picking::mesh_picking::ray_cast::SimplifiedMesh as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::mesh_picking::ray_cast::SimplifiedMesh = <::bevy_picking::mesh_picking::ray_cast::SimplifiedMesh as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2122,10 +2027,9 @@ pub(crate) fn register_press_direction_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_picking::pointer::PressDirection as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2138,11 +2042,10 @@ pub(crate) fn register_press_direction_functions(world: &mut World) { |_self: Ref<::bevy_picking::pointer::PressDirection>| { let output: Val<::bevy_picking::pointer::PressDirection> = { { - let output: Val<::bevy_picking::pointer::PressDirection> = <::bevy_picking::pointer::PressDirection as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_picking::pointer::PressDirection = <::bevy_picking::pointer::PressDirection as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -2160,9 +2063,8 @@ pub(crate) fn register_press_direction_functions(world: &mut World) { { let output: bool = <::bevy_picking::pointer::PressDirection as ::std::cmp::PartialEq< ::bevy_picking::pointer::PressDirection, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_post_process_bms_bindings/src/lib.rs b/crates/bindings/bevy_post_process_bms_bindings/src/lib.rs index 676f86d74b..c235d90f02 100644 --- a/crates/bindings/bevy_post_process_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_post_process_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -30,13 +30,10 @@ pub(crate) fn register_auto_exposure_compensation_curve_functions(world: &mut Wo ::bevy_post_process::auto_exposure::AutoExposureCompensationCurve, > = { { - let output: Val< - ::bevy_post_process::auto_exposure::AutoExposureCompensationCurve, - > = <::bevy_post_process::auto_exposure::AutoExposureCompensationCurve as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::auto_exposure::AutoExposureCompensationCurve = <::bevy_post_process::auto_exposure::AutoExposureCompensationCurve as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -61,13 +58,10 @@ pub(crate) fn register_auto_exposure_functions(world: &mut World) { |_self: Ref<::bevy_post_process::auto_exposure::AutoExposure>| { let output: Val<::bevy_post_process::auto_exposure::AutoExposure> = { { - let output: Val< - ::bevy_post_process::auto_exposure::AutoExposure, - > = <::bevy_post_process::auto_exposure::AutoExposure as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::auto_exposure::AutoExposure = <::bevy_post_process::auto_exposure::AutoExposure as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -92,11 +86,10 @@ pub(crate) fn register_bloom_functions(world: &mut World) { |_self: Ref<::bevy_post_process::bloom::Bloom>| { let output: Val<::bevy_post_process::bloom::Bloom> = { { - let output: Val<::bevy_post_process::bloom::Bloom> = <::bevy_post_process::bloom::Bloom as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::bloom::Bloom = <::bevy_post_process::bloom::Bloom as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -122,10 +115,9 @@ pub(crate) fn register_bloom_composite_mode_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_post_process::bloom::BloomCompositeMode as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -138,13 +130,10 @@ pub(crate) fn register_bloom_composite_mode_functions(world: &mut World) { |_self: Ref<::bevy_post_process::bloom::BloomCompositeMode>| { let output: Val<::bevy_post_process::bloom::BloomCompositeMode> = { { - let output: Val< - ::bevy_post_process::bloom::BloomCompositeMode, - > = <::bevy_post_process::bloom::BloomCompositeMode as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::bloom::BloomCompositeMode = <::bevy_post_process::bloom::BloomCompositeMode as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -162,9 +151,8 @@ pub(crate) fn register_bloom_composite_mode_functions(world: &mut World) { { let output: bool = <::bevy_post_process::bloom::BloomCompositeMode as ::std::cmp::PartialEq< ::bevy_post_process::bloom::BloomCompositeMode, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -189,11 +177,10 @@ pub(crate) fn register_bloom_prefilter_functions(world: &mut World) { |_self: Ref<::bevy_post_process::bloom::BloomPrefilter>| { let output: Val<::bevy_post_process::bloom::BloomPrefilter> = { { - let output: Val<::bevy_post_process::bloom::BloomPrefilter> = <::bevy_post_process::bloom::BloomPrefilter as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::bloom::BloomPrefilter = <::bevy_post_process::bloom::BloomPrefilter as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -218,11 +205,10 @@ pub(crate) fn register_depth_of_field_functions(world: &mut World) { |_self: Ref<::bevy_post_process::dof::DepthOfField>| { let output: Val<::bevy_post_process::dof::DepthOfField> = { { - let output: Val<::bevy_post_process::dof::DepthOfField> = <::bevy_post_process::dof::DepthOfField as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::dof::DepthOfField = <::bevy_post_process::dof::DepthOfField as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -247,11 +233,10 @@ pub(crate) fn register_depth_of_field_mode_functions(world: &mut World) { |_self: Ref<::bevy_post_process::dof::DepthOfFieldMode>| { let output: Val<::bevy_post_process::dof::DepthOfFieldMode> = { { - let output: Val<::bevy_post_process::dof::DepthOfFieldMode> = <::bevy_post_process::dof::DepthOfFieldMode as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::dof::DepthOfFieldMode = <::bevy_post_process::dof::DepthOfFieldMode as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -269,9 +254,8 @@ pub(crate) fn register_depth_of_field_mode_functions(world: &mut World) { { let output: bool = <::bevy_post_process::dof::DepthOfFieldMode as ::std::cmp::PartialEq< ::bevy_post_process::dof::DepthOfFieldMode, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -298,13 +282,10 @@ pub(crate) fn register_chromatic_aberration_functions(world: &mut World) { ::bevy_post_process::effect_stack::ChromaticAberration, > = { { - let output: Val< - ::bevy_post_process::effect_stack::ChromaticAberration, - > = <::bevy_post_process::effect_stack::ChromaticAberration as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::effect_stack::ChromaticAberration = <::bevy_post_process::effect_stack::ChromaticAberration as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -329,11 +310,10 @@ pub(crate) fn register_motion_blur_functions(world: &mut World) { |_self: Ref<::bevy_post_process::motion_blur::MotionBlur>| { let output: Val<::bevy_post_process::motion_blur::MotionBlur> = { { - let output: Val<::bevy_post_process::motion_blur::MotionBlur> = <::bevy_post_process::motion_blur::MotionBlur as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_post_process::motion_blur::MotionBlur = <::bevy_post_process::motion_blur::MotionBlur as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_scene_bms_bindings/src/lib.rs b/crates/bindings/bevy_scene_bms_bindings/src/lib.rs index 20fa0b4e58..742af9eb7c 100644 --- a/crates/bindings/bevy_scene_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_scene_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -25,10 +25,9 @@ pub(crate) fn register_dynamic_scene_root_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_scene::DynamicSceneRoot as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -41,11 +40,10 @@ pub(crate) fn register_dynamic_scene_root_functions(world: &mut World) { |_self: Ref<::bevy_scene::DynamicSceneRoot>| { let output: Val<::bevy_scene::DynamicSceneRoot> = { { - let output: Val<::bevy_scene::DynamicSceneRoot> = <::bevy_scene::DynamicSceneRoot as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_scene::DynamicSceneRoot = <::bevy_scene::DynamicSceneRoot as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -63,9 +61,8 @@ pub(crate) fn register_dynamic_scene_root_functions(world: &mut World) { { let output: bool = <::bevy_scene::DynamicSceneRoot as ::std::cmp::PartialEq< ::bevy_scene::DynamicSceneRoot, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -91,10 +88,9 @@ pub(crate) fn register_scene_root_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_scene::SceneRoot as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -107,11 +103,10 @@ pub(crate) fn register_scene_root_functions(world: &mut World) { |_self: Ref<::bevy_scene::SceneRoot>| { let output: Val<::bevy_scene::SceneRoot> = { { - let output: Val<::bevy_scene::SceneRoot> = <::bevy_scene::SceneRoot as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_scene::SceneRoot = <::bevy_scene::SceneRoot as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -126,9 +121,8 @@ pub(crate) fn register_scene_root_functions(world: &mut World) { { let output: bool = <::bevy_scene::SceneRoot as ::std::cmp::PartialEq< ::bevy_scene::SceneRoot, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -154,10 +148,9 @@ pub(crate) fn register_scene_instance_ready_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_scene::SceneInstanceReady as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -170,11 +163,10 @@ pub(crate) fn register_scene_instance_ready_functions(world: &mut World) { |_self: Ref<::bevy_scene::SceneInstanceReady>| { let output: Val<::bevy_scene::SceneInstanceReady> = { { - let output: Val<::bevy_scene::SceneInstanceReady> = <::bevy_scene::SceneInstanceReady as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_scene::SceneInstanceReady = <::bevy_scene::SceneInstanceReady as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -192,9 +184,8 @@ pub(crate) fn register_scene_instance_ready_functions(world: &mut World) { { let output: bool = <::bevy_scene::SceneInstanceReady as ::std::cmp::PartialEq< ::bevy_scene::SceneInstanceReady, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -220,10 +211,9 @@ pub(crate) fn register_instance_id_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_scene::InstanceId as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -236,11 +226,10 @@ pub(crate) fn register_instance_id_functions(world: &mut World) { |_self: Ref<::bevy_scene::InstanceId>| { let output: Val<::bevy_scene::InstanceId> = { { - let output: Val<::bevy_scene::InstanceId> = <::bevy_scene::InstanceId as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_scene::InstanceId = <::bevy_scene::InstanceId as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -255,9 +244,8 @@ pub(crate) fn register_instance_id_functions(world: &mut World) { { let output: bool = <::bevy_scene::InstanceId as ::std::cmp::PartialEq< ::bevy_scene::InstanceId, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_text_bms_bindings/src/lib.rs b/crates/bindings/bevy_text_bms_bindings/src/lib.rs index ea0f7a8b7d..43de4d2839 100644 --- a/crates/bindings/bevy_text_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_text_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -25,10 +25,9 @@ pub(crate) fn register_justify_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_text::Justify as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -41,11 +40,10 @@ pub(crate) fn register_justify_functions(world: &mut World) { |_self: Ref<::bevy_text::Justify>| { let output: Val<::bevy_text::Justify> = { { - let output: Val<::bevy_text::Justify> = <::bevy_text::Justify as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::Justify = <::bevy_text::Justify as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -60,9 +58,8 @@ pub(crate) fn register_justify_functions(world: &mut World) { { let output: bool = <::bevy_text::Justify as ::std::cmp::PartialEq< ::bevy_text::Justify, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -88,10 +85,9 @@ pub(crate) fn register_line_break_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_text::LineBreak as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -104,11 +100,10 @@ pub(crate) fn register_line_break_functions(world: &mut World) { |_self: Ref<::bevy_text::LineBreak>| { let output: Val<::bevy_text::LineBreak> = { { - let output: Val<::bevy_text::LineBreak> = <::bevy_text::LineBreak as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::LineBreak = <::bevy_text::LineBreak as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -123,9 +118,8 @@ pub(crate) fn register_line_break_functions(world: &mut World) { { let output: bool = <::bevy_text::LineBreak as ::std::cmp::PartialEq< ::bevy_text::LineBreak, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -150,11 +144,10 @@ pub(crate) fn register_text_color_functions(world: &mut World) { |_self: Ref<::bevy_text::TextColor>| { let output: Val<::bevy_text::TextColor> = { { - let output: Val<::bevy_text::TextColor> = <::bevy_text::TextColor as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextColor = <::bevy_text::TextColor as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -169,9 +162,8 @@ pub(crate) fn register_text_color_functions(world: &mut World) { { let output: bool = <::bevy_text::TextColor as ::std::cmp::PartialEq< ::bevy_text::TextColor, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -196,11 +188,10 @@ pub(crate) fn register_text_font_functions(world: &mut World) { |_self: Ref<::bevy_text::TextFont>| { let output: Val<::bevy_text::TextFont> = { { - let output: Val<::bevy_text::TextFont> = <::bevy_text::TextFont as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextFont = <::bevy_text::TextFont as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -215,9 +206,8 @@ pub(crate) fn register_text_font_functions(world: &mut World) { { let output: bool = <::bevy_text::TextFont as ::std::cmp::PartialEq< ::bevy_text::TextFont, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -230,11 +220,10 @@ pub(crate) fn register_text_font_functions(world: &mut World) { |font_size: f32| { let output: Val<::bevy_text::TextFont> = { { - let output: Val<::bevy_text::TextFont> = ::bevy_text::TextFont::from_font_size( - font_size, - ) - .into(); - output + let output: ::bevy_text::TextFont = ::bevy_text::TextFont::from_font_size( + safe_transmute(font_size), + ); + safe_transmute(output) } }; output @@ -247,12 +236,11 @@ pub(crate) fn register_text_font_functions(world: &mut World) { |_self: Val<::bevy_text::TextFont>, font_size: f32| { let output: Val<::bevy_text::TextFont> = { { - let output: Val<::bevy_text::TextFont> = ::bevy_text::TextFont::with_font_size( - _self.into_inner(), - font_size, - ) - .into(); - output + let output: ::bevy_text::TextFont = ::bevy_text::TextFont::with_font_size( + safe_transmute(_self), + safe_transmute(font_size), + ); + safe_transmute(output) } }; output @@ -268,12 +256,11 @@ pub(crate) fn register_text_font_functions(world: &mut World) { { let output: Val<::bevy_text::TextFont> = { { - let output: Val<::bevy_text::TextFont> = ::bevy_text::TextFont::with_font_smoothing( - _self.into_inner(), - font_smoothing.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextFont = ::bevy_text::TextFont::with_font_smoothing( + safe_transmute(_self), + safe_transmute(font_smoothing), + ); + safe_transmute(output) } }; output @@ -289,12 +276,11 @@ pub(crate) fn register_text_font_functions(world: &mut World) { { let output: Val<::bevy_text::TextFont> = { { - let output: Val<::bevy_text::TextFont> = ::bevy_text::TextFont::with_line_height( - _self.into_inner(), - line_height.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextFont = ::bevy_text::TextFont::with_line_height( + safe_transmute(_self), + safe_transmute(line_height), + ); + safe_transmute(output) } }; output @@ -319,11 +305,10 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |_self: Ref<::bevy_text::TextLayout>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = <::bevy_text::TextLayout as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextLayout = <::bevy_text::TextLayout as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -336,12 +321,11 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |justify: Val<::bevy_text::Justify>, linebreak: Val<::bevy_text::LineBreak>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::new( - justify.into_inner(), - linebreak.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::new( + safe_transmute(justify), + safe_transmute(linebreak), + ); + safe_transmute(output) } }; output @@ -354,11 +338,10 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |justify: Val<::bevy_text::Justify>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::new_with_justify( - justify.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::new_with_justify( + safe_transmute(justify), + ); + safe_transmute(output) } }; output @@ -371,11 +354,10 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |linebreak: Val<::bevy_text::LineBreak>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::new_with_linebreak( - linebreak.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::new_with_linebreak( + safe_transmute(linebreak), + ); + safe_transmute(output) } }; output @@ -388,9 +370,8 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { || { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::new_with_no_wrap() - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::new_with_no_wrap(); + safe_transmute(output) } }; output @@ -403,12 +384,11 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |_self: Val<::bevy_text::TextLayout>, justify: Val<::bevy_text::Justify>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::with_justify( - _self.into_inner(), - justify.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::with_justify( + safe_transmute(_self), + safe_transmute(justify), + ); + safe_transmute(output) } }; output @@ -424,12 +404,11 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::with_linebreak( - _self.into_inner(), - linebreak.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::with_linebreak( + safe_transmute(_self), + safe_transmute(linebreak), + ); + safe_transmute(output) } }; output @@ -442,11 +421,10 @@ pub(crate) fn register_text_layout_functions(world: &mut World) { |_self: Val<::bevy_text::TextLayout>| { let output: Val<::bevy_text::TextLayout> = { { - let output: Val<::bevy_text::TextLayout> = ::bevy_text::TextLayout::with_no_wrap( - _self.into_inner(), - ) - .into(); - output + let output: ::bevy_text::TextLayout = ::bevy_text::TextLayout::with_no_wrap( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -471,11 +449,10 @@ pub(crate) fn register_text_span_functions(world: &mut World) { |_self: Ref<::bevy_text::TextSpan>| { let output: Val<::bevy_text::TextSpan> = { { - let output: Val<::bevy_text::TextSpan> = <::bevy_text::TextSpan as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextSpan = <::bevy_text::TextSpan as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -500,11 +477,10 @@ pub(crate) fn register_text_bounds_functions(world: &mut World) { |_self: Ref<::bevy_text::TextBounds>| { let output: Val<::bevy_text::TextBounds> = { { - let output: Val<::bevy_text::TextBounds> = <::bevy_text::TextBounds as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextBounds = <::bevy_text::TextBounds as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -517,12 +493,11 @@ pub(crate) fn register_text_bounds_functions(world: &mut World) { |width: f32, height: f32| { let output: Val<::bevy_text::TextBounds> = { { - let output: Val<::bevy_text::TextBounds> = ::bevy_text::TextBounds::new( - width, - height, - ) - .into(); - output + let output: ::bevy_text::TextBounds = ::bevy_text::TextBounds::new( + safe_transmute(width), + safe_transmute(height), + ); + safe_transmute(output) } }; output @@ -535,11 +510,10 @@ pub(crate) fn register_text_bounds_functions(world: &mut World) { |width: f32| { let output: Val<::bevy_text::TextBounds> = { { - let output: Val<::bevy_text::TextBounds> = ::bevy_text::TextBounds::new_horizontal( - width, - ) - .into(); - output + let output: ::bevy_text::TextBounds = ::bevy_text::TextBounds::new_horizontal( + safe_transmute(width), + ); + safe_transmute(output) } }; output @@ -552,11 +526,10 @@ pub(crate) fn register_text_bounds_functions(world: &mut World) { |height: f32| { let output: Val<::bevy_text::TextBounds> = { { - let output: Val<::bevy_text::TextBounds> = ::bevy_text::TextBounds::new_vertical( - height, - ) - .into(); - output + let output: ::bevy_text::TextBounds = ::bevy_text::TextBounds::new_vertical( + safe_transmute(height), + ); + safe_transmute(output) } }; output @@ -582,10 +555,9 @@ pub(crate) fn register_font_smoothing_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_text::FontSmoothing as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -598,11 +570,10 @@ pub(crate) fn register_font_smoothing_functions(world: &mut World) { |_self: Ref<::bevy_text::FontSmoothing>| { let output: Val<::bevy_text::FontSmoothing> = { { - let output: Val<::bevy_text::FontSmoothing> = <::bevy_text::FontSmoothing as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::FontSmoothing = <::bevy_text::FontSmoothing as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -620,9 +591,8 @@ pub(crate) fn register_font_smoothing_functions(world: &mut World) { { let output: bool = <::bevy_text::FontSmoothing as ::std::cmp::PartialEq< ::bevy_text::FontSmoothing, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -647,11 +617,10 @@ pub(crate) fn register_glyph_atlas_location_functions(world: &mut World) { |_self: Ref<::bevy_text::GlyphAtlasLocation>| { let output: Val<::bevy_text::GlyphAtlasLocation> = { { - let output: Val<::bevy_text::GlyphAtlasLocation> = <::bevy_text::GlyphAtlasLocation as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::GlyphAtlasLocation = <::bevy_text::GlyphAtlasLocation as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -676,11 +645,10 @@ pub(crate) fn register_glyph_atlas_info_functions(world: &mut World) { |_self: Ref<::bevy_text::GlyphAtlasInfo>| { let output: Val<::bevy_text::GlyphAtlasInfo> = { { - let output: Val<::bevy_text::GlyphAtlasInfo> = <::bevy_text::GlyphAtlasInfo as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::GlyphAtlasInfo = <::bevy_text::GlyphAtlasInfo as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -705,11 +673,10 @@ pub(crate) fn register_positioned_glyph_functions(world: &mut World) { |_self: Ref<::bevy_text::PositionedGlyph>| { let output: Val<::bevy_text::PositionedGlyph> = { { - let output: Val<::bevy_text::PositionedGlyph> = <::bevy_text::PositionedGlyph as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::PositionedGlyph = <::bevy_text::PositionedGlyph as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -734,11 +701,10 @@ pub(crate) fn register_computed_text_block_functions(world: &mut World) { |_self: Ref<::bevy_text::ComputedTextBlock>| { let output: Val<::bevy_text::ComputedTextBlock> = { { - let output: Val<::bevy_text::ComputedTextBlock> = <::bevy_text::ComputedTextBlock as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::ComputedTextBlock = <::bevy_text::ComputedTextBlock as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -752,10 +718,9 @@ pub(crate) fn register_computed_text_block_functions(world: &mut World) { let output: bool = { { let output: bool = ::bevy_text::ComputedTextBlock::needs_rerender( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -780,11 +745,10 @@ pub(crate) fn register_text_entity_functions(world: &mut World) { |_self: Ref<::bevy_text::TextEntity>| { let output: Val<::bevy_text::TextEntity> = { { - let output: Val<::bevy_text::TextEntity> = <::bevy_text::TextEntity as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextEntity = <::bevy_text::TextEntity as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -809,11 +773,10 @@ pub(crate) fn register_text_layout_info_functions(world: &mut World) { |_self: Ref<::bevy_text::TextLayoutInfo>| { let output: Val<::bevy_text::TextLayoutInfo> = { { - let output: Val<::bevy_text::TextLayoutInfo> = <::bevy_text::TextLayoutInfo as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextLayoutInfo = <::bevy_text::TextLayoutInfo as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -838,11 +801,10 @@ pub(crate) fn register_line_height_functions(world: &mut World) { |_self: Ref<::bevy_text::LineHeight>| { let output: Val<::bevy_text::LineHeight> = { { - let output: Val<::bevy_text::LineHeight> = <::bevy_text::LineHeight as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::LineHeight = <::bevy_text::LineHeight as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -857,9 +819,8 @@ pub(crate) fn register_line_height_functions(world: &mut World) { { let output: bool = <::bevy_text::LineHeight as ::std::cmp::PartialEq< ::bevy_text::LineHeight, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -884,11 +845,10 @@ pub(crate) fn register_text_background_color_functions(world: &mut World) { |_self: Ref<::bevy_text::TextBackgroundColor>| { let output: Val<::bevy_text::TextBackgroundColor> = { { - let output: Val<::bevy_text::TextBackgroundColor> = <::bevy_text::TextBackgroundColor as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_text::TextBackgroundColor = <::bevy_text::TextBackgroundColor as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -906,9 +866,8 @@ pub(crate) fn register_text_background_color_functions(world: &mut World) { { let output: bool = <::bevy_text::TextBackgroundColor as ::std::cmp::PartialEq< ::bevy_text::TextBackgroundColor, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_time_bms_bindings/src/lib.rs b/crates/bindings/bevy_time_bms_bindings/src/lib.rs index bfeb9fd13f..457e112a27 100644 --- a/crates/bindings/bevy_time_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_time_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -24,11 +24,10 @@ pub(crate) fn register_fixed_functions(world: &mut World) { |_self: Ref<::bevy_time::Fixed>| { let output: Val<::bevy_time::Fixed> = { { - let output: Val<::bevy_time::Fixed> = <::bevy_time::Fixed as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::Fixed = <::bevy_time::Fixed as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -53,11 +52,10 @@ pub(crate) fn register_real_functions(world: &mut World) { |_self: Ref<::bevy_time::Real>| { let output: Val<::bevy_time::Real> = { { - let output: Val<::bevy_time::Real> = <::bevy_time::Real as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::Real = <::bevy_time::Real as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -83,10 +81,9 @@ pub(crate) fn register_timer_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_time::Timer as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -99,11 +96,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: Val<::bevy_time::Timer> = { { - let output: Val<::bevy_time::Timer> = <::bevy_time::Timer as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::Timer = <::bevy_time::Timer as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -116,11 +112,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: Val<::core::time::Duration> = { { - let output: Val<::core::time::Duration> = ::bevy_time::Timer::duration( - &_self, - ) - .into(); - output + let output: ::core::time::Duration = ::bevy_time::Timer::duration( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -133,11 +128,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: Val<::core::time::Duration> = { { - let output: Val<::core::time::Duration> = ::bevy_time::Timer::elapsed( - &_self, - ) - .into(); - output + let output: ::core::time::Duration = ::bevy_time::Timer::elapsed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -150,9 +144,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: f32 = { { - let output: f32 = ::bevy_time::Timer::elapsed_secs(&_self) - .into(); - output + let output: f32 = ::bevy_time::Timer::elapsed_secs( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -165,9 +160,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: f64 = { { - let output: f64 = ::bevy_time::Timer::elapsed_secs_f64(&_self) - .into(); - output + let output: f64 = ::bevy_time::Timer::elapsed_secs_f64( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -182,9 +178,8 @@ pub(crate) fn register_timer_functions(world: &mut World) { { let output: bool = <::bevy_time::Timer as ::core::cmp::PartialEq< ::bevy_time::Timer, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -197,8 +192,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Timer>| { let output: () = { { - let output: () = ::bevy_time::Timer::finish(&mut _self).into(); - output + let output: () = ::bevy_time::Timer::finish( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -211,8 +208,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: bool = { { - let output: bool = ::bevy_time::Timer::finished(&_self).into(); - output + let output: bool = ::bevy_time::Timer::finished( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -225,8 +224,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: f32 = { { - let output: f32 = ::bevy_time::Timer::fraction(&_self).into(); - output + let output: f32 = ::bevy_time::Timer::fraction( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -239,9 +240,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: f32 = { { - let output: f32 = ::bevy_time::Timer::fraction_remaining(&_self) - .into(); - output + let output: f32 = ::bevy_time::Timer::fraction_remaining( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -254,12 +256,11 @@ pub(crate) fn register_timer_functions(world: &mut World) { |duration: f32, mode: Val<::bevy_time::TimerMode>| { let output: Val<::bevy_time::Timer> = { { - let output: Val<::bevy_time::Timer> = ::bevy_time::Timer::from_seconds( - duration, - mode.into_inner(), - ) - .into(); - output + let output: ::bevy_time::Timer = ::bevy_time::Timer::from_seconds( + safe_transmute(duration), + safe_transmute(mode), + ); + safe_transmute(output) } }; output @@ -272,9 +273,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: bool = { { - let output: bool = ::bevy_time::Timer::is_finished(&_self) - .into(); - output + let output: bool = ::bevy_time::Timer::is_finished( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -287,8 +289,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: bool = { { - let output: bool = ::bevy_time::Timer::is_paused(&_self).into(); - output + let output: bool = ::bevy_time::Timer::is_paused( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -301,9 +305,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: bool = { { - let output: bool = ::bevy_time::Timer::just_finished(&_self) - .into(); - output + let output: bool = ::bevy_time::Timer::just_finished( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -316,11 +321,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: Val<::bevy_time::TimerMode> = { { - let output: Val<::bevy_time::TimerMode> = ::bevy_time::Timer::mode( - &_self, - ) - .into(); - output + let output: ::bevy_time::TimerMode = ::bevy_time::Timer::mode( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -333,12 +337,11 @@ pub(crate) fn register_timer_functions(world: &mut World) { |duration: Val<::core::time::Duration>, mode: Val<::bevy_time::TimerMode>| { let output: Val<::bevy_time::Timer> = { { - let output: Val<::bevy_time::Timer> = ::bevy_time::Timer::new( - duration.into_inner(), - mode.into_inner(), - ) - .into(); - output + let output: ::bevy_time::Timer = ::bevy_time::Timer::new( + safe_transmute(duration), + safe_transmute(mode), + ); + safe_transmute(output) } }; output @@ -351,8 +354,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Timer>| { let output: () = { { - let output: () = ::bevy_time::Timer::pause(&mut _self).into(); - output + let output: () = ::bevy_time::Timer::pause( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -365,8 +370,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: bool = { { - let output: bool = ::bevy_time::Timer::paused(&_self).into(); - output + let output: bool = ::bevy_time::Timer::paused( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -379,11 +386,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: Val<::core::time::Duration> = { { - let output: Val<::core::time::Duration> = ::bevy_time::Timer::remaining( - &_self, - ) - .into(); - output + let output: ::core::time::Duration = ::bevy_time::Timer::remaining( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -396,9 +402,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |_self: Ref<::bevy_time::Timer>| { let output: f32 = { { - let output: f32 = ::bevy_time::Timer::remaining_secs(&_self) - .into(); - output + let output: f32 = ::bevy_time::Timer::remaining_secs( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -411,8 +418,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Timer>| { let output: () = { { - let output: () = ::bevy_time::Timer::reset(&mut _self).into(); - output + let output: () = ::bevy_time::Timer::reset( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -426,11 +435,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_time::Timer::set_duration( - &mut _self, - duration.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(duration), + ); + safe_transmute(output) } }; output @@ -444,11 +452,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_time::Timer::set_elapsed( - &mut _self, - time.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(time), + ); + safe_transmute(output) } }; output @@ -462,11 +469,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_time::Timer::set_mode( - &mut _self, - mode.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(mode), + ); + safe_transmute(output) } }; output @@ -480,10 +486,9 @@ pub(crate) fn register_timer_functions(world: &mut World) { let output: u32 = { { let output: u32 = ::bevy_time::Timer::times_finished_this_tick( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -496,8 +501,10 @@ pub(crate) fn register_timer_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Timer>| { let output: () = { { - let output: () = ::bevy_time::Timer::unpause(&mut _self).into(); - output + let output: () = ::bevy_time::Timer::unpause( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -523,10 +530,9 @@ pub(crate) fn register_timer_mode_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_time::TimerMode as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -539,11 +545,10 @@ pub(crate) fn register_timer_mode_functions(world: &mut World) { |_self: Ref<::bevy_time::TimerMode>| { let output: Val<::bevy_time::TimerMode> = { { - let output: Val<::bevy_time::TimerMode> = <::bevy_time::TimerMode as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::TimerMode = <::bevy_time::TimerMode as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -558,9 +563,8 @@ pub(crate) fn register_timer_mode_functions(world: &mut World) { { let output: bool = <::bevy_time::TimerMode as ::core::cmp::PartialEq< ::bevy_time::TimerMode, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -585,11 +589,10 @@ pub(crate) fn register_virtual_functions(world: &mut World) { |_self: Ref<::bevy_time::Virtual>| { let output: Val<::bevy_time::Virtual> = { { - let output: Val<::bevy_time::Virtual> = <::bevy_time::Virtual as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::Virtual = <::bevy_time::Virtual as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -615,10 +618,9 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_time::Stopwatch as ::core::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -631,11 +633,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |_self: Ref<::bevy_time::Stopwatch>| { let output: Val<::bevy_time::Stopwatch> = { { - let output: Val<::bevy_time::Stopwatch> = <::bevy_time::Stopwatch as ::core::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_time::Stopwatch = <::bevy_time::Stopwatch as ::core::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -648,11 +649,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |_self: Ref<::bevy_time::Stopwatch>| { let output: Val<::core::time::Duration> = { { - let output: Val<::core::time::Duration> = ::bevy_time::Stopwatch::elapsed( - &_self, - ) - .into(); - output + let output: ::core::time::Duration = ::bevy_time::Stopwatch::elapsed( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -665,9 +665,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |_self: Ref<::bevy_time::Stopwatch>| { let output: f32 = { { - let output: f32 = ::bevy_time::Stopwatch::elapsed_secs(&_self) - .into(); - output + let output: f32 = ::bevy_time::Stopwatch::elapsed_secs( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -681,10 +682,9 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { let output: f64 = { { let output: f64 = ::bevy_time::Stopwatch::elapsed_secs_f64( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -699,9 +699,8 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { { let output: bool = <::bevy_time::Stopwatch as ::core::cmp::PartialEq< ::bevy_time::Stopwatch, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -714,9 +713,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |_self: Ref<::bevy_time::Stopwatch>| { let output: bool = { { - let output: bool = ::bevy_time::Stopwatch::is_paused(&_self) - .into(); - output + let output: bool = ::bevy_time::Stopwatch::is_paused( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -729,9 +729,8 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { || { let output: Val<::bevy_time::Stopwatch> = { { - let output: Val<::bevy_time::Stopwatch> = ::bevy_time::Stopwatch::new() - .into(); - output + let output: ::bevy_time::Stopwatch = ::bevy_time::Stopwatch::new(); + safe_transmute(output) } }; output @@ -744,9 +743,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Stopwatch>| { let output: () = { { - let output: () = ::bevy_time::Stopwatch::pause(&mut _self) - .into(); - output + let output: () = ::bevy_time::Stopwatch::pause( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -759,9 +759,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Stopwatch>| { let output: () = { { - let output: () = ::bevy_time::Stopwatch::reset(&mut _self) - .into(); - output + let output: () = ::bevy_time::Stopwatch::reset( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -775,11 +776,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { let output: () = { { let output: () = ::bevy_time::Stopwatch::set_elapsed( - &mut _self, - time.into_inner(), - ) - .into(); - output + safe_transmute(_self), + safe_transmute(time), + ); + safe_transmute(output) } }; output @@ -792,9 +792,10 @@ pub(crate) fn register_stopwatch_functions(world: &mut World) { |mut _self: Mut<::bevy_time::Stopwatch>| { let output: () = { { - let output: () = ::bevy_time::Stopwatch::unpause(&mut _self) - .into(); - output + let output: () = ::bevy_time::Stopwatch::unpause( + safe_transmute(_self), + ); + safe_transmute(output) } }; output diff --git a/crates/bindings/bevy_ui_render_bms_bindings/src/lib.rs b/crates/bindings/bevy_ui_render_bms_bindings/src/lib.rs index d2db5cee1f..ddb13f9d92 100644 --- a/crates/bindings/bevy_ui_render_bms_bindings/src/lib.rs +++ b/crates/bindings/bevy_ui_render_bms_bindings/src/lib.rs @@ -8,7 +8,7 @@ use bevy_mod_scripting_bindings::{ ReflectReference, function::{ from::{Ref, Mut, Val}, - namespace::NamespaceBuilder, + namespace::NamespaceBuilder, glue::safe_transmute, }, }; use bevy_ecs::prelude::*; @@ -25,10 +25,9 @@ pub(crate) fn register_box_shadow_samples_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ui_render::BoxShadowSamples as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -41,11 +40,10 @@ pub(crate) fn register_box_shadow_samples_functions(world: &mut World) { |_self: Ref<::bevy_ui_render::BoxShadowSamples>| { let output: Val<::bevy_ui_render::BoxShadowSamples> = { { - let output: Val<::bevy_ui_render::BoxShadowSamples> = <::bevy_ui_render::BoxShadowSamples as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ui_render::BoxShadowSamples = <::bevy_ui_render::BoxShadowSamples as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -63,9 +61,8 @@ pub(crate) fn register_box_shadow_samples_functions(world: &mut World) { { let output: bool = <::bevy_ui_render::BoxShadowSamples as ::std::cmp::PartialEq< ::bevy_ui_render::BoxShadowSamples, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output @@ -91,10 +88,9 @@ pub(crate) fn register_ui_anti_alias_functions(world: &mut World) { let output: () = { { let output: () = <::bevy_ui_render::UiAntiAlias as ::std::cmp::Eq>::assert_receiver_is_total_eq( - &_self, - ) - .into(); - output + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -107,11 +103,10 @@ pub(crate) fn register_ui_anti_alias_functions(world: &mut World) { |_self: Ref<::bevy_ui_render::UiAntiAlias>| { let output: Val<::bevy_ui_render::UiAntiAlias> = { { - let output: Val<::bevy_ui_render::UiAntiAlias> = <::bevy_ui_render::UiAntiAlias as ::std::clone::Clone>::clone( - &_self, - ) - .into(); - output + let output: ::bevy_ui_render::UiAntiAlias = <::bevy_ui_render::UiAntiAlias as ::std::clone::Clone>::clone( + safe_transmute(_self), + ); + safe_transmute(output) } }; output @@ -129,9 +124,8 @@ pub(crate) fn register_ui_anti_alias_functions(world: &mut World) { { let output: bool = <::bevy_ui_render::UiAntiAlias as ::std::cmp::PartialEq< ::bevy_ui_render::UiAntiAlias, - >>::eq(&_self, &other) - .into(); - output + >>::eq(safe_transmute(_self), safe_transmute(other)); + safe_transmute(output) } }; output diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 491d187b97..561ccfe3e4 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -613,10 +613,11 @@ impl Xtasks { if ide_mode { clippy_args.push("--message-format=json"); } + clippy_args.extend(["--all-targets", "--examples"]); let keep_going = std::env::var(XTASK_KEEP_GOING).is_ok(); if !keep_going { - clippy_args.extend(vec!["--all-targets", "--", "-D", "warnings"]); + clippy_args.extend(vec!["--", "-D", "warnings"]); } run_workspace_command( @@ -653,7 +654,6 @@ impl Xtasks { settings.template_args.as_str(), "--features", settings.bevy_features.join(",").as_str(), - "-v", ], Some(&settings.bevy_dir), false, @@ -682,7 +682,6 @@ impl Xtasks { settings.template_args.as_str(), "--features", settings.bevy_features.join(",").as_str(), - "-v", ], Some(&settings.bevy_dir), false,