diff --git a/mozjs/examples/wasm.rs b/mozjs/examples/wasm.rs
index 0976f51820..13e43161e6 100644
--- a/mozjs/examples/wasm.rs
+++ b/mozjs/examples/wasm.rs
@@ -63,20 +63,20 @@ fn run(rt: Runtime) {
         assert!(JS_GetProperty(
             rt.cx(),
             global.handle(),
-            b"WebAssembly\0".as_ptr() as *const c_char,
+            c"WebAssembly".as_ptr(),
             &mut wasm.handle_mut()
         ));
         rooted!(in(rt.cx()) let mut wasm_obj = wasm.to_object());
         assert!(JS_GetProperty(
             rt.cx(),
             wasm_obj.handle(),
-            b"Module\0".as_ptr() as *const c_char,
+            c"Module".as_ptr(),
             &mut wasm_module.handle_mut()
         ));
         assert!(JS_GetProperty(
             rt.cx(),
             wasm_obj.handle(),
-            b"Instance\0".as_ptr() as *const c_char,
+            c"Instance".as_ptr(),
             &mut wasm_instance.handle_mut()
         ));
 
@@ -113,7 +113,7 @@ fn run(rt: Runtime) {
             let function = JS_DefineFunction(
                 rt.cx(),
                 env_import_obj.handle().into(),
-                b"bar\0".as_ptr() as *const c_char,
+                c"bar".as_ptr(),
                 Some(bar),
                 1,
                 0,
@@ -126,7 +126,7 @@ fn run(rt: Runtime) {
             assert!(JS_SetProperty(
                 rt.cx(),
                 imports.handle(),
-                b"env\0".as_ptr() as *const c_char,
+                c"env".as_ptr(),
                 env_import.handle()
             ));
 
@@ -146,7 +146,7 @@ fn run(rt: Runtime) {
         assert!(JS_GetProperty(
             rt.cx(),
             instance.handle(),
-            b"exports\0".as_ptr() as *const c_char,
+            c"exports".as_ptr(),
             &mut exports.handle_mut()
         ));
 
@@ -155,7 +155,7 @@ fn run(rt: Runtime) {
         assert!(JS_GetProperty(
             rt.cx(),
             exports_obj.handle(),
-            b"foo\0".as_ptr() as *const c_char,
+            c"foo".as_ptr(),
             &mut foo.handle_mut()
         ));
 
diff --git a/mozjs/src/error.rs b/mozjs/src/error.rs
index bd018ddf88..d3dedb8fd7 100644
--- a/mozjs/src/error.rs
+++ b/mozjs/src/error.rs
@@ -8,30 +8,24 @@
 
 use crate::jsapi::{JSContext, JSErrorFormatString, JSExnType, JS_ReportErrorNumberUTF8};
 use libc;
-use std::ffi::CString;
-use std::ptr::addr_of;
+use std::ffi::{CStr, CString};
 use std::{mem, os, ptr};
 
 /// Format string used to throw javascript errors.
-static ERROR_FORMAT_STRING_STRING: [libc::c_char; 4] = [
-    '{' as libc::c_char,
-    '0' as libc::c_char,
-    '}' as libc::c_char,
-    0 as libc::c_char,
-];
+static ERROR_FORMAT_STRING_STRING: &CStr = c"{0}";
 
 /// Format string struct used to throw `TypeError`s.
 static mut TYPE_ERROR_FORMAT_STRING: JSErrorFormatString = JSErrorFormatString {
-    name: b"RUSTMSG_TYPE_ERROR\0" as *const _ as *const libc::c_char,
-    format: &ERROR_FORMAT_STRING_STRING as *const libc::c_char,
+    name: c"RUSTMSG_TYPE_ERROR".as_ptr(),
+    format: ERROR_FORMAT_STRING_STRING.as_ptr(),
     argCount: 1,
     exnType: JSExnType::JSEXN_TYPEERR as i16,
 };
 
 /// Format string struct used to throw `RangeError`s.
 static mut RANGE_ERROR_FORMAT_STRING: JSErrorFormatString = JSErrorFormatString {
-    name: b"RUSTMSG_RANGE_ERROR\0" as *const _ as *const libc::c_char,
-    format: &ERROR_FORMAT_STRING_STRING as *const libc::c_char,
+    name: c"RUSTMSG_RANGE_ERROR".as_ptr(),
+    format: ERROR_FORMAT_STRING_STRING.as_ptr(),
     argCount: 1,
     exnType: JSExnType::JSEXN_RANGEERR as i16,
 };
@@ -44,8 +38,8 @@ unsafe extern "C" fn get_error_message(
 ) -> *const JSErrorFormatString {
     let num: JSExnType = mem::transmute(error_number);
     match num {
-        JSExnType::JSEXN_TYPEERR => addr_of!(TYPE_ERROR_FORMAT_STRING),
-        JSExnType::JSEXN_RANGEERR => addr_of!(RANGE_ERROR_FORMAT_STRING),
+        JSExnType::JSEXN_TYPEERR => &raw const TYPE_ERROR_FORMAT_STRING,
+        JSExnType::JSEXN_RANGEERR => &raw const RANGE_ERROR_FORMAT_STRING,
         _ => panic!(
             "Bad js error number given to get_error_message: {}",
             error_number
diff --git a/mozjs/src/gc/custom.rs b/mozjs/src/gc/custom.rs
index 7dd365c235..55b49b45f0 100644
--- a/mozjs/src/gc/custom.rs
+++ b/mozjs/src/gc/custom.rs
@@ -1,7 +1,6 @@
 use std::ffi::c_void;
 use std::ops::{Deref, DerefMut};
 
-use crate::c_str;
 use crate::glue::{CallObjectRootTracer, CallValueRootTracer};
 use crate::jsapi;
 use crate::jsapi::{AutoGCRooter, AutoGCRooterKind, JSContext, JSObject, JSTracer, Value};
@@ -18,7 +17,7 @@ unsafe impl CustomTrace for *mut JSObject {
     fn trace(&self, trc: *mut JSTracer) {
         let this = self as *const *mut _ as *mut *mut _;
         unsafe {
-            CallObjectRootTracer(trc, this, c_str!("object"));
+            CallObjectRootTracer(trc, this, c"object".as_ptr());
         }
     }
 }
@@ -27,7 +26,7 @@ unsafe impl CustomTrace for Value {
     fn trace(&self, trc: *mut JSTracer) {
         let this = self as *const _ as *mut _;
         unsafe {
-            CallValueRootTracer(trc, this, c_str!("any"));
+            CallValueRootTracer(trc, this, c"any".as_ptr());
         }
     }
 }
diff --git a/mozjs/src/gc/macros.rs b/mozjs/src/gc/macros.rs
index 68da81d120..74e82c6c69 100644
--- a/mozjs/src/gc/macros.rs
+++ b/mozjs/src/gc/macros.rs
@@ -1,11 +1,3 @@
-// Creates a C string literal `$str`.
-#[macro_export]
-macro_rules! c_str {
-    ($str:expr) => {
-        concat!($str, "\0").as_ptr() as *const ::std::os::raw::c_char
-    };
-}
-
 #[macro_export]
 macro_rules! rooted {
 	(in($cx:expr) let $($var:ident)+ = $init:expr) => {
diff --git a/mozjs/src/gc/trace.rs b/mozjs/src/gc/trace.rs
index 42269b7f6d..4c875215a4 100644
--- a/mozjs/src/gc/trace.rs
+++ b/mozjs/src/gc/trace.rs
@@ -1,4 +1,3 @@
-use crate::c_str;
 use crate::glue::{
     CallBigIntTracer, CallFunctionTracer, CallIdTracer, CallObjectTracer, CallScriptTracer,
     CallStringTracer, CallSymbolTracer, CallValueRootTracer, CallValueTracer,
@@ -51,7 +50,7 @@ unsafe impl Traceable for Heap<*mut JSFunction> {
         if self.get().is_null() {
             return;
         }
-        CallFunctionTracer(trc, self as *const _ as *mut Self, c_str!("function"));
+        CallFunctionTracer(trc, self as *const _ as *mut Self, c"function".as_ptr());
     }
 }
 
@@ -61,7 +60,7 @@ unsafe impl Traceable for Heap<*mut JSObject> {
         if self.get().is_null() {
             return;
         }
-        CallObjectTracer(trc, self as *const _ as *mut Self, c_str!("object"));
+        CallObjectTracer(trc, self as *const _ as *mut Self, c"object".as_ptr());
     }
 }
 
@@ -70,7 +69,7 @@ unsafe impl Traceable for Heap<*mut Symbol> {
         if self.get().is_null() {
             return;
         }
-        CallSymbolTracer(trc, self as *const _ as *mut Self, c_str!("symbol"));
+        CallSymbolTracer(trc, self as *const _ as *mut Self, c"symbol".as_ptr());
     }
 }
 
@@ -79,7 +78,7 @@ unsafe impl Traceable for Heap<*mut BigInt> {
         if self.get().is_null() {
             return;
         }
-        CallBigIntTracer(trc, self as *const _ as *mut Self, c_str!("bigint"));
+        CallBigIntTracer(trc, self as *const _ as *mut Self, c"bigint".as_ptr());
     }
 }
 
@@ -89,7 +88,7 @@ unsafe impl Traceable for Heap<*mut JSScript> {
         if self.get().is_null() {
             return;
         }
-        CallScriptTracer(trc, self as *const _ as *mut Self, c_str!("script"));
+        CallScriptTracer(trc, self as *const _ as *mut Self, c"script".as_ptr());
     }
 }
 
@@ -99,28 +98,28 @@ unsafe impl Traceable for Heap<*mut JSString> {
         if self.get().is_null() {
             return;
         }
-        CallStringTracer(trc, self as *const _ as *mut Self, c_str!("string"));
+        CallStringTracer(trc, self as *const _ as *mut Self, c"string".as_ptr());
     }
 }
 
 unsafe impl Traceable for Heap<Value> {
     #[inline]
     unsafe fn trace(&self, trc: *mut JSTracer) {
-        CallValueTracer(trc, self as *const _ as *mut Self, c_str!("value"));
+        CallValueTracer(trc, self as *const _ as *mut Self, c"value".as_ptr());
     }
 }
 
 unsafe impl Traceable for Value {
     #[inline]
     unsafe fn trace(&self, trc: *mut JSTracer) {
-        CallValueRootTracer(trc, self as *const _ as *mut Self, c_str!("value"));
+        CallValueRootTracer(trc, self as *const _ as *mut Self, c"value".as_ptr());
     }
 }
 
 unsafe impl Traceable for Heap<jsid> {
     #[inline]
     unsafe fn trace(&self, trc: *mut JSTracer) {
-        CallIdTracer(trc, self as *const _ as *mut Self, c_str!("id"));
+        CallIdTracer(trc, self as *const _ as *mut Self, c"id".as_ptr());
     }
 }
 
@@ -131,20 +130,20 @@ unsafe impl Traceable for Heap<PropertyDescriptor> {
         CallValueTracer(
             trc,
             &desc.value_ as *const _ as *mut Heap<Value>,
-            c_str!("PropertyDescriptor::value"),
+            c"PropertyDescriptor::value".as_ptr(),
         );
         if !desc.getter_.is_null() {
             CallObjectTracer(
                 trc,
                 &desc.getter_ as *const _ as *mut Heap<*mut JSObject>,
-                c_str!("PropertyDescriptor::getter"),
+                c"PropertyDescriptor::getter".as_ptr(),
             );
         }
         if !desc.setter_.is_null() {
             CallObjectTracer(
                 trc,
                 &desc.setter_ as *const _ as *mut Heap<*mut JSObject>,
-                c_str!("PropertyDescriptor::setter"),
+                c"PropertyDescriptor::setter".as_ptr(),
             );
         }
     }
diff --git a/mozjs/src/rust.rs b/mozjs/src/rust.rs
index deeb964855..66c7f7f3de 100644
--- a/mozjs/src/rust.rs
+++ b/mozjs/src/rust.rs
@@ -827,7 +827,7 @@ static SIMPLE_GLOBAL_CLASS_OPS: JSClassOps = JSClassOps {
 
 /// This is a simple `JSClass` for global objects, primarily intended for tests.
 pub static SIMPLE_GLOBAL_CLASS: JSClass = JSClass {
-    name: b"Global\0" as *const u8 as *const _,
+    name: c"Global".as_ptr(),
     flags: JSCLASS_IS_GLOBAL
         | ((JSCLASS_GLOBAL_SLOT_COUNT & JSCLASS_RESERVED_SLOTS_MASK)
             << JSCLASS_RESERVED_SLOTS_SHIFT),
diff --git a/mozjs/tests/callback.rs b/mozjs/tests/callback.rs
index f0dbd829e2..71df42496b 100644
--- a/mozjs/tests/callback.rs
+++ b/mozjs/tests/callback.rs
@@ -38,7 +38,7 @@ fn callback() {
         let function = JS_DefineFunction(
             context,
             global.handle().into(),
-            b"puts\0".as_ptr() as *const libc::c_char,
+            c"puts".as_ptr(),
             Some(puts),
             1,
             0,
@@ -57,10 +57,7 @@ unsafe extern "C" fn puts(context: *mut JSContext, argc: u32, vp: *mut Value) ->
     let args = CallArgs::from_vp(vp, argc);
 
     if args.argc_ != 1 {
-        JS_ReportErrorASCII(
-            context,
-            b"puts() requires exactly 1 argument\0".as_ptr() as *const libc::c_char,
-        );
+        JS_ReportErrorASCII(context, c"puts() requires exactly 1 argument".as_ptr());
         return false;
     }
 
diff --git a/mozjs/tests/capture_stack.rs b/mozjs/tests/capture_stack.rs
index 68573cb0ab..acc5225b43 100644
--- a/mozjs/tests/capture_stack.rs
+++ b/mozjs/tests/capture_stack.rs
@@ -36,7 +36,7 @@ fn capture_stack() {
         let function = JS_DefineFunction(
             context,
             global.handle().into(),
-            b"print_stack\0".as_ptr() as *const libc::c_char,
+            c"print_stack".as_ptr(),
             Some(print_stack),
             0,
             0,
diff --git a/mozjs/tests/enumerate.rs b/mozjs/tests/enumerate.rs
index 74f2908202..d892aa3998 100644
--- a/mozjs/tests/enumerate.rs
+++ b/mozjs/tests/enumerate.rs
@@ -64,7 +64,7 @@ fn enumerate() {
         assert!(JS_StringEqualsAscii(
             context,
             id.get(),
-            b"a\0" as *const _ as *const _,
+            c"a".as_ptr(),
             &mut matches
         ));
         assert!(matches);
diff --git a/mozjs/tests/panic.rs b/mozjs/tests/panic.rs
index 674086c05d..d74cce7d5c 100644
--- a/mozjs/tests/panic.rs
+++ b/mozjs/tests/panic.rs
@@ -37,7 +37,7 @@ fn test_panic() {
         let function = JS_DefineFunction(
             context,
             global.handle().into(),
-            b"test\0".as_ptr() as *const _,
+            c"test".as_ptr(),
             Some(test),
             0,
             0,
diff --git a/mozjs/tests/property_descriptor.rs b/mozjs/tests/property_descriptor.rs
index 7540a5a5bd..963fa34333 100644
--- a/mozjs/tests/property_descriptor.rs
+++ b/mozjs/tests/property_descriptor.rs
@@ -47,7 +47,7 @@ fn property_descriptor() {
         assert!(JS_DefineProperty(
             context,
             object.handle().into(),
-            b"property\0" as *const u8 as *const libc::c_char,
+            c"property".as_ptr(),
             property.handle().into(),
             attrs
         ));
@@ -59,7 +59,7 @@ fn property_descriptor() {
         assert!(JS_GetPropertyDescriptor(
             context,
             object.handle().into(),
-            b"property\0" as *const u8 as *const libc::c_char,
+            c"property".as_ptr(),
             descriptor.handle_mut().into(),
             holder.handle_mut().into(),
             &mut is_none
@@ -81,28 +81,28 @@ fn property_descriptor() {
         assert!(JS_GetProperty(
             context,
             desc_object.handle().into(),
-            b"value\0" as *const u8 as *const libc::c_char,
+            c"value".as_ptr(),
             rval.handle_mut().into()
         ));
         assert_eq!(rval.get().to_int32(), 32);
         assert!(JS_GetProperty(
             context,
             desc_object.handle().into(),
-            b"configurable\0" as *const u8 as *const libc::c_char,
+            c"configurable".as_ptr(),
             rval.handle_mut().into()
         ));
         assert!(!rval.get().to_boolean());
         assert!(JS_GetProperty(
             context,
             desc_object.handle().into(),
-            b"enumerable\0" as *const u8 as *const libc::c_char,
+            c"enumerable".as_ptr(),
             rval.handle_mut().into()
         ));
         assert!(rval.get().to_boolean());
         assert!(JS_GetProperty(
             context,
             desc_object.handle().into(),
-            b"writable\0" as *const u8 as *const libc::c_char,
+            c"writable".as_ptr(),
             rval.handle_mut().into()
         ));
         assert!(!rval.get().to_boolean());
diff --git a/mozjs/tests/rooting.rs b/mozjs/tests/rooting.rs
index c79461d1e7..156d04f2ad 100644
--- a/mozjs/tests/rooting.rs
+++ b/mozjs/tests/rooting.rs
@@ -62,7 +62,7 @@ unsafe extern "C" fn generic_method(_: *mut JSContext, _: u32, _: *mut Value) ->
 const METHODS: &'static [JSFunctionSpec] = &[
     JSFunctionSpec {
         name: JSPropertySpec_Name {
-            string_: b"addEventListener\0" as *const u8 as *const libc::c_char,
+            string_: c"addEventListener".as_ptr(),
         },
         call: JSNativeWrapper {
             op: Some(generic_method),
@@ -74,7 +74,7 @@ const METHODS: &'static [JSFunctionSpec] = &[
     },
     JSFunctionSpec {
         name: JSPropertySpec_Name {
-            string_: b"removeEventListener\0" as *const u8 as *const libc::c_char,
+            string_: c"removeEventListener".as_ptr(),
         },
         call: JSNativeWrapper {
             op: Some(generic_method),
@@ -86,7 +86,7 @@ const METHODS: &'static [JSFunctionSpec] = &[
     },
     JSFunctionSpec {
         name: JSPropertySpec_Name {
-            string_: b"dispatchEvent\0" as *const u8 as *const libc::c_char,
+            string_: c"dispatchEvent".as_ptr(),
         },
         call: JSNativeWrapper {
             op: Some(generic_method),
@@ -100,7 +100,7 @@ const METHODS: &'static [JSFunctionSpec] = &[
 ];
 
 static CLASS: JSClass = JSClass {
-    name: b"EventTargetPrototype\0" as *const u8 as *const libc::c_char,
+    name: c"EventTargetPrototype".as_ptr(),
     flags: 0,
     cOps: 0 as *const _,
     spec: ptr::null(),
diff --git a/mozjs/tests/runtime.rs b/mozjs/tests/runtime.rs
index 02d975b416..c60d89f67b 100644
--- a/mozjs/tests/runtime.rs
+++ b/mozjs/tests/runtime.rs
@@ -65,7 +65,7 @@ static CLASS_OPS: JSClassOps = JSClassOps {
 };
 
 static CLASS: JSClass = JSClass {
-    name: b"EventTargetPrototype\0" as *const u8 as *const libc::c_char,
+    name: c"EventTargetPrototype".as_ptr(),
     flags: JSCLASS_FOREGROUND_FINALIZE,
     cOps: &CLASS_OPS as *const JSClassOps,
     spec: ptr::null(),