Skip to content

Commit 7174bcc

Browse files
authored
Rollup merge of #133545 - clubby789:symbol-intern-lit, r=jieyouxu
Lint against Symbol::intern on a string literal Disabled in tests where this doesn't make much sense
2 parents c5acac9 + a2e9aac commit 7174bcc

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/driver/jit.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn create_jit_module(
7474
jit_builder.symbol("__clif_jit_fn", clif_jit_fn as *const u8);
7575
let mut jit_module = UnwindModule::new(JITModule::new(jit_builder), false);
7676

77-
let cx = crate::CodegenCx::new(tcx, jit_module.isa(), false, Symbol::intern("dummy_cgu_name"));
77+
let cx = crate::CodegenCx::new(tcx, jit_module.isa(), false, sym::dummy_cgu_name);
7878

7979
crate::allocator::codegen(tcx, &mut jit_module);
8080

@@ -276,12 +276,7 @@ fn jit_fn(instance_ptr: *const Instance<'static>, trampoline_ptr: *const u8) ->
276276

277277
jit_module.module.prepare_for_function_redefine(func_id).unwrap();
278278

279-
let mut cx = crate::CodegenCx::new(
280-
tcx,
281-
jit_module.isa(),
282-
false,
283-
Symbol::intern("dummy_cgu_name"),
284-
);
279+
let mut cx = crate::CodegenCx::new(tcx, jit_module.isa(), false, sym::dummy_cgu_name);
285280
codegen_and_compile_fn(tcx, &mut cx, &mut Context::new(), jit_module, instance);
286281

287282
assert!(cx.global_asm.is_empty());

src/lib.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -189,18 +189,13 @@ impl CodegenBackend for CraneliftCodegenBackend {
189189
// FIXME return the actually used target features. this is necessary for #[cfg(target_feature)]
190190
if sess.target.arch == "x86_64" && sess.target.os != "none" {
191191
// x86_64 mandates SSE2 support
192-
vec![Symbol::intern("fxsr"), sym::sse, Symbol::intern("sse2")]
192+
vec![sym::fsxr, sym::sse, sym::sse2]
193193
} else if sess.target.arch == "aarch64" {
194194
match &*sess.target.os {
195195
"none" => vec![],
196196
// On macOS the aes, sha2 and sha3 features are enabled by default and ring
197197
// fails to compile on macOS when they are not present.
198-
"macos" => vec![
199-
sym::neon,
200-
Symbol::intern("aes"),
201-
Symbol::intern("sha2"),
202-
Symbol::intern("sha3"),
203-
],
198+
"macos" => vec![sym::neon, sym::aes, sym::sha2, sym::sha3],
204199
// AArch64 mandates Neon support
205200
_ => vec![sym::neon],
206201
}

0 commit comments

Comments
 (0)