@@ -184,7 +184,7 @@ impl fmt::Debug for CStr {
184184/// ```
185185/// #![feature(cstr_macro)]
186186///
187- /// use core::ffi::CStr;
187+ /// use core::ffi::{cstr, CStr} ;
188188///
189189/// const HELLO: &CStr = cstr!("Hello, world!");
190190/// assert_eq!(HELLO.to_bytes_with_nul(), b"Hello, world!\0");
@@ -196,16 +196,17 @@ impl fmt::Debug for CStr {
196196/// ```compile_fail
197197/// #![feature(const_cstr_from_bytes)]
198198///
199- /// use core::ffi::CStr;
199+ /// use core::ffi::{cstr, CStr} ;
200200///
201201/// const HELLO: &CStr = cstr!("Hello, world!\0"); // compile fail!
202202/// ```
203- #[ macro_export]
203+ #[ macro_export( local_inner_macros ) ]
204204#[ unstable( feature = "cstr_macro" , issue = "101607" ) ]
205205#[ rustc_diagnostic_item = "core_cstr_macro" ]
206- macro_rules! cstr {
206+ #[ doc( hidden) ]
207+ macro_rules! __cstr_macro_impl {
207208 ( ) => {
208- cstr !( "" )
209+ __cstr_macro_impl !( "" )
209210 } ;
210211 ( $s: literal) => { {
211212 const BYTES : & [ u8 ] = $crate:: ffi:: __cstr_macro_impl_as_bytes( $s) ;
@@ -216,6 +217,9 @@ macro_rules! cstr {
216217 CSTR
217218 } } ;
218219}
220+ #[ unstable( feature = "cstr_macro" , issue = "101607" ) ]
221+ #[ doc( inline) ]
222+ pub use __cstr_macro_impl as cstr;
219223
220224#[ unstable( feature = "cstr_macro" , issue = "101607" ) ]
221225#[ doc( hidden) ]
0 commit comments