Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hide StandaloneLevel
  • Loading branch information
cyrgani committed Nov 5, 2025
commit 60291f82c97967314b71409edcfc55dfa875f9a2
11 changes: 8 additions & 3 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,25 @@ pub fn is_available() -> bool {
/// `Never` to `FallbackOnly`.
#[unstable(feature = "proc_macro_standalone", issue = "130856")]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum StandaloneLevel {
enum StandaloneLevel {
/// The standalone implementation is never used. This is the default.
Never,
/// The standalone implementation is only used outside of procedural macros.
FallbackOnly,
/// The standalone implementation is always used, even in procedural macros.
///
/// This does not actually work and should be removed before merging.
Always,
}

/// Enables the new experimental standalone backend, which allows calling the
/// functions in this crate outside of procedural macros.
///
/// When stabilizing this feature, this function will be removed and all programs
/// will have the fallback activated automatically.
#[unstable(feature = "proc_macro_standalone", issue = "130856")]
pub fn enable_standalone(level: StandaloneLevel) {
bridge::client::enable_standalone(level);
pub fn enable_standalone() {
bridge::client::enable_standalone(StandaloneLevel::FallbackOnly);
}

/// The main type provided by this crate, representing an abstract stream of
Expand Down