aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-13 16:33:47 +0100
committerPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-03-30 13:52:29 +0200
commitf9ff02ad6ff0343743ebbfa492a512000445ed52 (patch)
treee849229676825b4ab4d5ca849927a0283a986101
parentfc8a92c4874730b193fbd78140a4b5486ffce752 (diff)
downloadgcc-f9ff02ad6ff0343743ebbfa492a512000445ed52.zip
gcc-f9ff02ad6ff0343743ebbfa492a512000445ed52.tar.gz
gcc-f9ff02ad6ff0343743ebbfa492a512000445ed52.tar.bz2
libproc_macro: Add is_available interface
Add the rust interface for the is_available function in libproc_macro. ChangeLog: * librust/proc_macro/rust/lib.rs: Add is_available. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--librust/proc_macro/rust/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs
index 4b6272d..65cf8eb 100644
--- a/librust/proc_macro/rust/lib.rs
+++ b/librust/proc_macro/rust/lib.rs
@@ -12,6 +12,17 @@ mod literal;
mod punct;
mod span;
+/// Determines whether proc_macro has been made accessible to the currently
+/// running program.
+///
+/// # Note
+///
+/// This function provide a non panicking way to detect whether the API is
+/// invoked from inside of a procedural macro.
+pub fn is_available() -> bool {
+ todo!("Implement this function")
+}
+
/// A single token or a delimited sequence of token trees.
#[derive(Clone)]
pub enum TokenTree {