diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-07-01 18:00:14 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-02 00:00:14 +0000 |
commit | e746b6d80654ba4e4e26370fe6e4f784ce841d92 (patch) | |
tree | 153ffad92a96126b9ab8e906dcdabf7648755931 /ops/deno.rs | |
parent | b9c0e7cd550ab14fa7da7e33ed87cbeeeb9785a0 (diff) |
refactor(core): Extract deno_core (#19658)
`deno_core` is moving out! You'll find it at
https://github.com/denoland/deno_core/ once this PR lands.
Diffstat (limited to 'ops/deno.rs')
-rw-r--r-- | ops/deno.rs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/ops/deno.rs b/ops/deno.rs deleted file mode 100644 index fbaf2a9e6..000000000 --- a/ops/deno.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -#![cfg(not(test))] - -use proc_macro2::Span; -use proc_macro2::TokenStream; -use proc_macro_crate::crate_name; -use proc_macro_crate::FoundCrate; -use quote::quote; -use syn::Ident; - -/// Identifier to the `deno_core` crate. -/// -/// If macro called in deno_core, `crate` is used. -/// If macro called outside deno_core, `deno_core` OR the renamed -/// version from Cargo.toml is used. -pub(crate) fn import() -> TokenStream { - let found_crate = - crate_name("deno_core").expect("deno_core not present in `Cargo.toml`"); - - match found_crate { - FoundCrate::Itself => { - // TODO(@littledivy): This won't work for `deno_core` examples - // since `crate` does not refer to `deno_core`. - // examples must re-export deno_core to make this work - // until Span inspection APIs are stabilized. - // - // https://github.com/rust-lang/rust/issues/54725 - quote!(crate) - } - FoundCrate::Name(name) => { - let ident = Ident::new(&name, Span::call_site()); - quote!(#ident) - } - } -} |