diff --git a/Cargo.lock b/Cargo.lock index c3b5192c048..44aeab75c29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,18 +56,18 @@ dependencies = [ [[package]] name = "gccjit" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4c19a75fd8c674bbcd459fc8235ff38f8e5219c07fc3b022556fd28d16c909" +checksum = "5bb358d2563af5e32af92620915e6b05839ae60645343473735619441f45eb04" dependencies = [ "gccjit_sys", ] [[package]] name = "gccjit_sys" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c3a46c818a4b7d6c8d572ed0f3513a091dcf8e8dbafbb58381c6062eaef942" +checksum = "2389fb01673e9cc63684d996a58079edccc5de89008274f3be59f1b16ac1f017" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index c503cff6702..1aff8ed115e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ default = ["master"] [dependencies] object = { version = "0.37.0", default-features = false, features = ["std", "read"] } tempfile = "3.20" -gccjit = { version = "5.0.0", features = ["dlopen"] } +gccjit = { version = "6.0.0", features = ["dlopen"] } #gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] } # Local copy. diff --git a/libgccjit.version b/libgccjit.version index 1ff77eb3efe..47539d889df 100644 --- a/libgccjit.version +++ b/libgccjit.version @@ -1 +1 @@ -3498409672c805d51b46faaa4a14f8682de8e1bf +201ca90ac810d1c6509c252cc9c87d3ace0661d7 diff --git a/src/gcc_util.rs b/src/gcc_util.rs index 56314dca5ef..5524cfad32d 100644 --- a/src/gcc_util.rs +++ b/src/gcc_util.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::collections::HashSet; use std::env; @@ -119,22 +120,22 @@ fn arch_to_gcc(name: &str) -> &str { } } -fn handle_native(name: &str) -> &str { +fn handle_native(name: &str) -> Cow<'_, str> { if name != NATIVE_CPU { - return arch_to_gcc(name); + return arch_to_gcc(name).into(); } #[cfg(feature = "master")] { // Get the native arch. let context = Context::default(); - context.get_target_info().arch().unwrap().to_str().unwrap() + Cow::Owned(context.get_target_info().arch().to_str().unwrap().to_string()) } #[cfg(not(feature = "master"))] unimplemented!(); } -pub fn target_cpu(sess: &Session) -> &str { +pub fn target_cpu(sess: &Session) -> Cow<'_, str> { match sess.opts.cg.target_cpu { Some(ref name) => handle_native(name), None => handle_native(sess.target.cpu.as_ref()), diff --git a/src/lib.rs b/src/lib.rs index 436f8a11763..2819e04261a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -288,7 +288,7 @@ impl CodegenBackend for GccCodegenBackend { } fn target_cpu(&self, sess: &Session) -> String { - target_cpu(sess).to_owned() + target_cpu(sess).into_owned() } fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box {