public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] libproc_macro: Add is_available interface
@ 2023-04-06 21:30 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-06 21:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f9ff02ad6ff0343743ebbfa492a512000445ed52

commit f9ff02ad6ff0343743ebbfa492a512000445ed52
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Feb 13 16:33:47 2023 +0100

    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>

Diff:
---
 librust/proc_macro/rust/lib.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs
index 4b6272dc11b..65cf8eb2bce 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 {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-06 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 21:30 [gcc/devel/rust/master] libproc_macro: Add is_available interface Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).