pub fn generate_hidden_includes(unique_id: &str, def_crate: &str) -> TokenStream {
	if ::std::env::var("CARGO_PKG_NAME").unwrap() == def_crate {
		TokenStream::new()
	} else {
		let mod_name = generate_hidden_includes_mod_name(unique_id);

		match crate_name(def_crate) {
			Ok(name) => {
				let name = Ident::new(&name, Span::call_site());
				quote::quote!(
					#[doc(hidden)]
					mod #mod_name {
						pub extern crate #name as hidden_include;
					}
				)
			},
			Err(e) => {
				let err = Error::new(Span::call_site(), &e).to_compile_error();
				quote!( #err )
			}
		}

	}
}
/// Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope .
pub fn generate_hidden_includes(unique_id: &str, def_crate: &str) -> TokenStream {
	if ::std::env::var("CARGO_PKG_NAME").unwrap() == def_crate {
		TokenStream::new()
	} else {
		let mod_name = generate_hidden_includes_mod_name(unique_id);
		match crate_name(def_crate) {
			Ok(name) => {
				let name = Ident::new(&name, Span::call_site());
				quote::quote!(
					#[doc(hidden)]
					mod #mod_name {
						pub extern crate #name as hidden_include;
					}
				)
			},
			Err(e) => {
				let err = Error::new(Span::call_site(), &e).to_compile_error();
				quote!( #err )
			}
		}
	}
}
pub fn generate_hidden_includes ( unique_id : & str , def_crate : & str ) -> TokenStream { if :: std :: env :: var ( " " ) . unwrap ( ) == def_crate { TokenStream :: new ( ) } else { let mod_name = generate_hidden_includes_mod_name ( unique_id ) ; match crate_name ( def_crate ) { Ok ( name ) => { let name = Ident :: new ( & name , Span :: call_site ( ) ) ; quote :: quote ! ( [ doc ( hidden ) ] mod mod_name { pub extern crate name as hidden_include } ) } , Err ( e ) => { let err = Error :: new ( Span :: call_site ( ) , & e ) . to_compile_error ( ) ; quote ! ( err ) } } } }
Generates the hidden includes that are required to make the macro independent from its scope.
Generates the hidden includes that are required to make the macro independent from its scope .
unique_id
&str
def_crate
&str
unique_id
&str
def_crate
&str